Detection of Local User Enumeration via PowerShell
Adversaries utilize the Get-LocalUser PowerShell cmdlet for account discovery and situational awareness on compromised Windows endpoints.
Adversaries and Red Team operators frequently leverage the native Windows PowerShell Get-LocalUser cmdlet to perform account enumeration during the discovery phase of an attack. This activity is a common precursor to lateral movement, privilege escalation, or targeting of specific high-value accounts. While this command is a standard administrative utility, its execution in non-administrative contexts or as part of a broader reconnaissance script often indicates malicious activity. Security operations teams should monitor process execution telemetry for powershell.exe command lines containing this specific cmdlet to maintain visibility into internal network discovery efforts.
Impact
Successful local user enumeration allows attackers to identify potential targets for lateral movement and privilege escalation, increasing the risk of unauthorized access to sensitive data and critical system components within the target environment.
Recommendation
Deploy the following Sigma rule to monitor for Get-LocalUser execution in environments where such activity is not expected from standard administrative accounts.
- Ingest
Sysmon Event ID 1orWindows Security Event ID 4688into your SIEM and map to the CIMEndpointdata model. - Tune alerts by filtering known administrative service accounts or common management scripts that legitimately query local user databases.
Threat Hunt
Search for historical instances of Get-LocalUser to establish a baseline of administrative behavior
Data: Process command line logs
Detection coverage 1
Detect Get-LocalUser PowerShell Execution
mediumDetects the execution of powershell.exe with the Get-LocalUser commandlet, which is used to query local user accounts.
Detection queries are available on the platform. Get full rules →