CSCTF 2026Web
Operation Dawn: The Standing Order
The app hands every visitor a signed session cookie of the form hex("user=guest&role=operator").<sha1 signature>.
- Competition
CSCTF 2026- Category
- WebMedium (350 pts)
- Source status
- Source-documented · not platform-verified
- Document
- PDF edition2 min read
Brief
The challenge
- Category
- Web
- Difficulty
- Medium (350 pts)
- Target
http://w01.ctf.chronos-security.ro:40595
TL;DR
The app hands every visitor a signed session cookie of the form hex("user=guest&role=operator").<sha1 signature>. The signature is SHA1(secret || payload), so a hash length-extension attack lets us append &role=admin without knowing the secret. As admin we reach /relay, which exposes an SSRF probe (/relay/probe?target=) to an internal provisioning service at http://127.0.0.1:9091/order. The SSRF blocklist filters 127.0.0.1/localhost/0.0.0.0/::1, but the loopback shorthand 127.1 sails straight through and returns the standing order (the flag).
Solve steps
Recon. The landing page (
/) sets a cookie:Text session=757365723d677565737426726f6c653d6f70657261746f72.2e9c4939a9163025a5afd4d062352ab3c609a25eThe hex half decodes to
user=guest&role=operator; the 40-hex tail is a SHA1 signature. The page notes/relayneedsrole=admin.Identify the signature scheme.
SHA1("user=guest&role=operator")does not match the tail, so the signature is keyed — consistent withSHA1(secret || payload), which is vulnerable to length extension.Length-extension forge. Using a pure-Python SHA1 that resumes from the known digest state (
lenext.py), append&role=adminfor each candidate secret length. Key length 16 works: the forged cookie makes/relayreturn200(attack.py). Since query-string parsing takes the lastrole, the SHA1 glue-padding bytes in the middle are harmless androle=adminwins.Find the SSRF.
/relay(as admin) shows a node map, an internal provisioning servicehttp://127.0.0.1:9091/order, and a probe form:GET /relay/probe?target=<node-url>.Bypass the SSRF filter. Probing
http://127.0.0.1:9091/orderis refused, as arelocalhost,0.0.0.0, and[::1]. The blocklist only matches those exact spellings, sohttp://127.1:9091/order(also the decimal formhttp://2130706433:9091/order) reaches loopback and returns the flag.
GET /relay/probe?target=http://127.1:9091/order-> CSCTF{yU3bYgITssWPuww10XBsNyD0}Flag
Flag
CSCTF{yU3bYgITssWPuww10XBsNyD0}
Source-documented · not platform-verified