Operator On The Wire
Join
← Back to Knowledge Base
BLUE TEAM / THREAT HUNT / ACTIVE DIRECTORY / ENUMERATION

LDAP

This note documents detection patterns related to LDAP Enumeration within Active Directory environments.


Direct Indicators

Log SourceEvent ID / ProviderMeaningForensic ValueNotes
Security4662An operation was performed on an objectHighLDAP reads against AD objects can generate this when Directory Service Access auditing is enabled. Critical fields: ObjectName, ObjectType, AccessMask, SubjectUserName. Excellent for detecting targeted AD reconnaissance.
Security4624Successful logonMediumLDAP enumeration usually follows domain authentication. Correlate LogonType 3 / 9, Source IP, Logon ID with later LDAP activity.
Security4648Explicit credentials usedMediumOften appears when tools authenticate using alternate credentials before LDAP binds (e.g. runas, SharpHound alternate creds).
Security4768Kerberos TGT requestLow-MediumInitial domain authentication preceding LDAP enumeration. Useful when enumeration originates from non-interactive service or remote host.
Security4769Kerberos service ticket requestMediumLDAP enumeration against DC may request LDAP/DC SPN tickets (ldap/DC.domain.local). Stronger indicator than 4768 when correlated.
Sysmon3Network connectionHighDetect outbound LDAP / LDAPS to DCs (389 / 636 / 3268 / 3269). Strong process attribution via Image, DestinationIp, DestinationPort.
Sysmon1Process creationHighDetect execution of tools like SharpHound, PowerView, ldapsearch, dsquery, AdFind.exe. Parent-child chain often highly revealing.
Sysmon7Image loadedMediumUseful when suspicious .NET assemblies load LDAP-related libraries (System.DirectoryServices.dll, wldap32.dll). Helps identify in-memory tooling.
Sysmon10Process accessMediumMay reveal post-enumeration escalation activity if enumeration leads into token theft / LSASS access.
Directory Service Log1644Expensive / inefficient LDAP queryVery HighPowerful DC-side detection for enumeration. Captures LDAP filter, client IP, scope, returned objects. Requires diagnostic LDAP logging enabled. Extremely valuable for SharpHound-style collection detection.
ETWMicrosoft-Windows-LDAP-ClientLDAP client API activityVery HighCaptures client-side LDAP operations even when Security logs are absent. Includes bind attempts, search filters, server target, query patterns. Excellent for stealthy enumeration detection.
ETWMicrosoft-Windows-ActiveDirectory_DomainServiceDomain service internal LDAP processingHighCan expose query execution patterns inside DC internals. Useful in deep DFIR or high-fidelity lab captures.
PowerShell4104Script block loggingVery HighDetects LDAP enumeration done through PowerShell (Get-ADUser, PowerView, ADSI queries). Full script content often exposes exact filters used.
PowerShell4103Module loggingHighCaptures AD cmdlets and imported modules used for enumeration.
Defender / EDRSensor-specificLDAP hunt telemetryVery HighModern EDR often surfaces LDAP query bursts, unusual object counts, or BloodHound-like patterns even without native logs.

Indirect Indicators

IndicatorWhat To Look ForForensic ValueNotes
Large volume LDAP queriesHigh number of directory searches in short timeframeHighTypical behavior of automated enumeration tools.
Enumeration of sensitive attributesQueries targeting admin accounts, SPNs, delegation attributesCriticalOften preparatory step for attacks such as Kerberoasting or delegation abuse.
LDAP traffic from user workstationLDAP enumeration originating from non-admin machineHighSuspicious reconnaissance activity.
Sequential object discoveryEnumeration of users, groups, computers, and ACLsMediumTypical attack path mapping behavior.
Execution of BloodHound collectorsProcesses associated with SharpHound or BloodHoundCriticalDirect evidence of AD reconnaissance.

Common Tools

ToolUsage
SharpHoundCollects Active Directory relationships for BloodHound analysis.
PowerViewPerforms LDAP queries to enumerate users, groups, computers, and permissions.
ldapsearchStandard LDAP query tool used for enumeration.
CrackMapExecEnumerates domain objects and shares.
ADExplorerGUI tool capable of dumping directory objects.

Relevant Artifacts

  • Domain controller Security logs (4662)
  • LDAP query telemetry
  • Network traffic logs (LDAP connections)
  • Sysmon logs (1, 3)
  • EDR telemetry identifying enumeration tools
  • Prefetch artifacts for SharpHound, PowerView, ldapsearch
  • Authentication logs preceding enumeration
  • BloodHound collection artifacts on attacker host

MITRE ATT&CK References

  • T1087 Account Discovery
  • T1069 Permission Groups Discovery
  • T1018 Remote System Discovery
  • T1482 Domain Trust Discovery

Decision Tree

  1. Is the suspicious event present?
    • Identify high volume LDAP queries or enumeration activity.
  2. What host generated the event?
    • Determine workstation performing LDAP enumeration.
  3. Is the account expected to perform this action?
    • Investigate whether account normally performs directory queries.
  4. Pivot:
    • Source host → inspect execution of SharpHound or PowerView.
    • Account → review privilege level and access patterns.
    • Network → analyze LDAP traffic patterns and query volume.
  5. Confirm exploitation
    • Determine whether attacker performed reconnaissance to map AD attack paths.

Example Detection Templates

Hunting for reconnaissance activities using LDAP search filters | Microsoft Community Hub

KQL

SecurityEvent
| where EventID == 4662
| summarize count() by SubjectUserName, bin(TimeGenerated, 5m)
DeviceNetworkEvents
| where RemotePort in (389,636)
| summarize count() by InitiatingProcessAccountName, RemoteIP, bin(TimeGenerated,5m)

EQL

any where event.code == "4662"

Sigma

title: Suspicious LDAP Enumeration Activity
id: ldap-enumeration-detection
status: experimental
description: Detects high volume LDAP queries which may indicate Active Directory reconnaissance
logsource:
  product: windows
  service: security
detection:
  selection:
    EventID: 4662
  condition: selection
fields:
  - SubjectUserName
  - ObjectName
falsepositives:
  - Legitimate directory synchronization tools
level: medium
tags:
  - attack.discovery
  - attack.t1087

Splunk

index=* EventCode=4662  
| bin _time span=5m  
| stats count by SubjectUserName, _time  
| where count > 50  
| sort - count

Mitigation & Hardening

Control AreaMitigationEffectivenessNotes
MonitoringAlert on high volume LDAP queriesHighDetects reconnaissance activity.
Network controlsRestrict LDAP queries from non-admin systemsHighReduces reconnaissance surface.
EDR monitoringDetect SharpHound and PowerView executionCriticalDirect detection of enumeration tooling.
Least privilegeLimit directory read permissions where possibleMediumReduces exposure of sensitive objects.
Threat huntingRegularly review LDAP query patternsMediumIdentifies abnormal discovery behavior.