T The Triage ManualTechnical Guides for IT Emergencies
P3 · Cyber Incident Response

PowerShell AD Enumeration via ADWS Bypasses LDAP-Based Detection Controls

PowerShell ActiveDirectory module cmdlets (e.g., Get-ADComputer, Get-ADUser) communicate with Domain Controllers over TCP port 9389 via Active Directory Web Services (ADWS) rather than raw LDAP (ports 389/636), creating a blind spot in detection systems that monitor only LDAP traffic. Threat actors can perform comprehensive AD enumeration without triggering standard LDAP-based alerts. Closing this gap requires enabling PowerShell Script Block Logging, adding SIEM/EDR detections for port 9389 activity, and restricting ADWS access to authorised management hosts.

Indicators

Likely causes

Diagnostic steps

  1. Review PowerShell Script Block Logs for ActiveDirectory cmdlet usage: open Event Viewer > Applications and Services Logs > Microsoft > Windows > PowerShell > Operational and filter for Event ID 4104. Search message text for 'Get-ADComputer', 'Get-ADUser', 'Get-ADGroup', or 'Import-Module ActiveDirectory'.
  2. Inspect network connections to Domain Controllers on TCP port 9389 (ADWS). Run `netstat -ano | findstr :9389` on the DC or use EDR/network flow telemetry to identify source hosts making ADWS connections.
  3. Correlate Windows Security Event ID 4624 (successful logon) timestamps on Domain Controllers with PowerShell activity timestamps to identify the account performing enumeration.
  4. Verify whether PowerShell Module Logging (Event ID 4103) and Script Block Logging (Event ID 4104) are enabled via Group Policy: Computer Configuration > Administrative Templates > Windows Components > Windows PowerShell. Enable both if absent.
  5. Audit Domain Controller firewall logs or network flow data for unusual connection volumes to port 9389, particularly from non-admin workstations, non-server hosts, or hosts outside approved management subnets.
  6. Confirm the ADWS service is running on Domain Controllers: `Get-Service -Name adws`. Cross-reference expected legitimate management hosts that should use this service against observed source IPs.
  7. Search EDR or SIEM for process creation events where powershell.exe or pwsh.exe loads the ActiveDirectory module. Correlate source host, user account, and timing to identify anomalous enumeration patterns.
  8. Run a controlled detection validation test: execute `Get-ADComputer -Filter *` from a test host and confirm whether SIEM/EDR alerts fire for ADWS traffic and PowerShell cmdlet execution. Document any gaps in coverage.

Resolution path

Prevention

Tools

References

active-directoryADWSport-9389LDAPPowerShellAD-enumerationdetection-gapthreat-detectionGet-ADComputerGet-ADUserblue-teamSIEMEDRscript-block-loggingwindows-securitydomain-controller