Tactical LogHuntress CTF 2026 // team archive

Days / Day 29 / Web Exploitation / Trust the Build

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

Trust the Build

Web Exploitation SSTTMM Modes reported CORRECT in this write-up

Challenge ID: web-exploitation-day-26-trust-the-build Modes: Single Solve, Time Trial, Mastery Primary weakness: the package activation endpoint trusts a valid signature over the feed manifest without ensuring the activated artifact matches the manifest's artifact hash.

Single Solve

Started through the Game Master with challenge ID web-exploitation-day-26-trust-the-build. The SS attempt ID was [id]. This is a web challenge, so the start response had no downloadable artifact; it assigned a live target URL. The target's page linked to /api/clues, which was the right first request: it disclosed the feature route, feed route, policy route, framework, and current role. I used those disclosed routes rather than guessing endpoints.

The assigned target was:

https://[per-team CTF host]/

The feed supplied one signed package manifest:

{
  "package": "local-telemetry-adapter",
  "version": "1.0.13078",
  "artifact": {
    "build": "release-13078",
    "hook": "passive_health"
  },
  "artifact_sha256": "c25168d2500344529cbb7002a77d57d1dd8fd074661872ba3a6a26eb58ee9766",
  "signature": "62aa5d91a77447a7f0f42d496f3d3b795ce36b39b0daa785a75de499b1a3f321"
}

The policy said the signed manifest names the artifact SHA-256 and activation must verify the artifact bytes against it. The important distinction was between authenticating the manifest and checking that the installed artifact matches the signed hash. I copied the real feed entry, changed only artifact.hook from passive_health to privileged_export, and kept the original hash and signature. Posting that modified manifest to /inspect-4e00a5 returned:

{
  "effect": "unverified_update_activated",
  "evidence": "proof_26656c58d17147d4b9bd8e8b6bba39bf",
  "ok": true,
  "package": "local-telemetry-adapter"
}

Submitted Proofproof_26656c58d17147d4b9bd8e8b6bba39bf as proof-1. The Game Master returned CORRECT at 2026-10-29T13:09:02.708Z and returned the completion flag Token9889040c8ca45765cd99fac22a7d179d.

Time Trial

Started the timed Time Trial using the Game Master challenge ID web-exploitation-day-26-trust-the-build/time_trial and run_for_time: true at 2026-10-29T13:09:13.378Z. The TT attempt ID was [id]. The server returned a live target and deadline 2026-10-29T13:11:17.832Z (124.454 seconds after start). That deadline was authoritative; opening the page did not pause it.

The assigned target was https://[per-team CTF host]/.

The target exposed the same clue, update feed, and policy pattern with a new package version and signature. I fetched the target's own feed entry and policy, changed only the hook to privileged_export, and posted the feed entry unchanged otherwise. The activation response returned:

  • Proofproof_085b45838e504221bb1afcf71887e240

Submitted it as proof-1. The Game Master returned CORRECT at 2026-10-29T13:09:32.105Z, 18.727 seconds after start, and returned the completion flag Token51c0d07fa1415f12f588a3e2ef64c2f2.

Mastery

Started Mastery with challenge ID web-exploitation-day-26-trust-the-build/mastery. Its player-facing response assigned five distinct web targets and five exact answer IDs: proof-1 through proof-5. Each question asked for the exact proof from its corresponding target. There are no artifact downloads for this web bundle; the target URLs are in the Game Master response.

The Game Master prompt was:

The updater trusts its packages like old friends. Slip a tampered dependency into the build and watch it install your version of the truth.

For SS and TT, the player-facing question was “Recover the proof from Target 1,” submitted under proof-1. For Mastery, the five questions were “Recover the proof from Target 1” through “Recover the proof from Target 5.” Every answer format was exact_text, with the instruction “Submit the exact proof recovered from this target.” The Mastery answer IDs were exactly proof-1 through proof-5; each target mapped to the matching numbered ID.

The first Mastery attempt was timed ([id]) and expired at its server deadline, 2026-10-29T13:11:44.187Z, before completion. The next regular attempt was a distinct variant, so its target URLs and proofs differed; answers from the expired attempt did not carry over. This is why the active attempt's accepted_ids must be checked before assuming earlier work still counts.

The untimed retry attempt is [id], started at 2026-10-29T13:12:09.988Z. The current assigned targets are:

AnswerTarget familyProofStatus
proof-1[Target 1](https://[per-team CTF host]/) — public status archive exposed by robots.txtProofproof_b7ef407e26d14cd883d4de15e4aa8451Accepted
proof-2[Target 2](https://[per-team CTF host]/) — cross-workspace incident reference in the activity feedProofproof_a9f3488189c94e5e800b0bdecc1ab9aaAccepted
proof-3[Target 3](https://[per-team CTF host]/) — search query injection; closing the filter and commenting out its suffix revealed a fourth recordProofproof_9cc71da092de45b3bf2e734a80bc695fAccepted
proof-4[Target 4](https://[per-team CTF host]/) — PHP document reader with path traversalProofproof_6a49d006b5694a80a9493d5c88706a08Accepted
proof-5[Target 5](https://[per-team CTF host]/) — signed package hook substitutionProofproof_7eca0a9a9d66453d83c8178cf3bbe234Accepted

For Target 1, /robots.txt disclosed /releases-03fd9/. Its directory index linked release-settings-1e9db1.json.bak; that JSON backup's support_note held the proof.

For Target 2, the home page established the assigned session cookie. /api/activity contained a reference_only event with an executive-owned case ID, 13323. Fetching /api/incidents/13323 exposed the restricted record and its proof.

For Target 3, a plain search and % wildcard showed only the three public notes. The search was built inside a parenthesized SQL filter. This payload closed that filter, added a true condition, and commented out the rest:

') OR 1=1 -- 

The result included record 12279, a fourth, hidden “Incident commander note,” and its proof.

For Target 5, I used the same procedure as Single Solve. /api/clues disclosed /inspect-bd98b4, /api/updates, and /api/update-policy. The feed's local-telemetry-adapter manifest was version 1.0.11231, build release-11231, artifact SHA-256 58f5e41cc1780538ac6da02e6de1ea31eb70b7353401dbf560408a69bfcd62fe, and signature 60377c7b986c0cb49109289c9455271231f83773f8f52292eac3059b439956ec. I changed only artifact.hook to privileged_export; the activation response's evidence value was the answer.

Target 4 — PHP local file inclusion

The assigned target was https://[per-team CTF host]/. The public page title was Stay in Your Directory. Its normal document links were handbook.php?doc=start.php, collect.php, and report.php. /healthz identified the php_lfi profile. A request for doc=../../../../etc/passwd returned the target's account file; the PHP warning identified the vulnerable include at /var/www/html/index.php, line 51.

The viewer prepends its local /var/www/html/pages/ directory before calling include(). That explained why the php://filter wrapper did not work: the wrapper name was no longer at the start of the include path. The successful read was:

GET /handbook.php?doc=../../../run/huntress/objective.txt

From /var/www/html/pages/, three .. components reach /var; /var/run is a symlink to /run on this Debian-based target. The included file returned the exact proof:

  • Proofproof_6a49d006b5694a80a9493d5c88706a08

Before finding it, I checked /proc/self/environ and /proc/1/environ, the hostname, and common proof/flag names under the web root, /tmp, /run/secrets, /opt, /srv, /root, and /home. These did not expose the proof. The VM's hostname-derived proof guess was rejected by the Game Master, so incidental host identifiers should not be converted into answer guesses. The VM did not have ffuf, feroxbuster, gobuster, or dirsearch; its installed generic Python web solver provided the useful path clue: [local path] lists /run/huntress/objective.txt among its universal LFI fallback paths and tries traversal depths 1–7. Using the discovered handbook.php?doc= viewer with that path returned the proof immediately. Looking at the local solver library early would have avoided broad filename guessing.

I submitted the exact value under proof-4. The Game Master returned CORRECT at 2026-10-29T14:11:32.640Z, and the final status confirmed all five answer IDs. The Mastery completion flag returned by the Game Master was Token9969698411424cbdaa269a7a8c8c9b2b.

Raw evidence for all five Mastery targets is in evidence/ as mastery-target-1.json through mastery-target-5.json. The final Game Master status and submission summary are saved as evidence/mastery-status-final.json, evidence/mastery-submit-final.json, and gm-status-mm.json.

What the Game Master told us

  • A start response gives the exact player-facing questions, answer formats, answer IDs, attempt ID, mode, timer state, and (for web exploitation) the assigned live targets.
  • run_for_time: true requests a timed Hall of Fame attempt for Time Trial or Mastery. Use the returned deadline, not a locally estimated duration.
  • Starting again reconnects to the same attempt. It does not create a new timer or target. Retry is a separate operation and advances to another variant only after the current attempt ends.
  • Mastery answers are per-answer fields. The first timed Mastery attempt expired before all five were solved, and the fresh regular retry did not inherit its accepted answers. Check accepted_ids after every partial submission.
  • The Game Master returned CORRECT for SS, TT, and MM. The final MM status independently lists all five answer IDs as accepted; its submit response included the completion flag.
  • The proxy is http://[ip]/huntress-ctf-proxy with no trailing slash. CourseStack supplies player identity through this proxy. The Time Trial challenge ID uses /time_trial (underscore); Mastery uses /mastery.
ModeGame Master challenge IDTimer used here
SSweb-exploitation-day-26-trust-the-buildUntimed
TTweb-exploitation-day-26-trust-the-build/time_trialTimed; server returned the deadline
MMweb-exploitation-day-26-trust-the-build/masteryFirst timed attempt expired; regular untimed retry completed

Automating the web lane from start to finish

Web challenges have no artifact download step. The Game Master start response is the handoff: it contains the assigned live target URL or URLs, questions, answer IDs, formats, attempt ID, and any deadline. Always browse the URL from the current response; target hosts and proofs change between attempts.

Simplest path: let the VM coordinate and solve

run_mode.py does the whole flow inside Homebase. It calls the supported CourseStack proxy to start or resume the mode, waits if targets are still preparing, sends each returned target URL to solve.py, submits recovered proofs through the same proxy, and prints the Game Master response. The proxy supplies player identity, so this VM path needs no pairing token:

cd "[local path] the Build"
python3 run_mode.py ss
python3 run_mode.py tt --timed
python3 run_mode.py mm

For TT, --timed requests the server-timed Hall of Fame run; omit it for the regular untimed pool. Mastery works the same way, with five targets solved in parallel by the classifier. A proof is submitted as the answer. When all answers are correct, the Game Master returns CORRECT and the completion flag; there is no separate flag submission. If the response says status: pending, wait for the scoring ledger before claiming points.

This is the solver reuse pattern that worked best: learn the vulnerability and response shape in SS, turn that into a reusable target solver, then invoke that solver on the fresh TT target and on each MM target. Do not reuse an SS proof or URL. TT and MM get their own URLs and proof values. The vulnerability family can repeat, as it did for the signed-package hook in SS and TT, but Mastery bundled different families: public backup discovery, cross-workspace IDOR, SQL injection, PHP LFI, and package-hook substitution. One single-purpose SS solver would not cover that bundle; use a dispatcher that identifies each family, then calls its family-specific solver. solve.py and run_mode.py implement that approach here.

If a current attempt has ended and a genuinely fresh variant is wanted, use retry first, then let run_mode.py reconnect to the new attempt:

python3 gm.py retry ss
python3 run_mode.py ss
python3 gm.py retry tt --timed
python3 run_mode.py tt --timed
python3 gm.py retry mm
python3 run_mode.py mm

Do not retry an active attempt to get a different target. The Game Master returns the same active attempt; in this run, retry did exactly that. Check status and accepted_ids before continuing. A timed run's deadline is enforced by the server, so prepare the solver and agent handoffs before starting TT or timed Mastery.

Use a separate web browser agent

A browser agent does not need a Game Master token to visit the target. Its task is to open the exact URL in targets[], follow that site's routes, preserve cookies if the site creates a session, and return the exact proof plus the request path and response excerpt. For example, with a saved Mastery start response:

python3 agent_handoff.py start-mm.json --all > mastery-agent-tasks.md

That prints one token-free handoff per target with its URL, question, answer ID, format, and investigation instructions. Assign one handoff per worker. For this bundle, keep Target 2's requests in one cookie-preserving session. Workers return structured evidence; the coordinator checks it and submits. The workers do not need the Game Master bearer.

If an agent cannot reach the VM's internal proxy, keep GM operations in Homebase and give the browser worker only the assigned target URL. The worker cannot start or submit through [ip]; that address is the internal CourseStack proxy. The VM scripts can.

Let an external agent start and submit with its paired bearer

The pairing bearer authenticates to the Game Master API, not the target website. The direct Game Master origin for external agents is https://2026.huntress.ctf.games/. Its API accepts the bearer in an HTTP Authorization header. The target URL returned by start is a separate host. The direct API origin was checked without a credential and correctly returned HTTP 401, indicating that the route requires the paired bearer.

Pair once through the trusted CourseStack proxy. The documented request is POST http://[ip]/huntress-ctf-proxy?op=pair with an empty body; it returns a personal gm1... bearer and expiry once. Store it directly in the external agent's secret manager and inject it into a server-side HTTP client as HUNTRESS_GM_BEARER. Repeating pairing returns already_paired without redisclosing the secret; replacing it requires an explicit reset. Do not paste the bearer into an ordinary prompt, shell command, log, shared file, browser console, or target URL. Do not send it to a worker whose only job is browsing the challenge site.

paired_gm.py is the direct API client for an API-capable external agent. It reads HUNTRESS_GM_BEARER from its secret-injected environment and never prints or saves that value. It can list, start, retry, check status, and submit:

python3 paired_gm.py list
python3 paired_gm.py start ss --out start-ss.json
python3 paired_gm.py start tt --timed --out start-tt.json
python3 paired_gm.py start mm --out start-mm.json
python3 paired_gm.py status mm
python3 agent_handoff.py start-mm.json --all
python3 paired_gm.py submit mm answers-mm.json --start-json start-mm.json
python3 paired_gm.py status mm

The answers file can be either an answer map or an object containing an answers map, for example:

{
  "answers": {
    "proof-1": "proof_<32 lowercase hex characters>",
    "proof-2": "proof_<32 lowercase hex characters>"
  }
}

paired_gm.py checks the answer IDs against the selected mode or saved start response and checks the proof format before sending. On a Mastery partial result, keep solving the missing target IDs and submit another map; status returns accepted_ids. For a start that says targets are preparing, poll paired_gm.py status <mode> --out status-mm.json and make the handoff from that saved status response once its targets[] are ready. Do not call start again to poll; start resumes the same attempt.

A direct API call follows this pattern (the placeholder is a secret-manager injection, not text to paste into the target browser):

POST https://2026.huntress.ctf.games/
Authorization: Bearer <injected secret>
Content-Type: application/json

{"challenge":"web-exploitation-day-26-trust-the-build/mastery"}

Use challenge ID web-exploitation-day-26-trust-the-build for SS, append /time_trial for TT, and append /mastery for MM. Add "run_for_time":true only when a timed attempt is intended. The returned targets[] and answer_ids are authoritative. After solving, POST the exact answer IDs and proofs in {"challenge":"...","answers":{"proof-1":"proof_..."}}.

For browser-based workers, a better division of work is still: a coordinator with the bearer starts and submits; workers get only their token-free agent_handoff.py task. This keeps the API credential away from page content and gives the coordinator one place to validate answer IDs and accepted state.

What to improve next time

  1. Inspect the VM's solver library before broad guessing. The generic web solver already knew the conventional /run/huntress/objective.txt LFI path. Check available helpers and wordlists early; this VM had no ffuf, feroxbuster, gobuster, or dirsearch, and none were needed.
  2. Turn the SS finding into a reusable function. Capture which clue endpoint reveals the feed, how the manifest is structured, which field is changed, what must remain intact, and where the response returns proof. TT repeated that vulnerability family, so rerunning the function against the new URL was enough. Never carry over the old proof.
  3. Prepare before starting a timed attempt. Have the solver and target handoff ready, then request the timed TT start. Its deadline began at the server; the solve completed in 18.727 seconds. For timed MM, preassign one worker per target and collect structured evidence in parallel.
  4. Use a family dispatcher for Mastery. The five targets were different problems. Classify each from its public page and disclosed routes, then use the corresponding archive, IDOR, SQLi, LFI, or package solver. Keep any session-dependent requests together in one cookie-preserving worker.
  5. Use only current attempt state. Keep the start response, target URL, answer IDs, deadline, and accepted IDs together. A retry while an attempt is active reconnects to that attempt. Answers from the expired timed MM attempt did not transfer to its regular retry.
  6. Submit exact recovered values and check the result. Do not convert hostnames or other incidental values into proof guesses. Batch recovered answers when possible, then check for CORRECT and inspect the final status. If scoring reports pending, wait for the ledger before claiming points.

Scripts

  • solve.py follows the target's public routes and extracts proof tokens for the status archive, incident reference, search injection, PHP LFI, and package hook families. It accepts one or more assigned target URLs and does not submit answers.
  • lfi_probe.py sends explicit doc values to an assigned PHP LFI target, prints each response, and highlights a matching proof token. It does not submit answers.
  • submit.py submits exact ANSWER_ID=VALUE fields through the supported Game Master proxy.
  • gm.py starts, retries, and checks status for SS, TT, and MM through the supported proxy. It does not accept or store pairing tokens.
  • run_mode.py automates start, target solving, and submission for all recovered proof fields in a mode.
  • paired_gm.py performs Game Master operations against the external HTTPS API using a secret-injected HUNTRESS_GM_BEARER; it never prints or saves the bearer.
  • agent_handoff.py creates target-specific, token-free instructions from a saved start response.

Example:

python3 solve.py --target 'https://<assigned-target>.2026.huntress.ctf.games/'
python3 submit.py --challenge web-exploitation-day-26-trust-the-build/mastery \
  proof-1=proof_... proof-2=proof_...