CSCTF 2026Web / Forensics
OPERATION DAWN: THE ACCESS LOG
The log records a time-based blind SQL injection against the /api/status?unit= endpoint.
- Competition
CSCTF 2026- Category
- Web / ForensicsEasy (120 pts, 218 solves)
- Source status
- Source-documented · not platform-verified
- Document
- PDF edition2 min read
TL;DR
The log records a time-based blind SQL injection against the /api/status?unit= endpoint. The attacker guessed the secret token one character at a time with ... AND IF(SUBSTR(token,POS,1)='X', SLEEP(2), 0) -- -. Every request returned 200 ("never drew an error page"), so the only oracle is nginx's rt= (request time): a correct guess sleeps ~2s, a wrong guess is ~0s. Picking, for each position, the character whose request actually slept rebuilds the flag directly.
01
Recon
2,927 lines of nginx combined log with a trailing rt= field. Almost all traffic is normal /api/status?unit=NN polling. Filtering the query strings down to anything that isn't a plain unit=\d+ immediately exposes the attack:
unit=43'+AND+IF(SUBSTR(token,6,1)='Z',SLEEP(2),0)--+-unit=43'+AND+IF(SUBSTR(token,33,1)='N',SLEEP(2),0)--+-unit=43'+AND+IF(SUBSTR(token,29,1)='%7B',SLEEP(2),0)--+- (%7B = '{')...All 2,665 injection requests come from a single host, 198.51.100.66, and all return 200.
02
The oracle
This is classic boolean/time-based blind SQLi, but there's no boolean tell (every response is 200, same size). The side channel is the rt= value:
wrong character →
IF(...)false →SLEEPnot called →rt≈0.00xcorrect character →
SLEEP(2)runs →rt≈2.0+
So for each POS, the guessed character on the request with rt ≥ 2 is the real one.
03
Reconstruction
solve.py parses each line, URL-decodes the query (note %7B/%7D → {/}, + → space), pulls out (POS, char, rt) from the SUBSTR(token,POS,1)='char' ... SLEEP(n) pattern, and keeps the char that slept per position:
positions: 1 .. 41RECOVERED: CSCTF{07_beacon_tow_vigil_bollard_8c0371}all SLEEP guesses by IP: {'198.51.100.66': 2665}successful (slept) by IP: {'198.51.100.66': 41}Exactly one sleeping guess per position (1–41), no gaps, no ambiguity. The token already includes its own CSCTF{...} braces, so it is submitted as-is.
04
Flag
Flag
CSCTF{07_beacon_tow_vigil_bollard_8c0371}
Source-documented · not platform-verified
