Detectionhightest
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)
Log Source
WindowsPowerShell Script
ProductWindows← raw: windows
CategoryPowerShell Script← raw: ps_script
Definition
Requirements: Script Block Logging must be enabled
Detection Logic
Detection Logic1 selector
detection:
selection:
ScriptBlockText|contains|all:
- 'Set-Service '
- 'DCLCWPDTSD'
ScriptBlockText|contains:
- '-SecurityDescriptorSddl '
- '-sd '
condition: selectionFalse Positives
Rare intended use of hidden services
Rare FP could occur due to the non linearity of the ScriptBlockText log
MITRE ATT&CK
Rule Metadata
Rule ID
953945c5-22fe-4a92-9f8a-a9edc1e522da
Status
test
Level
high
Type
Detection
Created
2022-10-17
Author
Path
rules/windows/powershell/powershell_script/posh_ps_using_set_service_to_hide_services.yml
Raw Tags
attack.persistenceattack.privilege-escalationattack.executionattack.stealthattack.t1574.011