AD rides on four protocols you will touch every engagement: Kerberos (auth), LDAP (directory), DNS (location), and MSRPC/SMB (everything else). Knowing the wire format of each one tells you what to scan for, what to spoof, and what traffic looks “normal” vs attack.

Kerberos

Default AD authentication protocol since Windows 2000. Uses port 88 TCP/UDP on every Domain Controller — a live 88 is the easiest DC fingerprint. The core idea: your password never leaves the host. Instead, it encrypts a timestamp proving you know the secret, and the KDC hands back tickets you present to services.

Actors:

  • Client — the user or machine authenticating
  • KDC — Key Distribution Center, runs on every DC. Two sub-services: AS (Authentication Service) and TGS (Ticket-Granting Service)
  • krbtgt — hidden domain account; its NT hash encrypts every TGT in the domain. Owning it = Golden Ticket.
  • Service — the resource you want to reach (CIFS, HTTP, MSSQL…)

The four-message flow:

1. AS-REQ   client -> KDC : "I am user, here is a timestamp encrypted with my key"
2. AS-REP   KDC -> client : TGT (encrypted with krbtgt hash) + session key
3. TGS-REQ  client -> KDC : "Give me a ticket for SPN cifs/dc01, here is my TGT"
4. TGS-REP  KDC -> client : TGS (encrypted with service account's hash)
5. AP-REQ   client -> service : presents TGS; service decrypts and grants access

Each step maps to an attack

AS-REQ without pre-auth → AS-REP Roasting (user has DONT_REQ_PREAUTH). TGS-REP → Kerberoasting (crack the service account’s hash offline). Forged TGT with krbtgt hash → Golden Ticket. Forged TGS with service hash → Silver Ticket.

Clock skew kills Kerberos

Tickets include timestamps and are rejected if client/KDC drift more than 5 minutes. If kinit or getTGT.py fails with KRB_AP_ERR_SKEW, sync your clock to the DC (ntpdate <dc> or rdate).

LDAP

AD exposes its directory over LDAP. Lookups, binds, writes — if PowerView/BloodHound/ldapsearch can see it, it came over LDAP.

Ports:

389    LDAP (cleartext by default — sniffable)
636    LDAPS (TLS)
3268   Global Catalog (forest-wide read, subset of attributes)
3269   Global Catalog over TLS

Common search bases (DN form):

DC=inlanefreight,DC=local                          # domain root
CN=Users,DC=inlanefreight,DC=local                 # default users container
CN=Computers,DC=inlanefreight,DC=local             # default computers
OU=Domain Controllers,DC=inlanefreight,DC=local
CN=Configuration,DC=inlanefreight,DC=local         # forest-wide config (schema, sites, trusts)

Anonymous bind — rare on modern DCs but still seen on 2003/2008 holdovers and some third-party LDAP servers:

ldapsearch -H ldap://dc01 -x -b "DC=inlanefreight,DC=local" "(objectclass=*)"
ldapsearch -H ldap://dc01 -x -s base namingcontexts   # always allowed, reveals naming contexts

LDAP signing and channel binding

If the DC enforces LDAP signing (or EPA on LDAPS), NTLM relay to LDAP fails. Check with ldapsearch -LLL -x — if unsigned simple binds get strongerAuthRequired, signing is on.

DNS in AD

DNS is how clients find DCs, KDCs, and services. AD-integrated DNS stores records as AD objects, so any authenticated user can read — and in many environments, create — DNS records.

SRV records are the key. A client resolving _kerberos._tcp.dc._msdcs.<domain> gets back every DC’s hostname and port. Useful SRVs:

_ldap._tcp.dc._msdcs.<domain>         DCs
_kerberos._tcp.<domain>               KDCs
_kerberos._udp.<domain>               KDCs (UDP)
_gc._tcp.<domain>                     Global Catalog servers
_kpasswd._tcp.<domain>                password-change service

Query from any host:

nslookup -type=SRV _ldap._tcp.dc._msdcs.inlanefreight.local
dig @172.16.5.5 SRV _kerberos._tcp.inlanefreight.local

Dynamic updates — domain-joined machines register their own A/PTR records via secure DDNS. This is why adidnsdump can enumerate every host in the environment as any authenticated user, and why creating a wildcard DNS record is often trivial (useful for mitm6 + WPAD).

AD DNS enumeration without SMB

adidnsdump -u domain\\user -p pass ldap://dc01 dumps every DNS zone via LDAP. Faster and quieter than reverse-sweeping the subnet.

MSRPC

Microsoft RPC is the transport for most AD administrative operations. RPC traffic rides over either TCP named-pipe on 445 (SMB) or direct TCP on dynamic high ports negotiated through the endpoint mapper on port 135.

Named pipes you will hit:

\\PIPE\lsarpc       LSA — look up SIDs, list trusts
\\PIPE\samr         SAM — enumerate users, groups, password policy
\\PIPE\netlogon     secure channel, pass-through auth
\\PIPE\drsuapi      replication — used by DCSync
\\PIPE\srvsvc       shares and sessions
\\PIPE\wkssvc       workstation, logged-on users

Endpoint mapper (port 135): client asks “where is interface X?” and the EPM returns a dynamic port (49152+ by default on modern Windows). Tools like rpcdump.py enumerate every interface bound on a host.

rpcdump.py @172.16.5.5
rpcclient -U "" -N 172.16.5.5         # null session over SMB named pipe

Null sessions are not dead

Legacy DCs and misconfigured hosts still accept anonymous SMB/RPC. enumdomusers, querydominfo, and lookupnames through a null rpcclient session can hand you the user list and password policy with zero credentials.

SMB and NTLM Challenge-Response

SMB rides on port 445 (direct TCP) or 139 (NetBIOS). When Kerberos is not usable — IP literals, workgroup hosts, legacy apps — SMB falls back to NTLM authentication.

NTLMSSP challenge-response flow:

1. NEGOTIATE     client -> server : "I speak NTLMv1/v2, these ciphers"
2. CHALLENGE     server -> client : 8-byte random nonce
3. AUTHENTICATE  client -> server : HMAC-MD5(NT hash, challenge + client data)
4. server validates with DC via netlogon secure channel (pass-through)

The client never sends the NT hash directly — it proves possession by computing a response over the challenge. Two consequences:

  • NTLMv2 hashes are crackable but not reversible. Captured via Responder → hashcat -m 5600.
  • Pass-the-Hash works because the hash alone is enough to compute the response — no cleartext needed.
  • NTLM Relay works because the response is bound to the challenge, not the destination. If SMB signing is off on the target, you can forward a victim’s authentication to a different host and the target accepts it.

Three mitigations worth checking

SMB signing required (blocks SMB→SMB relay), LDAP signing + channel binding (blocks SMB→LDAP relay), and Extended Protection for Authentication on HTTP endpoints (blocks SMB→ADCS Web Enrollment). Audit with netexec smb <range> --gen-relay-list relay.txt.