HackTheBox Writeup - Challenges - Diogenes' Rage
🕒 2025/04/29
- Category:
Web - Difficulty:
Easy - IP:
83.136.252.199:57508
1. Website
What you can do:
- Insert a coupon ($1) and you can buy items.
POST /api/coupons/apply

- Enter the code of the item you want to buy, and you can purchase it (if you have enough money).
POST /api/purchase

2. Source Code
routes/index.js
3. Burp Suite
4. TOCTOU Race Condition
Time-Of-Check-To-Time-Of-Use (TOCTOU) Race Condition allows an attacker to redeem the same coupon multiple times by racing two or more parallel requests.
Attack Path:
-
Capture an arbitrary user’s session cookie.
-
By sending parallel
POST /api/coupons/applyrequests with the user’s cookie, we can exploit the TOCTOU race condition to obtain multiple coupons. -
Now that we have enough money, we can purchase item
C8, which contains the flag we want.








