Skip to content

Commit 9e8b34b

Browse files
committed
feat: add Newly Observed ScreenConnect Host Server rule under Command & Control
Parses the &h= relay host from ScreenConnect.ClientService.exe command lines via extract_matches and surfaces relays not pointing at the official screenconnect.com / connectwisecontrol.com cloud, scoped to a single endpoint. Mirrors the Elastic ESQL rule for newly observed self-hosted ScreenConnect servers (T1219.002).
1 parent 046d09a commit 9e8b34b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

s1_powerquery_hunting.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@
149149
"name": "Screenconnect Remote Execution",
150150
"query": "(src.process.parent.name = 'ScreenConnect.ClientService.exe' AND src.process.name in ('powershell.exe', 'cmd.exe'))\n| group _FirstSeenMs=min(event.time), _LastSeenMs=max(event.time), Count=count(), UniqueSrcCmdlines=array_agg_distinct(src.process.cmdline) by endpoint.name, src.process.user, src.process.parent.name, src.process.name, src.process.verified\n| let _firstSeenNs = _FirstSeenMs * 1000000\n| let _lastSeenNs = _LastSeenMs * 1000000\n| let AllSrcCmdlines = UniqueSrcCmdlines.to_string(', ')\n| columns \"first.timestamp\" = _firstSeenNs, \"last.timestamp\" = _lastSeenNs, endpoint.name, src.process.user, src.process.parent.name, src.process.name, src.process.verified, AllSrcCmdlines, Count\n| sort -Count\n| limit 100000"
151151
},
152+
{
153+
"category": "Command & Control",
154+
"name": "Newly Observed ScreenConnect Host Server",
155+
"query": "(src.process.name = \"ScreenConnect.ClientService.exe\" OR src.process.publisher contains:anycase \"ConnectWise\") AND src.process.cmdline contains:anycase \"&h=\"\n| let screenconnectServer = src.process.cmdline.extract_matches('[?&]h=([^&\"]+)').get(0)\n| filter screenconnectServer != null\n| filter NOT (screenconnectServer contains:anycase \".screenconnect.com\" OR screenconnectServer contains:anycase \".connectwisecontrol.com\")\n| group _FirstSeenMs=min(event.time), _LastSeenMs=max(event.time), Count=count(), EndpointCount=estimate_distinct(endpoint.name), UniqueHosts=array_agg_distinct(endpoint.name), UniqueUsers=array_agg_distinct(src.process.user), UniqueParents=array_agg_distinct(src.process.parent.name), UniqueCmdlines=array_agg_distinct(src.process.cmdline) by screenconnectServer\n| filter EndpointCount == 1\n| let _firstSeenNs = _FirstSeenMs * 1000000\n| let _lastSeenNs = _LastSeenMs * 1000000\n| let AllHosts = UniqueHosts.to_string(', '), AllUsers = UniqueUsers.to_string(', '), AllParents = UniqueParents.to_string(', '), AllCmdlines = UniqueCmdlines.to_string(' | ')\n| columns \"first.timestamp\" = _firstSeenNs, \"last.timestamp\" = _lastSeenNs, screenconnectServer, EndpointCount, AllHosts, AllUsers, AllParents, AllCmdlines, Count\n| sort -_FirstSeenMs\n| limit 100000"
156+
},
152157
{
153158
"category": "Execution & TTPs",
154159
"name": "NetExec RDP Behaviour detected",

0 commit comments

Comments
 (0)