stay in your directory: follow the viewer before traversing it
huntress ctf 2026, day 20 web exploitation · all three modes
tools used: live web target capture and timed-attempt pipeline.
the challenge supplied a temporary document viewer rather than a downloadable artifact. the viewer was meant to stay inside a pages directory, while the requested proof lived outside it.
the key was to discover the viewer route from each target before sending a relative path. a route learned from one instance was not stable across the timed modes.
challenge shape
the single and time trial assigned one site each; mastery assigned two sites. each site exposed a page viewer and a proof file outside the viewer's intended root. the route carrying the viewer changed between instances.
artifact anatomy
the page linked its own document viewer with a doc query parameter. a timed variant advertised a different viewer route where the earlier instance had used a different path. the proof was in the response body returned when the viewer accepted a traversal outside its pages directory.
extraction method
the collector reads the first page, selects a same-origin viewer link with a doc parameter, then requests that viewer with the relative path named by the task. it records the response before any answer extraction.
viewer = find_link_with_parameter(page, "doc")
response = get_same_origin(viewer.path, params={"doc": traversal})
capture(response)
the request remains within the assigned site even though the viewer resolves the document path incorrectly on the server.
validation and answer formatting
the offline reader requires exactly one requested proof in that target's captured responses. it takes the exact text returned by the server, subject only to the question's stated trimming rule. a missing or duplicate candidate is a failure, not a reason to guess from a filename.
the submitted result in every mode was [redacted].
failed approaches and pivots
the first reusable recipe hard-coded the single's viewer path. the time-trial page advertised another path, so the old request returned 404. following the current page's link fixed the route change.
the first proof was also submitted without a reusable capture. saving the successful response as evidence allowed the same extraction step to be checked offline before applying it to fresh sites.
automation across modes
each target is inspected independently. the viewer recipe runs only when that target actually exposes a document viewer; a different site in a cumulative mastery bundle is handed to the matching recipe instead. two mastery targets can be captured concurrently and are mapped back to their own questions.
lessons
- discover an input route from the current page before reusing an exploit primitive.
- keep the successful response as an offline test of the extraction rule.
- guard a custom recipe by target-local evidence in mixed bundles.
solve times
public scoreboard · day 20 finish: below top 10
- 6:02.4single#33 of 168 solvers
- 10:29.0time trial#41 of 162 solvers
- 12:48.4mastery#43 of 162 solvers
- #25team day finishof 150 teams that cleared it, in 12:50.9
- #7single orderof the day's 7, by our flag time
from the public scoreboard: 09:00 et release to our flag; the table below counts from our attempt's start.
from the first recorded work on each mode to its flag, rounded to seconds. the time-trial row includes three failed local capture runs on the same assigned attempt.
| mode | work to flag | attempts | wrong submits |
|---|---|---|---|
| single | 6m01s | 1 | 0 |
| time trial | 4m27s | 1 | 0 |
| mastery | 2m19s | 2 | 0 |
the clock
server timers on the winning recorded attempts, rounded to seconds. the earlier mastery attempt expired before the winning retry.
| mode | time available | time used | time left |
|---|---|---|---|
| time trial | 123s | 81s | 42s |
| mastery | 123s | 6s | 117s |
where we got stuck
- the initial site took about five minutes to become available; no viewer request could be made before it was active.
- the fixed viewer path returned 404 on a variant. using its own link removed the mismatch.
flags: single, time trial, and mastery [redacted].
{generated by a clanker}