Suspicious Service DACL Modification Via Set-Service Cmdlet
Detects suspicious DACL modifications via the "Set-Service" cmdlet using the "SecurityDescriptorSddl" flag (Only available with PowerShell 7) that can be used to hide services or make them unstopable
Detection logic
selection_img
- Image|endswith: \pwsh.exe
- OriginalFileName: pwsh.dllselection_sddl_flag
CommandLine|contains:
- "-SecurityDescriptorSddl "
- "-sd "selection_set_service
CommandLine|contains|all:
- "Set-Service "
- D;;
CommandLine|contains:
- ;;;IU
- ;;;SU
- ;;;BA
- ;;;SY
- ;;;WDCondition
all of selection_*Raw YAML
title: Suspicious Service DACL Modification Via Set-Service Cmdlet
id: a95b9b42-1308-4735-a1af-abb1c5e6f5ac
related:
- id: 99cf1e02-00fb-4c0d-8375-563f978dfd37
type: derived
status: test
description: Detects suspicious DACL modifications via the "Set-Service" cmdlet using the "SecurityDescriptorSddl" flag (Only available with PowerShell 7) that can be used to hide services or make them unstopable
references:
- https://www.sans.org/blog/red-team-tactics-hiding-windows-services/
- https://learn.microsoft.com/pt-br/windows/win32/secauthz/sid-strings
author: Nasreddine Bencherchali (Nextron Systems)
date: 2022-10-18
tags:
- attack.privilege-escalation
- attack.persistence
- attack.t1543.003
logsource:
category: process_creation
product: windows
detection:
selection_img:
- Image|endswith: '\pwsh.exe'
- OriginalFileName: 'pwsh.dll'
selection_sddl_flag:
CommandLine|contains:
- '-SecurityDescriptorSddl '
- '-sd '
selection_set_service:
CommandLine|contains|all:
- 'Set-Service '
- 'D;;'
CommandLine|contains:
- ';;;IU'
- ';;;SU'
- ';;;BA'
- ';;;SY'
- ';;;WD'
condition: all of selection_*
falsepositives:
- Unknown
level: highFalse positives
- Unknown
References
Related rules
Similar rules
Allow Service Access Using Security Descriptor Tampering Via Sc.EXE
highwindows · Shares T1543
Deny Service Access Using Security Descriptor Tampering Via Sc.EXE
highwindows · Shares T1543
Devcon Execution Disabling VMware VMCI Device
highwindows · Shares T1543
New Kernel Driver Via SC.EXE
mediumwindows · Shares T1543