- Authentication proves identity — passwords, certificates, tokens, and biometrics are all just different proofs
- Passwords are never stored in plaintext (if the system is sane) — they're stored as hashes
- NTLM and Kerberos are the two Windows authentication protocols — each has distinct attack paths
- Tokens (JWT, session cookies) are bearer credentials — whoever has the token IS authenticated
- MFA raises the bar significantly — understanding how each factor works shows you where it can be bypassed
What Authentication Actually Is
Authentication answers one question: are you who you claim to be?
The three factors:
| Factor | Description | Example |
|---|---|---|
| Something you know | Secret knowledge | Password, PIN, security question |
| Something you have | Physical or digital possession | Hardware token, phone (TOTP), smart card |
| Something you are | Biometric | Fingerprint, face ID |
MFA combines two or more factors. Bypassing MFA means either compromising a factor or attacking the implementation — not the factor itself.
Password Hashing — Why It Matters
Passwords must never be stored in plaintext. Instead, they're put through a one-way hash function. You can't reverse a hash — but you can hash known passwords and compare.
Common Hash Algorithms
| Algorithm | Format | Used where | Crackable? |
|---|---|---|---|
| MD5 | 5f4dcc3b5aa765d61d8327deb882cf99 | Legacy, still common | Very fast — use GPU |
| SHA-1 | 2aae6c35c94fcfb415dbe95f408b9ce91ee846ed | Old web apps | Fast |
| SHA-256 | 64 hex chars | Modern checksums | Fast — but salting helps |
| bcrypt | $2b$12$... | Unix passwords | Very slow — GPU-resistant |
| NTLM | 8846f7eaee8fb117ad06bdd830b7586c | Windows auth | Moderate — no salt |
| NetNTLMv2 | user::domain:challenge:... | Windows network auth | Moderate — must capture challenge |
| sha512crypt | $6$... | Modern Linux /etc/shadow | Slow |
A salt is random data added to the password before hashing. It means two users with the same password get different hashes. It kills precomputed rainbow table attacks. bcrypt, sha512crypt, and Argon2 salt automatically. MD5 and NTLM do not.
Linux Password Storage
Linux stores hashes in /etc/shadow (root-readable only). /etc/passwd contains user info but not hashes (the x means "look in shadow").
$6$rounds=5000$salt$hash$6rounds=5000salthash# If you have root or /etc/shadow access:
cat /etc/shadow | grep -v '!\*' | cut -d: -f1,2 # Show hashed accounts
# Copy hash to hashcat:
hashcat -m 1800 hash.txt /usr/share/wordlists/rockyou.txt # $6$ = mode 1800Windows Authentication — NTLM
NTLM (NT LAN Manager) is Windows' legacy authentication protocol. Still everywhere.
How NTLM works (challenge/response):
Why NTLM is weak:
- The NT hash is derived directly from the password with no salt
- The challenge/response (NetNTLMv2) can be captured over the network and cracked offline
- Pass-the-Hash: you don't need the password — the hash itself authenticates you in many configurations
responder -I eth0 -rdwv-Ieth0-r-d-w-vWindows Authentication — Kerberos
Kerberos is the modern Windows authentication protocol, used in Active Directory environments. It's ticket-based — no password ever traverses the network.
Kerberos Flow (Simplified)
Kerberos Attack Paths
| Attack | What it exploits |
|---|---|
| Kerberoasting | Request service tickets for SPNs, crack offline |
| AS-REP Roasting | Accounts with pre-auth disabled → crack TGT offline |
| Pass-the-Ticket | Steal and use Kerberos tickets from memory |
| Golden Ticket | Forge TGTs using the krbtgt hash — unlimited domain access |
| Silver Ticket | Forge service tickets using service account hash |
| Overpass-the-Hash | Convert NTLM hash into a Kerberos ticket |
Any domain user can request a service ticket for any SPN. The ticket is encrypted with the service account's password hash. If the service account has a weak password, you crack it offline with zero detection risk. This is one of the most common Active Directory attacks.
Web Authentication — Sessions and Tokens
Session Cookies
Traditional web authentication:
- User submits username + password
- Server validates, creates session record, generates session ID
- Session ID sent to browser as cookie
- Every subsequent request includes the cookie
Attacks: Session fixation, cookie theft (XSS), brute force session IDs if they're weak.
Session ID in a cookie:
Set-Cookie: PHPSESSID=a3fWa; HttpOnly; Secure; SameSite=StrictPHPSESSID=a3fWaHttpOnlySecureSameSite=StrictJWT (JSON Web Tokens)
JWTs are self-contained tokens. No server session storage needed — the token carries the claims.
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoiYWRtaW4ifQ.signatureeyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9eyJ1c2VyIjoiYWRtaW4ifQsignatureDecoded payload:
{
"user": "admin",
"role": "user",
"exp": 1714000000
}Common JWT attacks:
- Algorithm confusion — change
alg: HS256toalg: noneto bypass signature verification - Weak secret — brute force the HMAC secret (
hashcat -m 16500) - RS256 → HS256 — flip algorithm, sign with the public key as HMAC secret
# Crack JWT secret
hashcat -a 0 -m 16500 token.txt /usr/share/wordlists/rockyou.txtOAuth 2.0 and SSO
OAuth 2.0 is an authorisation framework, not an authentication protocol — though it's commonly used for both via OIDC (OpenID Connect).
The flow (Authorization Code):
Attack surface:
- Redirect URI manipulation — steal the code by injecting an attacker-controlled redirect
- State parameter bypass — missing CSRF protection in OAuth flow
- Token leakage — access tokens in logs, URLs, Referer headers
- Open redirects — chain with redirect URI validation to exfiltrate codes
MFA — How It Works and Where It Breaks
| MFA Type | How it works | Bypass path |
|---|---|---|
| TOTP (Google Auth) | Time-based 6-digit code (RFC 6238) | Phishing real-time code, SIM swap |
| SMS OTP | One-time code via text | SIM swap, SS7 attacks, phishing |
| Hardware token (FIDO2) | Cryptographic challenge/response | Physical theft, supply chain |
| Push notification | App-based approve/deny | MFA fatigue (spam until user approves) |
| Email OTP | Code to email | Compromise the email account |
Send an MFA push notification repeatedly at 2am. Some percentage of users will tap "Approve" just to stop the notifications. This is a documented real-world attack technique used in major breaches.
Credential Storage — Where Passwords Hide
| Location | What's there | How to access |
|---|---|---|
/etc/shadow | Linux user hashes | Read as root |
| Windows SAM | Local user NTLM hashes | SYSTEM privileges required |
| LSASS process | Logged-in user hashes + Kerberos tickets | Mimikatz, ProcDump as SYSTEM |
| NTDS.dit | All AD user hashes | Domain Admin + VSS or DCSync |
| Browser profiles | Saved passwords (encrypted) | Tools like LaZagne, SharpWeb |
| Environment variables | API keys, passwords in config | env, printenv, /proc/self/environ |
| Config files | Hardcoded credentials | Grep recursively in app directories |
Operational Notes
- NTLM vs NetNTLMv2 — they sound similar but are different. NTLM hash = crackable directly, usable in Pass-the-Hash. NetNTLMv2 = network challenge/response, must be cracked before use, cannot pass-the-hash.
- bcrypt cost factor —
$2b$12$means 2^12 = 4096 iterations. Doubling the cost factor doubles crack time.$2b$10$is more common and faster to crack. - Credential stuffing vs brute force — stuffing uses known breached credentials against new targets. Brute force generates all combinations. Stuffing is orders of magnitude more effective in practice.
What to Read Next
- Password Attacks — put this theory into practice with Hashcat, John, and Responder
- Active Directory Enumeration — Kerberos and NTLM attacks in their natural habitat
- Web Application Analysis — session, cookie, and JWT attacks in web application context