Skip to content
Adam Omar Saleh

Chronos Security logo, as used by CSCTF 2026CSCTF 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
Chronos Security logo, as used by CSCTF 2026CSCTF 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

  1. Recon. The landing page (/) sets a cookie:

    Text
    session=757365723d677565737426726f6c653d6f70657261746f72.2e9c4939a9163025a5afd4d062352ab3c609a25e

    The hex half decodes to user=guest&role=operator; the 40-hex tail is a SHA1 signature. The page notes /relay needs role=admin.

  2. Identify the signature scheme. SHA1("user=guest&role=operator") does not match the tail, so the signature is keyed — consistent with SHA1(secret || payload), which is vulnerable to length extension.

  3. Length-extension forge. Using a pure-Python SHA1 that resumes from the known digest state (lenext.py), append &role=admin for each candidate secret length. Key length 16 works: the forged cookie makes /relay return 200 (attack.py). Since query-string parsing takes the last role, the SHA1 glue-padding bytes in the middle are harmless and role=admin wins.

  4. Find the SSRF. /relay (as admin) shows a node map, an internal provisioning service http://127.0.0.1:9091/order, and a probe form: GET /relay/probe?target=<node-url>.

  5. Bypass the SSRF filter. Probing http://127.0.0.1:9091/order is refused, as are localhost, 0.0.0.0, and [::1]. The blocklist only matches those exact spellings, so http://127.1:9091/order (also the decimal form http://2130706433:9091/order) reaches loopback and returns the flag.

Text
GET /relay/probe?target=http://127.1:9091/order-> CSCTF{yU3bYgITssWPuww10XBsNyD0}

Flag

Flag

CSCTF{yU3bYgITssWPuww10XBsNyD0}

Source-documented · not platform-verified

PDF edition

Writeup PDF

Formatted edition of this walkthrough, built from my source notes · 2 pages.