Detection rules › Kusto
Sdelete deployed via GPO and run recursively
This query looks for the Sdelete process being run recursively after being deployed to a host via GPO. Attackers could use this technique to deploy Sdelete to multiple host and delete data on them.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Impact |
Telemetry coverage
| Provider | Record / event type |
|---|---|
| Security-Auditing | Event ID 4688: A new process has been created. |
Rule body
id: d9f28fdf-abc8-4f1a-a7e7-1aaec87a2fc5
name: Sdelete deployed via GPO and run recursively
description: |
'This query looks for the Sdelete process being run recursively after being deployed to a host via GPO. Attackers could use this technique to deploy Sdelete to multiple host and delete data on them.'
severity: Medium
requiredDataConnectors:
- connectorId: SecurityEvents
dataTypes:
- SecurityEvent
- connectorId: WindowsSecurityEvents
dataTypes:
- SecurityEvent
queryFrequency: 1d
queryPeriod: 1d
triggerOperator: gt
triggerThreshold: 0
status: Available
tactics:
- Impact
relevantTechniques:
- T1485
tags:
-
query: |
SecurityEvent
| where EventID == 4688
| where Process =~ "svchost.exe"
| where CommandLine has "-k GPSvcGroup" or CommandLine has "-s gpsvc"
| extend timekey = bin(TimeGenerated, 1m)
| project timekey, NewProcessId, Computer
| join kind=inner (SecurityEvent
| where EventID == 4688
| where Process =~ "sdelete.exe" or CommandLine has "sdelete"
| where ParentProcessName endswith "svchost.exe"
| where CommandLine has_all ("-s", "-r")
| extend newProcess = Process
| extend timekey = bin(TimeGenerated, 1m)
) on $left.NewProcessId == $right.ProcessId, timekey, Computer
| extend HostName = tostring(split(Computer, ".")[0]), DomainIndex = toint(indexof(Computer, '.'))
| extend HostNameDomain = iff(DomainIndex != -1, substring(Computer, DomainIndex + 1), Computer)
| extend AccountName = tostring(split(TargetAccount, @'\')[1]), AccountNTDomain = tostring(split(TargetAccount, @'\')[0])
entityMappings:
- entityType: Account
fieldMappings:
- identifier: FullName
columnName: TargetAccount
- identifier: Name
columnName: AccountName
- identifier: NTDomain
columnName: AccountNTDomain
- entityType: Host
fieldMappings:
- identifier: FullName
columnName: Computer
- identifier: HostName
columnName: HostName
- identifier: DnsDomain
columnName: HostNameDomain
version: 1.0.2
kind: Scheduled
Stages and Predicates
Stage 1: source
SecurityEvent
Stage 2: where
| where EventID == 4688
Stage 3: where
| where Process =~ "svchost.exe"
Stage 4: where
| where CommandLine has "-k GPSvcGroup" or CommandLine has "-s gpsvc"
Stage 5: extend
| extend timekey = bin(TimeGenerated, 1m)
Stage 6: project
| project timekey, NewProcessId, Computer
Stage 7: join
| join kind=inner (SecurityEvent
| where EventID == 4688
| where Process =~ "sdelete.exe" or CommandLine has "sdelete"
| where ParentProcessName endswith "svchost.exe"
| where CommandLine has_all ("-s", "-r")
| extend newProcess = Process
| extend timekey = bin(TimeGenerated, 1m)
) on $left.NewProcessId == $right.ProcessId, timekey, Computer
Stage 8: extend (3 consecutive steps)
| extend HostName = tostring(split(Computer, ".")[0]), DomainIndex = toint(indexof(Computer, '.'))
| extend HostNameDomain = iff(DomainIndex != -1, substring(Computer, DomainIndex + 1), Computer)
| extend AccountName = tostring(split(TargetAccount, @'\')[1]), AccountNTDomain = tostring(split(TargetAccount, @'\')[0])
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
CommandLine | match |
| field:"CommandLine" kind:match |
EventID | eq |
| field:"EventID" kind:eq value:"4688" |
ParentProcessName | ends_with |
| field:"ParentImage" kind:ends_with value:"svchost.exe" |
Process | eq |
| field:"Process" kind:eq |
Output fields
These fields are emitted when the rule matches.
| Field | Source |
|---|---|
Computer | project |
NewProcessId | project |
timekey | project |
DomainIndex | extend |
HostName | extend |
HostNameDomain | extend |
AccountNTDomain | extend |
AccountName | extend |