Detection Engineering · Threat Hunting · RMM Abuse · 1 min read

Detect ScreenConnect Unattended Access Role (KQL)

Detects: the ScreenConnect client service running with the e=Access&y=Guest unattended-access role, with its relay host and port on the same command line.

ATT&CK: T1219 Remote Access Tools, T1543.003 Windows Service

Works on: Microsoft Defender for Endpoint, KQL (DeviceProcessEvents)

Tested on: two real ScreenConnect samples I detonated: all three implants in one result, each parented by services.exe

Full write-up: ScreenConnect RMM Abuse: The Cloud Client Gets In, The Self-Hosted One Stays

Anchor persistence on the launch string

Both samples wrote an EID 7045 service named ScreenConnect Client (<thumbprint>), running as LocalSystem, auto-start.

Sample 2 wrote two of them, nine minutes apart, and that count is the tell: remove the implant every alert fired on and the other one is still there, still set to auto-start.

Access means an unattended-access role, which makes this persistence rather than a one-off support session, and it survives both install modes. One field carries both the persistence tell and the cloud-versus-self-hosted read, so read it in full rather than matching on it and discarding it.

The query

Published verbatim from the newsletter issue.

// The e=Access&y=Guest role and the h= relay host live on the client process cmdline
let lookback = 30d;                                              
DeviceProcessEvents
| where Timestamp > ago(lookback)
| where FileName =~ "ScreenConnect.ClientService.exe"
| where ProcessCommandLine has "y=Guest"                         
| project Timestamp, DeviceName, FileName, ProcessCommandLine, InitiatingProcessFileName

MDE results: three ScreenConnect.ClientService.exe command lines with e=Access&y=Guest and their relay hosts, each parented by services.exe

What it catches

Every implant from both samples in one result, each with its relay and port in the clear, and every one of them parented by services.exe because they run as services.

Get the next detection in your inbox

One lab-proven detection per issue: the attacker command, the telemetry it leaves, and the KQL / ES|QL that catches it.

You confirm on Substack in one tap.

No spam. Unsubscribe anytime.

Tuning note

If you have no EDR, Sysmon carries the same service on its own: Event ID 13 writes the service ImagePath with the full launch string, relay and port included, about half a second before Event ID 22 resolves the relay. Do not scope an install detection to C:\Windows\SystemTemp\ScreenConnect\: the client installed under C:\Program Files (x86)\ScreenConnect Client (<thumbprint>)\.

Questions

Why read the client command line and not the service install event?

Defender's own ServiceInstalled event does not carry the launch string, only the service name, type, start type and account. The role and relay live on the client process command line.

Is more than one ScreenConnect Client service on a host a problem?

On a host you did not deploy to, it is an indicator on its own. ScreenConnect names each service after its instance thumbprint, so a second server means a second service.

More ScreenConnect hunts

#screenconnect#remote-access-tool#t1219#t1543-003#kql#mde

New detections go out by email first: subscribe to the newsletter.