Detection logic
Original SigmaHQ detection and related fields from the pinned file. The source file includes its full metadata.
logsource:
category: process_creation
product: windows
detection:
selection_img:
- Image|endswith:
- '\powershell.exe'
- '\pwsh.exe'
- OriginalFileName:
- 'PowerShell.EXE'
- 'pwsh.dll'
selection_cli_adsi:
CommandLine|contains: '[ADSI]'
selection_cli_create_user:
# Example (WinNT - local user):
# powershell.exe -Command "$c = [ADSI]('WinNT://' + $env:COMPUTERNAME); $u = $c.Create('User','NewUser'); $u.SetPassword('P@ssw0rd!'); $u.SetInfo()"
# Example (LDAP - domain user):
# $ou = [ADSI]"LDAP://CN=Users,DC=domain,DC=com"; $user = $ou.Create("user", "CN=NewUser"); $user.Put("sAMAccountName","NewUser"); $user.SetInfo()
CommandLine|contains:
- '.Create("user'
- ".Create('user"
selection_cli_adsi_provider:
CommandLine|contains:
- 'WinNT://' # Local user creation via WinNT provider
- 'LDAP://' # Domain user creation via LDAP provider
condition: all of selection_*
falsepositives:
- Legitimate administrative scripts that use ADSI to provision user accounts but should be rare in most environments