Abuse of Service Permissions to Hide Services Via Set-Service - PS

Detects usage of the "Set-Service" powershell cmdlet to configure a new SecurityDescriptor that allows a service to be hidden from other utilities such as "sc.exe", "Get-Service"...etc. (Works only in powershell 7)

Sigma rule (View on GitHub)

 1title: Abuse of Service Permissions to Hide Services Via Set-Service - PS
 2id: 953945c5-22fe-4a92-9f8a-a9edc1e522da
 3related:
 4    - id: 514e4c3a-c77d-4cde-a00f-046425e2301e
 5      type: similar
 6status: test
 7description: Detects usage of the "Set-Service" powershell cmdlet to configure a new SecurityDescriptor that allows a service to be hidden from other utilities such as "sc.exe", "Get-Service"...etc. (Works only in powershell 7)
 8references:
 9    - https://twitter.com/Alh4zr3d/status/1580925761996828672
10    - https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/set-service?view=powershell-7.2
11author: Nasreddine Bencherchali (Nextron Systems)
12date: 2022/10/17
13tags:
14    - attack.persistence
15    - attack.defense_evasion
16    - attack.privilege_escalation
17    - attack.t1574.011
18logsource:
19    product: windows
20    category: ps_script
21    definition: 'Requirements: Script Block Logging must be enabled'
22detection:
23    selection:
24        ScriptBlockText|contains|all:
25            - 'Set-Service '
26            - 'DCLCWPDTSD'
27        ScriptBlockText|contains:
28            - '-SecurityDescriptorSddl '
29            - '-sd '
30    condition: selection
31falsepositives:
32    - Rare intended use of hidden services
33    - Rare FP could occur due to the non linearity of the ScriptBlockText log
34level: high

References

Related rules

to-top