PowerShell ScriptBlock Enumeration of AD Group Membership and User Attributes (Windows)
Flags PowerShell script blocks querying AD group membership and user details for discovery of privileged directory information.
- Product
- windows
- Category
- ps_script
- Author
- frack113 (SigmaHQ), DRL 1.1
- Published
- 2021-12-15
- Updated
- 2026-07-31
ATT&CK techniques
DiscoveryRecon
Resource Dev
Initial Access
Execution
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule flags PowerShell script content that queries Active Directory group membership and user-related attributes commonly used during discovery. Attackers may enumerate domain principals to identify existing groups and determine which users belong to permissions-bearing groups, potentially revealing accounts with elevated access. The detection relies on ScriptBlockText content matches in PowerShell Script Block Logging for specific cmdlets and parameter patterns.
Reporting behind it
Changelog
v2- v2Candidate ingested via manual entry.2026-07-31
- v1No changelog recorded for this version.2026-07-30
Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.
title: PowerShell ScriptBlock Enumeration of AD Group Membership and User Attributes (Windows)
id: 0de9477e-6d6d-45e3-9b53-526acab2fcf3
status: test
description: This rule flags PowerShell script content that queries Active Directory group membership and user-related attributes commonly used during discovery. Attackers may enumerate domain principals to identify existing groups and determine which users belong to permissions-bearing groups, potentially revealing accounts with elevated access. The detection relies on ScriptBlockText content matches in PowerShell Script Block Logging for specific cmdlets and parameter patterns.
references:
- https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1069.002/T1069.002.md
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/powershell/powershell_script/posh_ps_susp_ad_group_reco.yml
author: frack113, Huntrule Team
date: 2021-12-15
modified: 2022-12-25
tags:
- attack.discovery
- attack.t1069.001
logsource:
product: windows
category: ps_script
definition: "Requirements: Script Block Logging must be enabled"
detection:
test_2:
ScriptBlockText|contains: get-ADPrincipalGroupMembership
test_7:
ScriptBlockText|contains|all:
- get-aduser
- "-f "
- "-pr "
- DoesNotRequirePreAuth
condition: 1 of test_*
falsepositives:
- Unknown
level: low
license: DRL-1.1
related:
- id: 88f0884b-331d-403d-a3a1-b668cf035603
type: derived