root@sparrow:~/writeups$ cat session-forensics.md
// Offensive
Session Forensics
27 Sep 2023
· 4 min read
· root access
Executive summary — Session Forensics is an application forensics investigation on TryHackMe: on TryFlufMe's internal portal a normal user started performing admin actions. By correlating web server, application, Identity Provider and browser dump logs, we reconstruct how the userFluffyCatwent from roleusertoadminby forging a JWT with thenonealgorithm and planting it inlocalStorage. A JWT forgery → session hijacking → privilege escalation path seen from the defensive side.
| Platform | TryHackMe |
| Operating system | N/A (log analysis) |
| Difficulty | Medium |
| Room | Session Forensics |
| Target IP | N/A (no live target — pure log/artifact analysis) |
Attack map
[USER] FluffyCat — legitimate HS256 JWT, role: user
│ forges a new JWT with alg: none and role: admin
▼
[BROWSER] malicious JWT stored in localStorage (browser_dump.txt)
│ the app trusts the token without verifying the signature
▼
[APP] access to the admin portal — role mismatch (app.log)
│ the IdP never issued an admin token (idp.log)
▼
[ESCALATION] user → admin with no valid credentials1. Fundamentals: sessions and JWT
Before touching the crime scene, it pays to nail down the concepts. A session is like a hotel room key: the server holds the room number (the state) and you only carry the card (the session ID). A JWT, by contrast, is like a boarding pass: it carries all the information inside it (user, role, expiry) and needs no central database. That convenience comes at a price: if the token is forged or tampered with, access is instant.
Why it matters: because a JWT is self-contained, security rests entirely on signature verification. If the server doesn't validate the signature properly, anyone can write their own token.
Q: What security mechanism must you implement when introducing JWT?
A: revocation
Q: What is the attack called when an attacker steals your session ID?
A: session hijacking
🔒 Clearance required
Root Access unlocks the content you can't see — everything else on the site is already open.
See Root Access plansNo account? Create one free then upgrade from your console.