Challenge
Binary reverse engineering, Huntress CTF 2026 Day 07 (lane: binary-reverse-engineering, 56 fields). Prompt: "Kotlin coroutines don't run - they suspend, resume, and hop between states. Reconstruct the state machine from the metadata and figure out what this one was staging." Modes: Single Solve (static), Time Trial (timed), Mastery (2 evidence sets under one timer). Scored per field by the Game Master (partial credit, accepted fields accumulate).
Artifacts
artifact_0.bin (challenge artifact, not published) = AES zip (password infected, inert fixtures) holding an evidence set of 8 items per set:
- d01 = dynamically linked x86-64 ELF (EXEC, not stripped): header facts, section names, symbols,
recover_codedisassembly. - d02 = x86-64 ELF with an embedded
HCFGconfig blob. - d03 = .NET PE32 (i386) DLL + runtimeconfig.json, XOR'd config in metadata.
- d04, d05 = large x86-64 ELF with
HCFGconfig blob. - d06, d07 = Java jar with a base64
HCFGblob stored in a.classconstant pool.
Despite the Kotlin-coroutine flavor text, this is the recurring dual_format_re forensic-inventory family (Day 02 Mangled / Day 03 Table Manners / Day 04 Go Fish / Day 05 Rust Belt / Day 06 Pool Party) extended to 7 slots.
Investigation
- Extracted the zip, hashed every file. Confirmed types via
file/readelf. - d01 ELF:
readelf -h/-S/-s,objdump -d -M intel.recover_code(FUNC, 6 bytes @ 0x401126) =mov eax,0x1fa4(8100) +ret-> disassembly["mov eax, 8100","ret"]. Section-name and non-empty-symbol lists emitted as compact JSON arrays. - HCFG layout (same across d02/d04/d05/d06/d07): magic
HCFG(4) + version(1) + 1-byte XOR key(1) + len(2 LE) + crc32(4 LE) + single-byte-XOR JSON payload. Brute is unnecessary - key byte is in the header; XOR the payload and CRC32-validate. Large ELFs can contain decoyHCFGhits, so scan every occurrence and keep the one that both CRC-validates and JSON-parses. - d03 managed PE: machine
i386, metadata versionv4.0.30319(BSJB header), format compound tokenpe_cli, config via XOR-scan for{"campaign". - d06/d07 jars: find the base64 run in a
.class, decode, parse HCFG;hcfg_version = raw[4],format = jar. - Single Solve: all 56 fields derived offline reproduced on the live attempt -> CORRECT first shot. Time Trial: same automated solver, one shot -> CORRECT.
- Mastery = 2 sets x 56 fields (
setN.prefix). Mutation space includes native PE32+ deliveries in d02/d04 (observed: mingw-GCC exe and Go exe, both amd64, with a.hcfgsection). The HCFG scan is format-agnostic, so config/sha256/architecture (x86-64) stay correct on PE; only the native-PEanalysis_formatlabel is unknown. Built a runner that submits the sure batch then iterates PE format candidates (pe,pe32+, ...) resubmitting the full set (partial-credit accumulation flips result to CORRECT on the right label). The drawn mastery attempt happened to be all-ELF, so it solved immediately withformat=elf.
Answer-shape labels (grader-faithful)
- elf_class
ELF64, machinex86-64, elf_typeET_EXEC, endiannesslittle - format: ELF
elf, jarjar, managed PEpe_cli; native PE candidatepe(not needed this attempt) - architecture
x86-64; crc32 lowercase0x%08x; xor key0x%02x; hcfg_version integer (= raw[4]) - section_names / symbols / disassembly = compact JSON arrays (
separators=(",",":"))
Flags
- Single Solve Token0ec9c3469c99a2c1c8cecaa80872a056
- Time Trial Tokenb5a29c1b96c633af996932371f7cfbea
- Mastery Token203a12293ef0e1d834860301fe9d3e92
Minimal Reproduction
- Offline:
python3 "challenges/Day 07/Routine Check/scripts/solve_routine.py" offline "challenges/Day 07/Routine Check/work" - Live:
python3 .../solve_routine.py <mode_cid> <reps>(single_solve/time_trial);python3 .../run_mastery_v2.py <id>/mastery 1for mastery (handles PE probing).
Lessons Learned
- Reused Rust Belt (d01-d05) + Pool Party jar logic (d06/d07) verbatim; only new work was handling native-PE mutations in d02/d04 for Mastery.
- HCFG scan is container-agnostic: config/crc/xor key/sha/architecture are all recoverable from a native PE the same way as from an ELF; only the
analysis_formatstring differs. - Mastery mutation is random per attempt; an all-ELF draw passes with the straight solver, matching the Day 06 experience.