Challenge
- Event: Huntress CTF 2026, Day 17 (2026-10-17)
- GM id:
binary-reverse-engineering-day-17-encoded-configuration-recovery - Category: Binary Reverse Engineering - multi-day retrospective + XOR config recovery across 17 encoded binaries in one archive
- Prompt: "The configuration is encoded, but the decoder ships with the binary - a ring waiting for its secret. Recover the reversible decoder and read what it was hiding."
Artifact
evidence.zip(challenge artifact, not published) (32,831,470 bytes), AES-256 encrypted, passwordinfected- 20 members:
d01throughd17, representing one specimen per prior day's binary challenge:- Day 01-02: C / C++ ELF (orientation)
- Day 03: .NET DLL + runtimeconfig.json
- Day 04-07: Go, Rust, Java JARs, Kotlin coroutines
- Day 08-14: Swift (ELF), Nim, Zig, D, Free Pascal, Crystal, Objective-C
- Day 15: Stripped vs symbolized ELF pair
- Day 16: WebAssembly (compact + direct)
- Day 17: Ada ELF (new)
Every binary carries exactly one CRC-valid HCFG record. Six variations:
base64wrapper in.rodata: d08, d09, d11, d13base64inside.classJAR constant pools: d06, d07rawHCFG in.hcfgdedicated section: d02, d10, d14, d15rawHCFG in.data(writable): d12rawHCFG in.rodata(other): d04, d05, d17rawHCFG in WASM data segment: d16
Investigation
Day 17 effectively asks every analysis field from Days 01-17 across one bundle. The adapter already handled ~190 fields deterministically. The TWO new fields that required dedicated work:
analysis_hcfg_storage (Day 17 new field)
At 09:00 the question text was ambiguous exact_text, with no accepted-values enum. After the organizer-fix at ~T+3h, the live question added the explicit rule set:
accepted_values: ["raw", "base64", "raw_const_array", "raw_hcfg_section", "wasm_data_segment"]
rules (applied in order):
base64 = winning HCFG only after decoding a printable Base64 carrier
raw_hcfg_section = literal HCFG in a native section named exactly .hcfg
wasm_data_segment = literal HCFG inside a WebAssembly data segment
raw_const_array = literal HCFG in a native data section OTHER THAN .hcfg (e.g. writable .data)
raw = otherwise
Final mapping for the asked members:
| Member | Container | Section | Answer |
|---|---|---|---|
| d08, d09, d11, d13 | base64 text | .rodata | base64 |
| d12 | raw | .data | raw_const_array |
| d14 | raw | .hcfg | raw_hcfg_section |
Mastery: Mangler reprise with COFF twist
Mastery = 5 deliveries, 1020 answer_ids. 1012 banked immediately. 8 fields held:
- 5x
d02_analysis_mangled_score_symbol - 3x
d02_analysis_typeinfo_symbol(PE sets 1/3/5 only)
Mastery d02 alternates ELF (sets 2/4) and MinGW PE64 (sets 1/3/5). The adapter extracted the plain Itanium symbols _ZNK15DiscoveryEngine5scoreEPKc / _ZTI15DiscoveryEngine for both. The GM accepted those for the ELF variants but rejected them for PE.
Hint from the user: "take it ezz" - the _Z of Itanium ABI mangling has a COFF counterpart.
Resolution: MinGW emits each C++ symbol in a COFF COMDAT section group named by its section ($) prefix. The PE grader expects the full COFF-decorated form:
| Set | File | mangled_score_symbol | typeinfo_symbol |
|---|---|---|---|
| set1 (PE) | d02--variant-000.exe | .text$_ZNK15DiscoveryEngine5scoreEPKc | .rdata$_ZTI15DiscoveryEngine |
| set2 (ELF) | d02--variant-001.elf | _ZNK15DiscoveryEngine5scoreEPKc | _ZTI15DiscoveryEngine |
| set3 (PE) | d02--variant-001.exe | .text$_ZNK15DiscoveryEngine5scoreEPKc | .rdata$_ZTI15DiscoveryEngine |
| set4 (ELF) | d02--variant-002.elf | _ZNK15DiscoveryEngine5scoreEPKc | _ZTI15DiscoveryEngine |
| set5 (PE) | d02--variant-002.exe | .text$_ZNK15DiscoveryEngine5scoreEPKc | .rdata$_ZTI15DiscoveryEngine |
Note: recover_code is none for the stripped Day 17 d01 variant (no symtab, no recoverable function name). The literal none is the correct answer per the format's own rule ("use the literal none only when the requested field is absent"), confirmed by submit.
Mastery localization method
Mastery returns zero per-field feedback on an incorrect whole submit. But a partial submit that is 100% correct for every included field returns accepted with accepted_ids and remaining. So the oracle is: submit a small, high-confidence subset first (we used d08/d09/d11/d13 = base64 as the trusted 240-field baseline), then add one dNN group at a time. Each successful partial narrows the search; each incorrect localizes to that group. We went from 1020 unknowns to 8 unknowns in 15 submits with no attempts spent.
Live results (2026-10-17)
- Single Solve (CORRECT):
2026-10-17T16:16:43Z - Time Trial (CORRECT, RANKED): 36.9 s by
the team solver - Mastery (CORRECT):
2026-10-17T17:20:12Zbythe team solver- Flag: Tokenbaf352c3dcb43a86667b296ddde0e055
Solver changes
challenges/_lib/autosolve_binary.py:analysis_hcfg_storagehandler now implements the full enum rule set (ELF-section-aware, WASM-aware).analysis_has_go_runtimeandanalysis_section_namesextended to accept kind in{elf, pe, pe_native, pe_managed}(Mastery d04 alternates Go-PE and Go-ELF per set).
Lessons
- When
exact_textfields with noaccepted_valuesappear in a brand-new field name, the liveop=statuscontract is the authoritative source. Always refetch and compare after aHELDon a new field; the organizer may have added an enum. - Prior-day writeups contain hints for the current day. Day 02 "Mangled" MASTERY_SCHEMA.md explicitly flagged "PE MinGW with Itanium mangling, UNPROVEN" - the exact issue we hit today.
- PE MinGW symbols differ from ELF: COFF COMDAT groups prefix the Itanium name with
.text$,.rdata$, etc. The grader uses that full COFF name for PE binaries. - Mastery partial submits are an O(log n) oracle. Submit a known-good baseline first, then one
dNNgroup at a time, each adding to the banked set.