ports/389
389/tcp
LDAP · Directory
The Active Directory database over the wire: users, groups, computers, SPNs and delegation settings. An authenticated bind — sometimes an anonymous one — reads the entire blueprint of the domain.
ProtocolTCP
Serviceldap
Also on636/tcp (LDAPS)
Default onActive Directory DCs
AuthSimple bind, SASL, Kerberos
SigningLDAP signing often not enforced
01
Enumerate
start hereBind and dump the directory, then feed it to BloodHound to find paths.
# does it allow an anonymous bind? ldapsearch -x -H ldap://$IP -s base namingContexts # dump users, groups, SPNs and delegation as your user nxc ldap $IP -u $USER -p $PASS --bloodhound --collection All --dns-server $IP # quick users and descriptions (passwords hide in descriptions) nxc ldap $IP -u $USER -p $PASS --users
02
Weaknesses
check each one CHECK HOW TO TELL WHAT IT GIVES YOU
Anonymous bind
Base query returns data with -x and no creds Users, groups, naming contexts LDAP signing not enforced
Server accepts an unsigned simple bind A relay target for NTLM Secrets in attributes
Passwords in description / info fields Credentials for free LDAP is where the whole domain is described, so it’s the single richest source of targeting information on an internal engagement. If signing isn’t enforced it’s also a relay destination — captured authentication forwarded here can add a computer account or set up delegation.