The first goal on an AD engagement is identifying the domain name, finding domain controllers, and mapping the network topology — all before you have any credentials. DCs expose several distinctive ports (88, 389, 445, 3268) and respond to DNS queries that reveal the domain structure.
Identify domain controllers from the network
Domain controllers run Kerberos (88), LDAP (389/636), Global Catalog (3268/3269), and SMB (445). A targeted port scan finds them quickly. nxc also labels hosts as (PDC) or (DC) in SMB output.
Scan for DC-specific ports
┌──(kali㉿kali)-[~]
└─$# Quick DC fingerprint — ports that only DCs run
SMB 10.10.10.10 445 DC01 [*] Windows Server 2019 x64 (name:DC01) (domain:corp.local) (signing:True) (SMBv1:False) (DC) (PDC)
SMB 10.10.10.11 445 DC02 [*] Windows Server 2019 x64 (name:DC02) (domain:corp.local) (signing:True) (SMBv1:False) (DC)
DNS-based domain discovery
AD registers SRV records in DNS. Querying _ldap._tcp and _kerberos._tcp SRV records reveals all DCs and the domain name without touching any AD-specific port.
Discover domain via DNS SRV records
┌──(kali㉿kali)-[~]
└─$# Discover domain name and DC from DNS
┌──(kali㉿kali)-[~]
└─$nslookup -type=SRV _ldap._tcp $TARGET_IP
┌──(kali㉿kali)-[~]
└─$nslookup -type=SRV _kerberos._tcp $TARGET_IP
┌──(kali㉿kali)-[~]
└─$# dig equivalent
┌──(kali㉿kali)-[~]
└─$dig SRV _ldap._tcp.corp.local @$TARGET_IP
┌──(kali㉿kali)-[~]
└─$dig SRV _kerberos._tcp.corp.local @$TARGET_IP
┌──(kali㉿kali)-[~]
└─$dig SRV _gc._tcp.corp.local @$TARGET_IP
┌──(kali㉿kali)-[~]
└─$# Enumerate all _msdcs records (DC locator)
┌──(kali㉿kali)-[~]
└─$dig any _msdcs.corp.local @$TARGET_IP
┌──(kali㉿kali)-[~]
└─$# Reverse lookup DC IP to get hostname
┌──(kali㉿kali)-[~]
└─$nslookup $TARGET_IP$TARGET_IP
_ldap._tcp.corp.local 600 IN SRV 0 100 389 dc01.corp.local.
_kerberos._tcp.corp.local 600 IN SRV 0 100 88 dc01.corp.local.
LDAP anonymous info — no credentials needed
LDAP exposes the rootDSE object anonymously on every DC. This returns the domain naming context, forest name, DC hostname, and domain functional level without any authentication.
Query rootDSE anonymously
┌──(kali㉿kali)-[~]
└─$# Dump rootDSE — no credentials
┌──(kali㉿kali)-[~]
└─$ldapsearch -x -H ldap://$TARGET_IP -b '' -s base
We use cookies to improve your browsing experience, analyze site traffic, and personalize content. By clicking "Accept All", you consent to our use of cookies.
Privacy Policy.