Reference · Remote access
ScreenConnect, AnyDesk, TeamViewer and RustDesk: find and remove unauthorized remote access
Find remote-access tools a scammer or intruder left on a Windows PC: ScreenConnect Client services, AnyDesk, TeamViewer and RustDesk, in services, installed programs, scheduled tasks, Run keys and Startup folders; read their logs, then remove them.
| Target artifact | Remote-access programs installed as Windows services or run as portable copies: ConnectWise ScreenConnect, AnyDesk, TeamViewer, RustDesk and similar tools. |
|---|---|
| Default behaviour | Legitimate software. Installed as a service, it starts with Windows and accepts its operator's connections with nobody at the keyboard; a portable copy runs without installation or administrator rights. |
| Safe state | No remote-access tool, or only the one your IT provider manages; no unknown service, scheduled task, Run entry or Startup item that launches one. |
| Check on Windows | Get-Service | Where-Object { $_.DisplayName -match 'ScreenConnect|ConnectWise|AnyDesk|TeamViewer|RustDesk|Splashtop|NetSupport|Atera|LogMeIn' } | Select-Object Status, Name, DisplayName |
| Fix on Windows | disconnect from the internet, uninstall the tool in Settings, Apps, Installed apps, then run every check on this page again |
Read the result
- A tool your own IT provider installed, under a name you recognize, is expected.
- Anything else is not, especially a service created on the day of a support call. ScreenConnect's client installs as a service named
ScreenConnect Client (followed by an identifier and), in a folder with the same name underC:\Program Files (x86)\. - Attackers often install two tools, so that removing one leaves them a way back. Run every check below, not just the first.
Find every trace
Run these in PowerShell opened with Run as administrator. Each uses the same list of names; add any tool you are looking for.
Running programs
Get-Process | Where-Object { $_.ProcessName -match 'ScreenConnect|AnyDesk|TeamViewer|rustdesk|quickassist|client32' } | Select-Object ProcessName, Id, PathInstalled programs
$keys = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*'
Get-ItemProperty $keys -ErrorAction SilentlyContinue |
Where-Object { $_.DisplayName -match 'ScreenConnect|AnyDesk|TeamViewer|RustDesk|Splashtop|NetSupport|Atera|LogMeIn' } |
Select-Object DisplayName, DisplayVersion, InstallDate, PublisherServices created recently
Windows records event 7045 in the System log every time a service is installed:
Get-WinEvent -FilterHashtable @{ LogName = 'System'; Id = 7045 } -MaxEvents 50 |
Select-Object TimeCreated, @{ Name = 'Service'; Expression = { $_.Properties[0].Value } },
@{ Name = 'Path'; Expression = { $_.Properties[1].Value } }Scheduled tasks, Run keys and Startup folders
These are the places a tool can use to start again after you remove its service:
$p = 'ScreenConnect|ConnectWise|AnyDesk|TeamViewer|RustDesk|Splashtop|NetSupport|Atera|LogMeIn'
Get-ScheduledTask | Where-Object { $_.TaskName -match $p -or ($_.Actions.Execute -match $p) } | Select-Object TaskPath, TaskName, State
Get-ItemProperty 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Run', 'HKLM:\Software\Microsoft\Windows\CurrentVersion\RunOnce', 'HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Run', 'HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\RunOnce', 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Run', 'HKCU:\Software\Microsoft\Windows\CurrentVersion\RunOnce' -ErrorAction SilentlyContinue
Get-ChildItem "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Startup", "$env:ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp"Programs listed under a Run key start every time someone signs in; RunOnce entries run once and are then deleted. The WOW6432Node keys hold the entries that 32-bit programs write on 64-bit Windows.
Read what the tool recorded
ScreenConnect
ScreenConnect writes to the Windows Application log under its service name. Incident responders read event 100 as a connection, 101 as a disconnection, 200 as a command and 201 as a file transfer. Files sent to the computer land in Documents\ConnectWiseControl\Files.
Get-WinEvent -LogName Application -MaxEvents 2000 | Where-Object { $_.ProviderName -like 'ScreenConnect*' } | Select-Object TimeCreated, Id, MessageAnyDesk
| File | Where |
|---|---|
ad.trace | %APPDATA%\AnyDesk |
ad_svc.trace | %ProgramData%\AnyDesk, only when AnyDesk was installed rather than run directly |
connection_trace.txt | %APPDATA%\AnyDesk when run directly, %ProgramData%\AnyDesk when installed |
Get-Content "$env:ProgramData\AnyDesk\connection_trace.txt", "$env:APPDATA\AnyDesk\connection_trace.txt" -ErrorAction SilentlyContinueThe RULER project, a reference for incident responders, gives the time zone of these logs as Coordinated Universal Time.
Save copies of these logs before you remove anything; your bank or the police may ask what happened and when.
Remove it
- Disconnect the computer from the internet. This ends any session in progress.
- Uninstall each tool in Settings, Apps, Installed apps.
- If a service is still listed, stop it and delete it, using the exact name from the check:
Stop-Service -Name 'SERVICE_NAME' -Force
sc.exe delete 'SERVICE_NAME'- Remove leftover start-up entries you found:
Unregister-ScheduledTask -TaskName 'TASK_NAME'for a task, andRemove-ItemProperty -Path 'KEY_PATH' -Name 'VALUE_NAME'for a Run entry. - Run every check again. If you cannot be sure the computer is clean, have Windows reinstalled.
- From another device, change the passwords of anything used on that computer, starting with email and banking. See Account compromise triage.
Tip Make the next attempt harder
Sign in with a standard user account for everyday work. Installing a service needs administrator rights, so a caller cannot get a tool installed as a service through a standard account; a portable copy can still run, which limits how long they stay rather than the first session.
Related guides and lookups
Sources
- CISA advisory AA23-025A: malicious use of remote monitoring and management software
- RULER project: ConnectWise ScreenConnect artifacts
- AnyDesk: trace files
- RULER project: AnyDesk artifacts
- Microsoft Learn: Run and RunOnce registry keys
- Microsoft Learn: registry keys affected by WOW64
- Microsoft: threat actors misusing Quick Assist, 15 May 2024