LDAP

LDAP enumeration in Active Directory environments

ldapsearch

Null bind - get naming context

# ldapsearch null bind
(-x ) simple (anonymous) authentication, otherwise MD5
(-s ) scope
(-b ) basedn .. base domain name

# search for naming context 
namingContexts: DC=htb,DC=local
ldapsearch -H ldap://10.129.95.210 -x -s base

Null bind - set naming context - base domain name

ldapsearch -H ldap://10.129.95.210:389 -x -b "dc=htb,dc=local"

Account enumeration

ldapsearch -H ldap://10.129.95.210:389 -x -b DC=htb,DC=local "(objectClass=person)" | grep "sAMAccountName:"
ldapsearch -H ldap://10.129.95.210:389 -x -b "dc=htb,dc=local"
ldapsearch -H ldap://10.129.95.210:389 -x -b DC=htb,DC=local "(objectClass=person)" | grep "sAMAccountName:"
ldapsearch -H ldap://10.129.95.210 -x -b DC=htb,DC=local | grep -A 11 -i "Remote Management Users"

Domain authentication (-D)

Apache Directory Studio - LDAP GUI client

https://directory.apache.org/studio/downloads.html

windapsearch

Last updated

Was this helpful?