Detection of PowerView Get-DomainGroup Reconnaissance
Adversaries utilize the PowerView PowerShell cmdlet 'Get-DomainGroup' to perform Active Directory reconnaissance and map domain structures, facilitating subsequent privilege escalation and lateral movement.
Adversaries and Red Team operators frequently leverage the PowerView framework during the post-exploitation reconnaissance phase to gain situational awareness within a compromised Windows environment. Specifically, the 'Get-DomainGroup' cmdlet is used to enumerate all security groups within an Active Directory domain. By identifying which users belong to specific privileged or sensitive groups, an attacker can pinpoint targets for credential theft, lateral movement, or privilege escalation. This activity is visible through PowerShell Script Block Logging (EventID 4104), which captures the full command execution strings. Defenders should monitor for this cmdlet as it serves as a critical indicator of internal environment mapping that often precedes more damaging actions.
Attack Chain
- Initial access is established on a domain-joined Windows endpoint via phishing, exploit, or credential abuse.
- The attacker executes a PowerShell process (e.g., powershell.exe or pwsh.exe).
- The attacker loads the PowerView framework or imports the necessary module containing 'Get-DomainGroup'.
- The attacker executes the 'Get-DomainGroup' command to enumerate domain-level groups.
- The PowerShell engine generates EventID 4104 logs containing the command syntax.
- The adversary parses the output to identify high-value groups (e.g., Domain Admins).
- The attacker uses the gathered information to plan lateral movement or target specific users for credential harvesting.
Impact
Successful reconnaissance allows an attacker to map the target network's organizational structure, identifying administrative accounts and critical systems. This intelligence is a necessary prerequisite for sophisticated operations, including lateral movement, domain-wide privilege escalation, and exfiltration of sensitive organizational data.
Recommendation
- Enable PowerShell Script Block Logging (EventID 4104) via Group Policy on all domain-joined Windows endpoints.
- Deploy the provided Sigma rule to your SIEM to alert on the execution of 'Get-DomainGroup'.
- Investigate the context of the PowerShell execution to distinguish between authorized administrative troubleshooting and adversary reconnaissance.
Immediate actions
Enable PowerShell Script Block Logging (EventID 4104).
Threat Hunt
Search for EventID 4104 occurrences containing 'Get-DomainGroup'.
Data: Powershell Script Block Logging 4104
Detection coverage 1
Detect Get-DomainGroup PowerShell Execution
mediumDetects the execution of the Get-DomainGroup cmdlet which is used by PowerView for domain group enumeration.
Detection queries are available on the platform. Get full rules →