2FA/MFA Bypass Techniques¶
TL;DR¶
2FA can be bypassed through direct endpoint access, response manipulation, brute force, and implementation flaws.
# Quick wins
Skip 2FA page → Access /dashboard directly
Modify response: {"success":false} → {"success":true}
Try blank/null OTP codes
Brute force 4-6 digit codes
Exploitation¶
1. Direct Endpoint Access¶
Skip 2FA verification entirely:
# Instead of going through /2fa-verify
# Directly access protected pages
GET /dashboard
GET /api/user/profile
GET /account/settings
Referrer manipulation:
2. Response Manipulation¶
Modify server response:
Status code change:
Remove blocking fields:
3. Brute Force Attacks¶
No rate limit:
# 4-digit (10,000 combinations)
for i in $(seq -w 0 9999); do
curl -X POST https://target.com/verify-otp -d "code=$i"
done
# 6-digit with ffuf
ffuf -u https://target.com/verify -X POST \
-d '{"code":"FUZZ"}' -w <(seq -w 0 999999) \
-mc 200 -fr "invalid"
4. Rate Limit Bypass¶
Code resend resets counter:
IP rotation:
Session rotation:
for attempt in range(9999):
if attempt % 10 == 0:
session = get_new_session()
try_code(session, code)
5. Token Reuse¶
Previously used tokens:
Cross-account token:
6. Backup Code Issues¶
Predictable codes:
Disclosure via API:
7. Password Reset Bypass¶
8. OAuth/SSO Bypass¶
9. Race Conditions¶
Parallel OTP submission:
Enable 2FA + Login race:
10. "Remember Me" Exploitation¶
Predictable token:
11. Blank/Null Code Acceptance¶
Bypasses¶
Multi-value submission¶
Encoding tricks¶
Alternative parameters¶
Real Examples¶
Response manipulation (401→200):
NextCloud session mixing:
session1 = login(creds) # Gets 2FA block + token A
session2 = login(creds) # Gets 2FA block + token B
# Mix tokens → session1 bypasses 2FA
Checklist¶
- Try accessing post-auth pages directly
- Manipulate 2FA verification response
- Test blank/null OTP codes
- Check rate limiting (IP rotation, session reset)
- Test code resend behavior
- Try previously used codes
- Test backup code predictability
- Check if password reset disables 2FA
- Test OAuth/SSO login paths
- Look for race conditions
- Test "remember me" token security
- Try multi-value code submission
Tools¶
- Caido — Intercept and modify responses
- Turbo Intruder — High-speed brute force with race conditions
- ffuf — Fast OTP brute forcing