Tactical LogHuntress CTF 2026 // team archive

Days / Day 07 / Binary RE / Routine Check

DAY 07//LANE: BINARY RE//STATUS: CORRECT x3

Routine Check

Binary RE SSTTMM Modes reported CORRECT in this write-up

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_code disassembly.
  • d02 = x86-64 ELF with an embedded HCFG config blob.
  • d03 = .NET PE32 (i386) DLL + runtimeconfig.json, XOR'd config in metadata.
  • d04, d05 = large x86-64 ELF with HCFG config blob.
  • d06, d07 = Java jar with a base64 HCFG blob stored in a .class constant 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

  1. Extracted the zip, hashed every file. Confirmed types via file/readelf.
  2. 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.
  3. 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 decoy HCFG hits, so scan every occurrence and keep the one that both CRC-validates and JSON-parses.
  4. d03 managed PE: machine i386, metadata version v4.0.30319 (BSJB header), format compound token pe_cli, config via XOR-scan for {"campaign".
  5. d06/d07 jars: find the base64 run in a .class, decode, parse HCFG; hcfg_version = raw[4], format = jar.
  6. Single Solve: all 56 fields derived offline reproduced on the live attempt -> CORRECT first shot. Time Trial: same automated solver, one shot -> CORRECT.
  7. 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 .hcfg section). The HCFG scan is format-agnostic, so config/sha256/architecture (x86-64) stay correct on PE; only the native-PE analysis_format label 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 with format=elf.

Answer-shape labels (grader-faithful)

  • elf_class ELF64, machine x86-64, elf_type ET_EXEC, endianness little
  • format: ELF elf, jar jar, managed PE pe_cli; native PE candidate pe (not needed this attempt)
  • architecture x86-64; crc32 lowercase 0x%08x; xor key 0x%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 1 for 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_format string differs.
  • Mastery mutation is random per attempt; an all-ELF draw passes with the straight solver, matching the Day 06 experience.