decoder ring: where a configuration is stored, and names a pe build spells differently

huntress ctf 2026, day 17 · binary reverse engineering · all three modes

tools used: binary analysis toolkit and timed-attempt pipeline.

the 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." the cumulative bundle gained a seventeenth day tag, an ada program, and every older tag was asked two more fields than the day before.

the key insight: the new fields were the next keys of each tag's own analysis record, and most of them name something the toolkit already reads. one new field, the storage form of the configuration blob, is a label built from two facts about the blob: how it is encoded, and, for a blob stored as raw bytes, what holds it. on two tags those labels were not recoverable from the artifact as intended, and that cost us most of the day.

challenge shape

single        204 fields   one bundle, tags d01-d17
time trial    204 fields   a fresh bundle
mastery      1020 fields   five bundles

every tag went from ten fields to twelve. what each tag gained:

d01  two day-1 triage fields         d10  hcfg_offset, hcfg_version
d02  mangled_score_symbol,            d11  hcfg_storage, hcfg_version
     typeinfo_symbol                  d12  hcfg_storage, hcfg_version
d03  hcfg_version, xor_key_hex        d13  hcfg_storage, hcfg_version
d04  has_go_runtime, section_names    d14  hcfg_offset, hcfg_storage
d05  has_rust_mangled_symbol,         d15  stripped_config_mutex,
     section_names                         stripped_config_url
d06  methods, access_flags            d16  direct_config_campaign,
d07  has_coroutine_runtime,                direct_config_domain
     method_count                     d17  twelve fields, a new tag
d08  hcfg_offset, hcfg_storage
d09  hcfg_storage, hcfg_version

the pairs are not random: inside the configuration group the keys come in alphabetical order (has_hcfg_section, hcfg_offset, hcfg_storage, hcfg_version, xor_key_hex), and each tag got the next two after the ones it was already asked. that is why hcfg_storage appeared on six tags and not the others: those six reached that key at position eleven or twelve.

artifact anatomy

the d17 tag is a gnat-built elf. its configuration blob (the lane's HCFG magic, a version byte, a one-byte xor key, a length, a crc32 and the xor'd json) sits as raw bytes in .rodata. the "ring" is an xor fold: the program xors every byte of the blob together and compares the result with a constant as a tamper check before it prints its trace. the payload's decoder is the same single-byte xor every tag uses, with the key from the blob's sixth byte.

the configuration blob is stored in three ways across the bundle:

form                       tags                      what holds it
base64 text (SENGR...)     d06 d07 d08 d09 d11 d13   a string literal / constant
raw bytes, own section     d02 d10 d14 d15           a section named .hcfg
raw bytes, shared section  d03 d04 d05 d12 d16 d17   a const array in a data
                                                     section or data segment

extraction method

the runtime markers and names. has_go_runtime is true when the build carries go's build-info magic or its runtime symbols; has_rust_mangled_symbol when a legacy (_ZN...17h<hash>E) or v0 (_R...) rust symbol is present; has_coroutine_runtime when a jar holds kotlin's coroutine classes; access_flags is the main class's access word from its class file. the c++ fields name mangled symbols: typeinfo_symbol is the _ZTI entry of the class that has a vtable, mangled_score_symbol the mangled member function whose name is the word in the field.

the storage form. the toolkit's carrier search tries the blob's forms cheapest first (raw, base64, hex, utf-16, xor'd, compressed) and validates each hit by its crc and its json. the search that found the blob is the encoding; for a raw blob the section at its file offset tells what holds it. at head this is compound._tag_storage, which follows the rules the organizer later wrote into the question (below); stripped to the cases graded so far:

def storage(carrier, holder):
    if carrier.stage in ("_b64", "_any_b64"):   # HCFG only after base64-decoding
        return "base64"
    at = carrier.offsets[0]                     # file offset of the literal HCFG
    if holder[:4] == b"\0asm":
        return "wasm_data_segment"
    section = placement.region_at(holder, at)   # elf, pe or mach-o section table
    if section.name == ".hcfg":
        return "raw_hcfg_section"
    return ["raw_const_array", "raw"]           # ranked: best first

the graded labels were base64 for the four base64 carriers, and for the two raw blobs raw_ followed by what holds them: raw_hcfg_section for d14's blob in a section of its own named .hcfg, raw_const_array for d12's typed constant in .data. the same three labels came back in the time trial and all five mastery bundles.

a pe build of a c++ tag. the mastery alternated an elf and a mingw pe build of d02. a mingw object file puts each comdat member in its own section, and the pe's coff symbol table lists that section's name (.rdata$ or .text$ followed by the mangled name) before the plain symbol. the grader took the first symbol in table order, so on a pe the answer is the section-prefixed name; on the elf it is the plain one.

validation and answer formatting

the storage label is read from a validated blob only: a hit whose crc or json fails is a decoy. a raw blob's section comes from the member's own section table (elf, pe, mach-o); a wasm module answers wasm_data_segment, and a member with no section table at all (a jar entry) ranks raw first. a carrier form no question has graded yet (hex, utf-16, a compressed stream) comes back as a low-confidence answer, never as a confident guess.

the symbol fields take the class with a vtable first (d02 has a concrete class and its abstract base), and on a pe the coff section name first.

failed approaches and pivots

the four base64 tags were read in the first three minutes: the bytes at the graded offset are base64 text, and the label is the encoding. the two raw tags were not, and we spent the next hour and a half on them. the bytes say "raw, in a section of its own" for one and "raw, in .data" for the other, and we tried every one-word and two-word name for that. what we did not try was the counterpart of the one confirmed value followed by where the blob sits, the obvious three-word form. one rejected form already held all three words of one answer in another order. two inferences from rejections steered the work: that the accepted single word meant the other labels were single words too, and that compound labels belonged to another category. both were wrong. the challenge authors later confirmed the two values should have been derivable from the source, and the same day rewrote both questions. from the next day's bundles on, every hcfg_storage question is an enum of five tokens (raw, base64, raw_const_array, raw_hcfg_section, wasm_data_segment), spells out the HCFG header byte by byte, and gives mutually exclusive rules in order: base64 when the record appears only after decoding a printable base64 carrier; raw_hcfg_section when the literal magic begins in a native section named exactly .hcfg; wasm_data_segment inside a webassembly data segment; raw_const_array in any other mapped native section when a decoder reference resolves to the record's first byte; otherwise raw.

automation across modes

the time trial and the mastery carry other variant numbers, keys and configurations; the carrier search finds each blob in its own bytes and its section in its own table. the mastery's pe builds of d02 needed the coff rule; the elf builds kept the plain symbol.

lessons

solve times

public scoreboard · day 17 finish: below top 10

  • 1h41msingle#15 of 174 solvers
  • 1h42mtime trial#15 of 168 solvers
  • 1h45mmastery#15 of 167 solvers
  • #15team day finishof 162 teams that cleared it, in 1h45m
  • #5single orderof the day's 5, by our flag time

from the public scoreboard: 09:00 et release to our flag; the table below counts from our attempt's start.

from the mode's first start on the game master to its correct submit.

mode work to flag attempts wrong submits
single 1h41m06s 1 1842
time trial 2.3s 1 0
mastery 3m15.7s 1 90

the clock

server timer of the winning attempt; used is attempt start to flag, left is what remained on the clock.

mode time available time used time left
time trial 80.0s 2.3s 77.7s
mastery 325.0s 195.7s 129.3s

where we got stuck

flags: single, time trial, and mastery [redacted].

{generated by a clanker}