Detection of Active Directory Enumeration via WMI
Adversaries utilize the Get-WmiObject cmdlet via PowerShell to perform Active Directory domain computer enumeration, facilitating lateral movement planning.
This threat involves the use of PowerShell to execute Get-WmiObject queries against the root\directory\ldap namespace, specifically targeting the ds_computer class. This technique is commonly employed by threat actors during the reconnaissance phase of an attack to enumerate Active Directory (AD) computers. By querying the LDAP namespace, an attacker can map the network, identify domain-joined workstations and servers, and subsequently target high-value assets for lateral movement or data exfiltration. Because this activity is highly specific to internal domain discovery, it is considered a strong indicator of malicious intent when observed in environments lacking corresponding authorized administrative work orders.
Attack Chain
- Initial access is established on a domain-joined endpoint via phishing or exploit.
- The attacker executes a PowerShell process (
powershell.exeorcmd.exespawning PowerShell). - The attacker initiates a WMI query using
Get-WmiObject. - The query specifically targets the
root\directory\ldapnamespace to interact with Active Directory. - The
ds_computerclass is specified to retrieve the list of computer objects in the domain. - The query results are parsed or exfiltrated to the attacker's C2 to map the network environment.
- The adversary uses the gathered intelligence to identify target systems for further exploitation or lateral movement.
Impact
Successful execution of this enumeration technique allows an adversary to perform situational awareness within an Active Directory environment. This provides the attacker with a target list of systems, potentially exposing critical servers and workstations. This mapping is a precursor to lateral movement, privilege escalation, and systemic compromise, increasing the risk of data theft or ransomware deployment.
Recommendation
- Deploy the Sigma rules below to monitor for PowerShell command lines invoking WMI queries against the
ds_computerclass. - Enable process-creation logging (e.g., Sysmon Event ID 1 or Windows Event ID 4688) with full command-line arguments to ensure visibility into PowerShell execution.
- Baseline the usage of
Get-WmiObjectin your environment to identify authorized administrative troubleshooting patterns and tune out false positives. - Alert on instances where this command is executed by non-administrative user accounts.
Immediate actions
Deploy Sigma detection for WMI ds_computer enumeration
Threat Hunt
Search historical logs for Get-WmiObject -Class ds_computer
Data: Process creation logs with command-line arguments
Mitigations
Restrict administrative PowerShell access to authorized accounts only
T1018
Detection coverage 1
Detect AD Reconnaissance via Get-WmiObject ds_computer
mediumDetects PowerShell execution using Get-WmiObject to query the ds_computer class in the root\directory\ldap namespace
Detection queries are available on the platform. Get full rules →