Challenge
- Event: Huntress CTF 2026 — Day 1, orientation warmup (Single Solve, no timer).
- Category: Warmup / Web (read-the-source).
- Prompt (as supplied): "Read the rules at https://ctf.huntress.com/rules — inspect the page carefully for a flag waiting for a curious hacker reader. Find it and submit it below."
- Flag format:
flag{<32 hex>}.
Artifacts
output/rules.html— the fetched rules page (SHA-256bbbacba1002e3f17a10ed11d9c51bdd7f15f834f950887347521a23f564fd5ab).output/chunks/— the 36/_next/staticCSS+JS bundles referenced by the page.- Flag-bearing chunk:
output/chunks/__next_static_immutable_chunks_2n4xlvk_x9g6t.js.
Triage
- RULE 1 (simplest-first) + RULE 2: a URL challenge -> fetch the page, grep source for the flag before anything heavier.
- Observation:
ctf.huntress.comis a Next.js SPA. The static HTML is just a loader shell (no visible rules text, no flag). The content — and the flag — live in the client JS bundles.
Investigation
curl -sSL https://ctf.huntress.com/rules -o rules.html→ 7 KB loader shell;grep flag{→ nothing.__NEXT_DATA__held only tenant config.- Extracted every
/_next/static/...(css|js)reference and downloaded all 36 chunks. grep -rhaoE 'flag\{[^}]*\}' chunks/→ exactly one hit: Decodedflag{bf61aced6e7f9335385a70f33b20d188}- Located it in
2n4xlvk_x9g6t.js, injected into the rendered DOM as an HTML comment:dangerouslySetInnerHTML:{__html:"<!-- flag{bf61aced6e7f9335385a70f33b20d188} -->"}i.e. a "curious hacker reader" who views the rendered page source / DOM (or reads the bundle) sees the comment.
Flag Recovery
- Source: Huntress CTF rules page JS bundle (
2n4xlvk_x9g6t.js), a React component that emits an HTML comment containing the flag into the rules page. - Transformation: none — the flag is literal in the source.
- Verification: single unique
flag{32-hex}match across all 36 chunks; format valid; provenance is the authoritative public rules page. Deterministically reproducible.
Flag
- Decodedflag{bf61aced6e7f9335385a70f33b20d188}
Minimal Reproduction
curl -sSL https://ctf.huntress.com/rules -o rules.html
grep -aoE '/_next/static/[^"]+\.(css|js)[^"]*' rules.html | sort -u | \
while read p; do curl -sSL "https://ctf.huntress.com$p"; done | \
grep -aoE 'flag\{[^}]*\}' | sort -u
# -> flag{bf61aced6e7f9335385a70f33b20d188}
Lessons Learned
- For a modern SPA, the page "source" that matters is the JS/CSS bundles, not the loader HTML — grep the chunks.
- Classic "read-the-source" warmup: flag hidden in an HTML comment, delivered via
dangerouslySetInnerHTML. - No per-team dynamism here (public orientation challenge), so the static-bundle grep is authoritative; for scored dynamic challenges the flag must come from the team's own served instance instead.