root@thehacksparrow:~/writeups$ SYSTEM ONLINE
root@sparrow:~/writeups$ cat session-forensics.md
// Offensive

Session Forensics

27 Sep 2023 · 8 min read · root access
Executive summarySession 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 user FluffyCat went from role user to admin by forging a JWT with the none algorithm and planting it in localStorage. A JWT forgery → session hijacking → privilege escalation path seen from the defensive side.
PlatformTryHackMe
Operating systemN/A (log analysis)
DifficultyMedium
RoomSession Forensics
Target IPN/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 credentials

1. 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

This content is Root Access only. Everything else on the site — the free tier, the whole public library — stays open.

See Root Access plans

No account? Create one free then upgrade from your console.