final boss: a config record under one more magic, nested one level deeper

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

tools used: binary analysis and timed-attempt pipeline.

"the gauntlet: everything you've learned, across platforms and languages, in one campaign. reconstruct it all, end to end, offline. no hints. good luck." the last binary challenge was the cumulative evidence zip of the whole month: every tag from d01-- to d31--, 46 members, 434 fields. 420 of those fields belonged to the thirty earlier tags and were answered by readers written on those days. the new tag was a single elf member with a configuration record appended to its end, and fourteen questions about it.

the key insight is the one from day 30: the question spells the parser. the record is HCFG's twelve-byte layout under the magic HGAU, found by a backward scan and validated by its crc32. two things were new. the decoded json nests the campaign values one level deeper than any earlier record, under config beside a trace object, and the questions name a gauntlet. prefix that is not a key in it. and the questions dropped the member name from the sentence our day-30 question parser keyed on, so the parser read nothing.

challenge shape

single         434 fields   31 tags x 14 fields; 14 on the d31 tag
time trial     434 fields   the same on a fresh zip
mastery       6510 fields   the same over fifteen sets

the fourteen d31 fields: the sha-256 of the one d31 member, its container format and machine, the record's xor key (header byte 5) and crc32 (header bytes 8..11), four configuration values asked twice under two names (d31_analysis_config_* and d31_analysis_gauntlet_config_*, each campaign, domain, mutex and url), and a trace branch from the vocabulary success, decoy, failure. one of the gauntlet questions, in full:

In evidence.zip, Use all d31-- members in ZIP central-directory order.
Locate the unique CRC32-valid HGAU record by scanning backward from the end
of the ELF member. Its byte-4 version, byte-5 XOR key, little-endian length
and CRC32 fields, XOR decoding, and UTF-8 JSON payload use the same 12-byte
layout as HCFG. Submit the exact JSON string at decoded HGAU JSON property
gauntlet.config.campaign, without JSON quotes.

the d31_analysis_config_* questions open with "Use the decoded HGAU payload's config object" and end at JSON property config.campaign; the crc32 question ends "Read the little-endian uint32 at header bytes 8..11 and render it as 0x plus exactly eight lowercase hexadecimal digits". across all 434 fields the answer kinds were 172 exact text, 139 pattern, 59 integer, 55 enum and 9 json.

artifact anatomy

the single's evidence zip was 36,185,026 bytes holding 90,935,316 bytes in 46 members, every one aes-encrypted (compression method 99) under the lane's standing password (7z x -pinfected; python's zipfile lists aes entries but cannot open them). the members fall into 31 tags, d01--sample.elf first and d31--sample.elf last in central-directory order. the timed zips were about 17 megabytes each, with 46 members as well.

the d31 member is a 506,975-byte elf64 x86-64 position-independent executable (ET_DYN, entry 0x2b00) with a symbol table and dwarf sections. its symbols are the gnu modula-2 runtime (m2iso_ and m2pim_ names, M2RTS.mod, RTgen.mod); no question asked about the language. the file contains one HGAU and no HCFG. the record starts at offset 0x7b728 (505,640) and ends on the file's last byte:

offset  bytes          field
0       48 47 41 55    magic "HGAU"
4       01             version
5       a1             xor key
6       2b 05          payload length, u16 little-endian: 1323
8       33 61 d0 5e    crc32 of the decoded payload, little-endian: 0x5ed06133
12      ...            1323 payload bytes, each xored with 0xa1

the decoded payload, long lists cut to their first three entries and the unasked ipv4 address left out:

{
 "schema": "huntress.binary.reversing_gauntlet.v1",
 "day": 31,
 "variant": "000",
 "languages": ["c", "cpp", "csharp", "... 31 in all, ending in modula2"],
 "capabilities": ["headers_and_sections", "symbols_and_runtime_fingerprints",
                  "config_decryption", "... 10 in all"],
 "prior_anchors": [
  {"day": 29, "sha256": "1b6435084b335ddbca8e93be4f55489bd3fd5ac08cc691e54072bf4c171e95a6"},
  {"day": 30, "sha256": "7df5ce6a3f45d9b723b5968541d9b62de89bc9f356d9a1c952a7e411d39cae5b"}
 ],
 "config": {
  "campaign": "BR31-000",
  "domain": "gauntlet-000.day31.example.invalid",
  "url": "https://gauntlet-000.day31.example.invalid/final/BR31-000",
  "mutex": "Global\\HuntressBR31-000",
  "windows_path": "C:\\ProgramData\\HuntressLab\\day31\\BR31-000.dat",
  "linux_path": "/var/tmp/huntress-lab/day31/BR31-000.dat",
  "service": "HuntressLab-Day31-000",
  "host_model": "offline_gauntlet"
 },
 "trace": {
  "branch": "success",
  "event_count": 73,
  "effects": "offline_end_to_end_reconstruction_only",
  "network": "none"
 }
}

the language list reads like the month's syllabus, one language per tag in day order where the bundle lets us check it: wasm 16th beside the two d16 .wasm members, ocaml 21st beside d21's .cmxs plugin, fsharp 22nd beside d22--FSharp.Core.dll, haxe 30th for the neko modules, modula2 31st. in the single, the two prior anchors are the sha-256 digests of the bundle's own d29 member 2 (d29--sample-O3.elf) and d30 member 1 (d30--sample-loader.n); in the time trial and the three mastery sets we opened, the anchors match no member of their own bundle. no question asked about the anchors, the languages or the capabilities.

the root has no gauntlet key. "gauntlet.config.campaign" means the config.campaign of the gauntlet record, the same way day 30's "graph.config.campaign" named the campaign graph, and "gauntlet.trace_branch" means trace.branch.

extraction method

by hand, following the question, with body the d31 member's bytes:

import json, struct, zlib

def hgau(body: bytes) -> tuple[int, dict]:
    pos = body.rfind(b"HGAU")
    while pos >= 0:
        key = body[pos + 5]
        (size,) = struct.unpack_from("<H", body, pos + 6)
        (crc,) = struct.unpack_from("<I", body, pos + 8)
        payload = bytes(b ^ key for b in body[pos + 12 : pos + 12 + size])
        if len(payload) == size and zlib.crc32(payload) == crc:
            return crc, json.loads(payload.decode("utf-8"))
        pos = body.rfind(b"HGAU", 0, pos)
    raise ValueError("no crc32-valid HGAU record")

crc, record = hgau(body)
print(record["config"]["campaign"], f"0x{crc:08x}", record["trace"]["branch"])

our solver's first run, 5.4 seconds into the attempt, answered 424 of the 434 fields: all 420 carried ones and four d31 ones (the member's sha-256, elf, x86-64 and the xor key 0xa1). the other ten raised KeyError: "no generic producer for analysis field(s) ['config_campaign'] ...". the binary analysis readers parse each question into a recipe before they fall back to the field's name, and on day 30 the recipe learned the sentence at <member> decoded <magic> JSON property <path> (at loader.n decoded HGRF JSON property graph.config.campaign). day 31's tag had one member, and its questions said at decoded HGAU JSON property config.campaign, with no member name between "at" and "decoded". the pattern needs one, so the parser returned a recipe with no operation for all nine record fields, and they fell back to their names. the name route did find the record: the configuration reader already scanned under any 4-byte magic with a valid crc32, and it emits one config_<key> answer per top-level key of the decoded json. that is how the earlier tags' config_campaign fields were answered. here the top level held schema, day, ..., config and trace, so it emitted config_schema through config_trace, and campaign sat one level down. its crc32 goes out as config_crc32_hex, a name this tag did not ask for.

the fix was a handlers.py beside the day's solver: one record lookup and three field rules, reusing the lane's existing record reader (elf.config_records(body, magic), every crc32-valid record in the HCFG layout under the given magic, in offset order). the json path comes from the question when it resolves, then from the field name, then from the config. fallback that actually exists (FIELDS and Any come from the solver that loads the file):

def _hgau(files: dict[str, bytes], tag: str) -> Any:
    for name, body in files.items():
        if not name.rsplit("/", 1)[-1].startswith(f"d{tag}-"):
            continue
        recs = elf.config_records(body, b"HGAU")
        if recs:
            return sorted(recs, key=_offset)[-1][1]
    raise KeyError(f"no crc32-valid HGAU record in any d{tag} member")


@FIELDS.add(r"d(31)_analysis_((?:gauntlet_)?config)_(\w+)")
def hgau_config(files: dict[str, bytes], g: tuple[str, ...], q: dict[str, Any]) -> Any:
    rec = _hgau(files, g[0])
    m = re.search(r"JSON property ([A-Za-z0-9_.]+)", str(q))
    paths = []
    if m:
        paths.append(m.group(1).rstrip(".").split("."))
    paths.append(g[1].split("_") + [g[2]])
    paths.append(["gauntlet", "config", g[2]])
    paths.append(["config", g[2]])
    return _lookup(rec.config, paths)


@FIELDS.add(r"d(31)_analysis_gauntlet_crc32_hex")
def hgau_crc(files: dict[str, bytes], g: tuple[str, ...], q: dict[str, Any]) -> Any:
    return f"0x{_hgau(files, g[0]).crc32:08x}"

the last record by offset is the first one a backward scan from the end of the member meets. _lookup tries each path in turn and raises with the record's top-level keys when none resolves. the branch rule flattens the record into underscore-joined leaf names (trace_branch, config_campaign, ...) and returns the first leaf whose name ends in trace_branch, then in branch.

validation and answer formatting

the crc32 over the decoded payload is the check, as for every record in this layout: a stray HGAU elsewhere in the elf would not carry a matching crc, and the scan would keep walking backward. each member we opened held exactly one HGAU, so "unique" held trivially. the crc answer is the stored header field rendered with 08x, which keeps the leading zeros a smaller crc would need; the xor key is header byte 5 as 0x and two digits. strings go out as the json decodes them, without quotes and without json escaping, so the mutex keeps one backslash. the single's d31 answers, all accepted:

d31_artifact_sha256_1                    8c145d36d57c0a82b6b23b713fa191e30408f518db1c88daa791f7432966ec57
d31_analysis_format                      elf
d31_analysis_machine                     x86-64
d31_analysis_xor_key_hex                 0xa1
d31_analysis_config_campaign             BR31-000
d31_analysis_config_domain               gauntlet-000.day31.example.invalid
d31_analysis_config_mutex                Global\HuntressBR31-000
d31_analysis_config_url                  https://gauntlet-000.day31.example.invalid/final/BR31-000
d31_analysis_gauntlet_config_campaign    BR31-000
d31_analysis_gauntlet_config_domain      gauntlet-000.day31.example.invalid
d31_analysis_gauntlet_config_mutex       Global\HuntressBR31-000
d31_analysis_gauntlet_config_url         https://gauntlet-000.day31.example.invalid/final/BR31-000
d31_analysis_gauntlet_crc32_hex          0x5ed06133
d31_analysis_gauntlet_trace_branch       success

the config and gauntlet_config families took identical values: both paths lead to the one config object. the time trial's record held campaign BR31-A722A4BE, domain gate-f001eaa4.day31.example.invalid, mutex Global\Huntress807607E61939, url https://edge-e6263aab.day31.example.invalid/hub/4d81636c95, crc32 0xda126411 and key 0xe1. in the timed sets the url's host is not the domain (here edge-e6263aab against gate-f001eaa4), so neither value can be derived from the other. the mastery's fifteen records began with campaigns BR31-E5C1C3C5, BR31-46276C67 and BR31-7E5568FD, crc32s 0xf325d4a8, 0x39965cda and 0x691021c0, and keys 0x55, 0x33 and 0x13 (fifteen of each). the branch was success in all seventeen records of the day; decoy and failure never appeared.

the elf bodies of the time trial and the three mastery sets we opened are byte-identical up to the record (the single's is a different build), so the record starts at 0x7b728 in each and only its length, key, crc and json change.

the carried 420

the other thirty tags cost nothing new. by our grouping of the 420 carried fields: 234 come from each tag's configuration record (campaign, domain, mutex, url, crc32, xor key, version, offset and storage of the record wherever that tag hid it, plus the role-prefixed copies of the multi-member tags), 91 are header and format classifications (format, machine, architecture, elf class, type, entry point, section names), 48 are sha-256 digests (members, an ordered set, method and handler name lists), and 47 are language and toolchain specifics (c++ typeinfo and vtable symbols, go, nim, gnat, free pascal and coroutine runtime markers, .net runtime and metadata versions, jar class and method counts, symbol counts, overlay offsets, crash frames). the readers that answered them are the ones each earlier day's post describes; the bundle was a regression test of the month, and it passed on the first run.

failed approaches and pivots

automation across modes

with the handler saved, the time trial and the mastery read every field on their first run: 0.32 seconds of solving for the time trial's 434 fields, and the mastery's fifteen zips (6510 fields) were read as they downloaded, about 2.4 seconds of reading spread over the download.

lessons

solve times

public scoreboard · day 31 finish: below top 10

  • 1:08.7single#5 of 122 solvers
  • 1:47.4time trial#8 of 116 solvers
  • 1:55.5mastery#5 of 114 solvers
  • #14team day finishof 90 teams that cleared it, in 10:51.3
  • #4single orderof the day's 7, 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 attempt start to its flag (server times). attempts counts our solver runs.

mode work to flag attempts wrong submits
single 1m06.8s 1 0
time trial 1.8s 1 0
mastery 5.4s 1 0

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 1.8s 78.2s
mastery 715.0s 5.4s 709.6s

where we got stuck

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

{generated by a clanker}