Vol. 01 · Story 15 · Domain 2

GARY GETS PEN TESTED.

Application & Network Attacks

Nina's pen test · Gary's Coffee Shop · 5 min read

Gary's insurance company sends Nina — a penetration tester — to find every weakness. She spends one day attacking his systems. She finds everything. This is what she did, hour by hour.

Reading Progress
00 / 22
Story 15 · Domain 2 · Application & Network Attacks

Gary Gets Pen Tested.

Nina arrives at 8am with a bag of tools and spends the day attacking Gary's systems. She finds fourteen vulnerabilities. Gary needs a coffee. A strong one.

8:00am. Nina starts with the till. Customers type their loyalty card number into a box that fits ten digits. Nina types five hundred. The extra characters spill over the box's boundary and pour into the till's brain — overwriting the instructions that control it. The till now does whatever Nina tells it.

That's a buffer overflow — cramming more data into a variable than it can hold, hijacking what's next to it in memory.

8:30am. Nina builds a fake page with an invisible button. When a logged-in customer visits her page, their browser secretly clicks "Transfer all loyalty points to Nina" on Gary's real site.

That's CSRF — Cross-Site Request Forgery — the user's browser makes a request the user didn't intend. Then Nina finds Gary's site can load images from any URL. She tells it to load http://localhost/admin — making Gary's server request its own internal admin panel. That's SSRF — Server-Side Request Forgery. CSRF hijacks the customer's browser. SSRF hijacks Gary's server.

9:00am. Nina pays for a coffee. She keeps the receipt. An hour later, she presents the exact same receipt again. "I already paid — see?" The till accepts it.

That's a replay attack — capturing a legitimate transaction and presenting it again.

9:30am. Nina sets up a fake counter between Gary and a customer. The customer thinks they're talking to Gary. Gary thinks he's talking to the customer. Nina sits in the middle, reading every word and changing the order before passing it along.

That's an on-path attack (MITM).

10:00am. Nina plugs into Gary's network switch and floods it with thousands of fake MAC addresses. The switch's memory overflows. In a panic, it starts broadcasting everything to every port — like a dumb hub. Now Nina can see all traffic.

That's MAC flooding. She follows up by sending fake ARP messages: "I'm the router." Every device sends traffic to Nina instead. That's ARP poisoning — lying about identity at Layer 2.

10:30am. Gary's network has staff wifi and customer wifi — divided by VLANs. Nina's on the customer side. She crafts a specially tagged packet that tricks the switch into forwarding it to the staff VLAN.

That's VLAN hopping.

11:00am. Nina grabs a copy of Gary's password hash from the till's memory. She doesn't crack it — she presents the hash directly to the login system. The system checks hashes, not plaintext, so it lets her straight in.

That's pass-the-hash — skipping the password entirely.

11:30am. Nina logs in as a basic customer and finds a debug page not meant for customers. She's gone from customer to admin without admin credentials.

That's privilege escalation. Vertical = customer → admin (going up). Horizontal = customer A → customer B (going sideways).

12:00pm. The website shows menus at /menus/today.pdf. Nina changes the URL to /menus/../../../etc/passwd. The ../ climbs out of the menus folder, out of the web directory, and into the OS.

That's directory traversal / path traversal.

12:30pm. The 1,000th customer wins a prize. Nina opens two tabs and hits "redeem" at the exact same millisecond. Both arrive before either finishes processing. Both get the prize.

That's a race condition — simultaneous requests exploiting a timing gap.

1:00pm. Nina knows Gary uses SHA-1. She finds two different orders that produce the exact same hash. She swaps one for the other and the system can't tell.

That's a birthday attack / collision attack — named after the birthday probability paradox.

1:30pm. Nina types into the search box: "; cat /etc/passwd". The field passes it straight to the OS. She tries the login form: "*(uid=*)". The login query goes straight to the LDAP directory.

That's command injection and LDAP injection — untrusted input reaches an interpreter without sanitisation. Same principle as SQL injection.

CSRF hijacks the customer's browser. SSRF hijacks Gary's server. Easy to confuse. Easy to lose a mark. Remember which direction the forgery flows. — Story 15 · Application & Network Attacks
// THE LOCK-IN

CSRF hijacks what the user's browser does. SSRF hijacks what the server does on your behalf. Both are forgery attacks. Both exploit trust. The difference is in which party is being weaponised against the target — the user or the server.

Check Yourself · Question 15

Nina makes Gary's web server fetch http://localhost/admin on her behalf. The server returns the admin panel contents. What attack is this?

Terminology · Story 15

Nina's Report.

// Term · 01 / 05
CSRF vs SSRF
Tap to reveal
// Definition
CSRF — Cross-Site Request Forgery: hijacks the user's browser to make unintended requests. SSRF — Server-Side Request Forgery: makes the server request internal/external resources on attacker's behalf.
Domain 02
// Term · 02 / 05
Pass-the-Hash
Tap to reveal
// Definition
Using a captured password hash directly to authenticate, skipping the need to crack it. The system checks hashes, not plaintext — so the hash IS the password.
Domain 02
// Term · 03 / 05
Privilege Escalation
Tap to reveal
// Definition
Vertical — gaining higher privileges (user → admin). Horizontal — gaining access to another user's data at the same level. Both are escalations.
Domain 02
// Term · 04 / 05
ARP Poisoning
Tap to reveal
// Definition
Sending false ARP replies to associate the attacker's MAC address with a legitimate IP. Traffic meant for the router goes to Nina instead. Layer 2 attack.
Domain 02
// Term · 05 / 05
Birthday Attack
Tap to reveal
// Definition
Finding two different inputs that produce the same hash output (collision). Named after the birthday paradox — collisions are more likely than intuition suggests. Exploits weak hash algorithms.
Domain 02