rust belt: a rust build behind familiar field names
huntress ctf 2026, day 5 · binary reverse engineering · all three modes
tools used: binary-analysis toolkit and timed-attempt pipeline.
the cumulative bundle gained a d05- member: a rust build carrying the same HCFG configuration blob as the day-2 and day-4 samples. the eight new d05_ fields used exactly the day-4 field names: the artifact's sha-256, format, architecture, and the decoded configuration (campaign, domain, url, mutex and the blob's crc).
the key insight: because the field names repeated, the field-producer registry built on day 4 answered all 40 fields of the bundle with no new code. the rust-specific analysis the prompt hinted at was not graded, so we built it on day 5 for the questions a later day is likely to ask.
challenge shape
40 fields per set: the inherited d01_-d04_ fields plus eight d05_ ones. every delivery of the rust member, across all three modes, was a linux elf64 x86-64 build, unlike day 4's mix of elf and pe.
artifact anatomy
a rust binary is recognizable without its symbol tables being intact:
- panic locations embed
/rustc/<40-hex commit>/library/...paths, which name the compiler build. - symbol names use one of two manglings. the legacy scheme wraps an itanium-like path in
_ZN ... 17h<16 hex>E(the trailingh...is a hash, not part of the path). the newer v0 scheme starts with_Rand encodes nesting with tags:Cfor a crate root,N<namespace>for a nested name. - trait implementations appear as
<Type as Trait>::methodonce demangled. this is where "trait objects hiding in plain sight" points.
in this sample the program's own symbols were legacy-mangled. a few runtime symbols used v0, and the program crate held main, a campaign function and one trait implementation (a BehaviorEngine trait on an EnvironmentModel type).
extraction method
the graded fields went through the same producers as day 4: format from the magic bytes, architecture from the elf e_machine field, and the config fields from the validated HCFG decoder (magic, version, xor key, length and crc must all agree before the json is accepted).
for the rust-only analysis, legacy demangling splits length-prefixed identifiers and drops the trailing hash:
def rust_demangle(sym: str) -> str:
m = re.match(r"_?_ZN(.*)E$", sym)
rest, parts = m.group(1), []
while rest:
n = re.match(r"\d+", rest)
size, start = int(n.group()), n.end()
parts.append(rest[start : start + size])
rest = rest[start + size :]
if re.fullmatch(r"h[0-9a-f]{16}", parts[-1]):
parts.pop()
return "::".join(parts) # then $LT$ -> <, $u20$ -> " ", .. -> ::
v0 symbols are decoded for plain paths only (crate roots and nested names; generics, impls and back-references keep the raw symbol rather than a wrong guess). the program's own crate is the one that defines main outside the runtime crates (core, alloc, std, unwinding and debuginfo support). its functions and <Type as Trait> pairs are then filtered by that crate prefix.
validation and answer formatting
architecture is the platform name (x86-64), not a compiler target triple; format is elf; the mutex keeps its single backslash; crc and key are lowercase 0x hex. all of these were settled on earlier days and held for rust unchanged.
failed approaches and pivots
none in the analysis. a filter we first wrote for the program crate's functions matched any symbol that mentioned the crate anywhere, which also pulled in standard-library generics instantiated with the program's types. restricting it to symbols that start with the crate path, or with <crate:: for trait impls, fixed that.
automation across modes
the cumulative dispatcher groups members by their dNN- tag and answers every field from that group's main binary through the producer registry. after the day, main_functions and function_count became language-aware: go's main.* functions, or rust's program-crate functions. new producers report the program crate, the mangling scheme and the trait implementations.
lessons
- a registry keyed by field name pays off when a new language reuses the old questions: day 5 cost zero new code.
- for rust, identify the program crate first; everything interesting is a filter on that prefix.
- decode the subset of a mangling you can decode exactly and leave the rest raw. a half-demangled symbol is worse than an undecoded one.
solve times
public scoreboard · day 5 finish: 1st
- 0:28.2single#3 of 218 solvers
- 0:30.6time trial#3 of 206 solvers
- 0:32.8mastery#3 of 204 solvers
- #1team day finishof 188 teams that cleared it, in 3:35.1
- #3single 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 when we started working on the mode to its flag.
| mode | work to flag | attempts | wrong submits |
|---|---|---|---|
| single | 27s | 2 | 0 |
| time trial | 2s | 1 | 0 |
| mastery | 2s | 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 | 7.0s | 1.2s | 5.8s |
| mastery | 7.0s | 1.1s | 5.9s |
where we got stuck
- the first run of the single failed before any analysis: the environment that launched it lacked the pe-parsing dependency the toolkit imports. the second run, with the correct environment, solved the single unchanged. the solver itself never needed an edit.
flags: single, time trial, and mastery [redacted].
{generated by a clanker}