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

ADWS LDAP Query Attribution Failure: Correlating Event 1644 Localhost Source with Event 5156 to Recover True Attacker IP

When attackers query Active Directory via ADWS (port 9389), Event 1644 records the source IP as localhost (127.0.0.1) because ADWS acts as a local proxy to the LDAP service, masking the true origin of potentially malicious enumeration. By correlating Event 1644 with Windows Filtering Platform Event 5156 entries on port 9389 within a ±60–80ms timing window, analysts can recover the real source IP of ADWS-based LDAP queries using data already present in most SIEMs. This technique is critical for attributing AD reconnaissance activity from tools such as BloodHound that deliberately exploit ADWS to evade IP-based detection rules.

Indicators

Likely causes

Diagnostic steps

  1. Enable LDAP query diagnostic logging on the domain controller: set the registry value HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\15 Field Engineering to 5. Configure the expensive/inefficient LDAP search threshold via the domain controller's ms-DS-Other-Settings attribute (e.g., ExpensiveSearchResultsThreshold=1) to ensure Event 1644 is generated for relevant queries.
  2. Enable Windows Filtering Platform connection auditing on the domain controller: run 'auditpol /set /subcategory:"Filtering Platform Connection" /success:enable /failure:enable' from an elevated command prompt. Verify with 'auditpol /get /subcategory:"Filtering Platform Connection"'.
  3. Confirm both Event 1644 (Directory Service log) and Event 5156 (Security log) are being forwarded to your centralised SIEM from all domain controllers. Check Windows Event Forwarding subscriptions or SIEM agent configuration to validate ingestion.
  4. In your SIEM, query for Event 1644 entries where the source IP field is 127.0.0.1, indicating the query arrived via ADWS. Record the exact timestamp, LDAP filter, and requested attributes for each matching event.
  5. For each Event 1644 with a localhost source, query Event 5156 for inbound connections to the domain controller on destination port 9389 within a ±60–80ms window of the Event 1644 timestamp. Example Splunk correlation: join EventCode=1644 (source=127.0.0.1) with EventCode=5156 (DestPort=9389) on host within a 80ms time window.
  6. Extract the SourceAddress and SourcePort from the matched Event 5156 record — this is the true originating IP of the ADWS/LDAP query. Map this IP to a hostname and user account using DHCP logs, DNS, or your asset inventory.
  7. Review the LDAP filter and requested attributes from the correlated Event 1644 (e.g., searches for adminCount=1, servicePrincipalName, nTSecurityDescriptor, or group membership) to determine whether the query pattern is consistent with known AD enumeration tools such as BloodHound or SharpHound.
  8. Investigate the attributed source host and associated user account for signs of compromise: check logon events, process execution (Event 4688 or Sysmon Event 1), and lateral movement indicators. Escalate to incident response procedures if the host is unexpected or the account is non-administrative.
  9. Build a persistent SIEM detection rule that automatically joins Event 1644 (source IP = 127.0.0.1) with Event 5156 (destination port = 9389) on the same domain controller within an 80ms window, and raises an alert when sensitive LDAP filter patterns are detected.

Resolution path

Prevention

Tools

References

active-directoryadwsldapevent-1644event-5156threat-detectionlog-correlationad-enumerationsiemlateral-movementattributionbloodhoundwindows-filtering-platformcyber-incidentrecon-detectionport-9389