Tactical LogHuntress CTF 2026 // team archive

Days / Day 20 / Web Exploitation / Stay in Your Directory

DAY 20//LANE: WEB EXPLOITATION//STATUS: CORRECT x3

Stay in Your Directory

Web Exploitation SSTTMM Modes reported CORRECT in this write-up
  • Day: 20 (replay challenge: id is web-exploitation-day-04-lfi, released on Day 20)
  • Lane: web-exploitation
  • Machine: workstation
  • Date: 2026-10-20

Modes

ModeResultHOFAccepted answer
Single SolveCORRECTn/a (untimed)proof-1 = Proofproof_f2ca1afd6f5e4361a9c97ceed5537f8d
Time TrialCORRECTeligibleproof-1 = Proofproof_5384ed2c684f4b24850ff0bab287ecfb
MasteryCORRECTeligibleproof-1 = Proofproof_2bd942dfd57649ea8ab26f40ca8f2a23, proof-2 accepted via first batch

GM-stated prompt

The viewer should stay inside its pages directory. An operations note says the attempt proof is mounted at /run/huntress/objective.txt. Can you make the viewer cross that boundary?

Technique - Single Solve + Time Trial (LFI)

Both the Single Solve and Time Trial targets are a PHP app ("Runbook Nook" / "Stay in Your Directory") where a document viewer includes files relative to its own pages directory:

  • Viewer URL (randomized per variant): /<viewer>.php?doc=<name>
    • Single: /reader.php?doc=about.php
    • Time Trial: /notes.php?doc=start.php
  • Server error path reveals: include('/var/www/html/pages/<doc>'): ...
  • The viewer renders the included content inside <article><span class="pill">Document viewer</span>...</article>.

Payload: ../../../../run/huntress/objective.txt on the doc parameter.

The included file contains a bare proof_[0-9a-f]{32} string; extract it from the article body.

Technique - Mastery Target 1 (Node + exposed backup)

Mastery had two different applications, one per target. Target 1 was NOT LFI - it was a Node.js "Green Light" status page.

  • /robots.txt disclosed a disallowed directory: /snapshots-5860b/
  • Directory listing was open: /snapshots-5860b/
    • release-settings-aedbc6.json.bak contained the proof in the support_note field.
    • release-notes.txt was a decoy.
{
  "environment": "production",
  "support_note": "proof_2bd942dfd57649ea8ab26f40ca8f2a23"
}

Lesson: Mastery can bundle different vulnerability classes under one timer; a single LFI handler is not enough. For next time, add a quick-wins probe (robots.txt, .git/, common backup extensions) in parallel with LFI, keyed off the response fingerprint of each target.

Code changes landed (merged into production)

  1. challenges/_lib/timed_slot.py - prior_mode_correct() now scans every day's done ledger as a fallback. A replay challenge (released on Day 20 but keeping its original day-04 id) was invisible to the gate because the regex-extracted day pointed at Day 4 while the Single was recorded on Day 20. The fix is read-only, backward-compatible, and only used when the named-day lookup misses.
  2. challenges/_lib/autosolve_web.py - added _lfi_discover_viewer(), _lfi_fetch_proof(), and _lfi_handler(). compute() now also attempts an LFI traversal when the prompt names an absolute file path (/.../*.txt, .conf, .cfg, .ini, .flag), the answer_ids match proof-\d+, and the start response carries targets[].url. The viewer path and query parameter are auto-discovered from the root page.

How the modes were actually submitted

  • The Single was solved by a Commander-driven direct GM.submit from the live Single target.
  • board.reconcile(20, gm) healed the done ledger from GM truth, which caused prior_mode_correct() to return True (after the replay-day fix) and the readiness gate to open with prior mode already CORRECT live on this challenge.
  • Time Trial start was then driven by autosolve.py, which spent one ranked variant; its format_gate partially blocked (LFI handler initially hardcoded /reader.php), but the attempt remained live. The proof was then fetched directly from the already-started attempt's target URL and submitted (submit is not a timed-write op). CORRECT with HOF eligibility.
  • Mastery was driven by autosolve.py with the updated handler. proof-2 fetched + accepted via the ranked attempt; proof-1 required a different technique (robots.txt → backup), fetched manually, submitted. CORRECT with HOF eligibility.

Follow-ups

  • Rework _lfi_handler into a multi-vuln dispatcher that fingerprints the target first (PHP vs Node, Apache error style, robots content) and runs the matching recipe.
  • Teach prebrief.gate that live-target web lanes have no offline stand-in; its RESIDUE on a web proof-\d+ should default to NEEDS-REAL-BYTES rather than RESIDUE so the gate opens on the Single's live CORRECT without needing prior_mode_correct fallback.

User authorisations recorded for this session

  • User chose option "2" (double-run accepting the risk) with Homestation holding the open attempt.
  • User chose option "2" (explicit one-time gate override). The classifier blocked the direct override command; the resolution was the sanctioned board.reconcile + the prior_mode_correct replay-day fix, which opens the gate on live GM truth with no override.