When you type your password at a Windows login screen, a complex dance of cryptographic protocols begins. Understanding this dance - how Windows authenticates users - is key to attacking it. Active Directory uses two main protocols: NTLM and Kerberos.
Think of authentication like getting into an exclusive club. NTLM is like showing your ID at the door each time. Kerberos is like getting a VIP wristband that proves who you are all night.
Why Both Protocols?
NTLM Authentication
NT LAN Manager (NTLM) is the older Windows authentication protocol. It uses a challenge-response mechanism.
NTLM Hash
Windows stores passwords as NTLM hashes (MD4 of UTF-16LE password). No salt, so same password = same hash everywhere.
NTLM Authentication Flow
NTLM Weaknesses
NTLMv1 vs NTLMv2
- NTLMv1: Older, very weak, easily cracked offline
- NTLMv2: Stronger, includes client challenge, but still crackable
Kerberos Authentication
Kerberos is the preferred authentication protocol in AD. It uses tickets instead of passwords, providing single sign-on across the domain.
Key Components
- KDC (Key Distribution Center): Runs on DC, issues tickets
- TGT (Ticket Granting Ticket): Proves identity, gets service tickets
- TGS (Ticket Granting Service): Issues service tickets
- Service Ticket: Grants access to specific service
- KRBTGT: Account whose hash encrypts all TGTs
Kerberos Authentication Flow
Why This Matters for Attacks
Service Principal Names (SPNs)
SPNs identify service instances. They're how Kerberos knows which service account's hash to use for encrypting tickets.
Password Storage
Local: SAM Database
Domain: NTDS.dit
Memory: LSASS
Authentication Attacks Overview
| Attack | Target | Requirement |
|---|---|---|
| Pass-the-Hash | NTLM | NTLM hash |
| NTLM Relay | NTLM | MITM position |
| Kerberoasting | Kerberos | Any domain user |
| AS-REP Roasting | Kerberos | List of users |
| Golden Ticket | Kerberos | KRBTGT hash |
| Pass-the-Ticket | Kerberos | Kerberos ticket |
Knowledge Check
Challenges
Key Takeaways
- NTLM uses challenge-response; hash = password equivalent
- Kerberos uses tickets for single sign-on
- TGT proves identity; service tickets grant access to services
- KRBTGT hash is the master key for all Kerberos tickets
- SPNs make accounts vulnerable to Kerberoasting
- Credentials stored in SAM (local), NTDS.dit (domain), LSASS (memory)