SaferComputing.com

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.

Published
Updated
Last checked
Applies to
Windows 10 and 11
Technical specification
Target artifactRemote-access programs installed as Windows services or run as portable copies: ConnectWise ScreenConnect, AnyDesk, TeamViewer, RustDesk and similar tools.
Default behaviourLegitimate 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 stateNo 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 WindowsGet-Service | Where-Object { $_.DisplayName -match 'ScreenConnect|ConnectWise|AnyDesk|TeamViewer|RustDesk|Splashtop|NetSupport|Atera|LogMeIn' } | Select-Object Status, Name, DisplayName
Fix on Windowsdisconnect 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 under C:\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
Windows PowerShell, as Administrator
Get-Process | Where-Object { $_.ProcessName -match 'ScreenConnect|AnyDesk|TeamViewer|rustdesk|quickassist|client32' } | Select-Object ProcessName, Id, Path
Installed programs
Windows PowerShell, as Administrator
$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, Publisher
Services created recently

Windows records event 7045 in the System log every time a service is installed:

Windows PowerShell, as Administrator
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:

Windows PowerShell, as Administrator
$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.

Windows PowerShell, as Administrator
Get-WinEvent -LogName Application -MaxEvents 2000 | Where-Object { $_.ProviderName -like 'ScreenConnect*' } | Select-Object TimeCreated, Id, Message
AnyDesk
FileWhere
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
Windows PowerShell
Get-Content "$env:ProgramData\AnyDesk\connection_trace.txt", "$env:APPDATA\AnyDesk\connection_trace.txt" -ErrorAction SilentlyContinue

The 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

  1. Disconnect the computer from the internet. This ends any session in progress.
  2. Uninstall each tool in Settings, Apps, Installed apps.
  3. If a service is still listed, stop it and delete it, using the exact name from the check:
Windows PowerShell, as Administrator
Stop-Service -Name 'SERVICE_NAME' -Force
sc.exe delete 'SERVICE_NAME'
  1. Remove leftover start-up entries you found: Unregister-ScheduledTask -TaskName 'TASK_NAME' for a task, and Remove-ItemProperty -Path 'KEY_PATH' -Name 'VALUE_NAME' for a Run entry.
  2. Run every check again. If you cannot be sure the computer is clean, have Windows reinstalled.
  3. 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.

Sources