campaign trail: a config record under a new magic, at the end of three neko modules
huntress ctf 2026, day 30 · binary reverse engineering · all three modes
tools used: binary analysis and timed-attempt pipeline.
"one binary is a clue; a campaign is a story. reconstruct the loader, library, and config graph across the whole set and map the operation end to end." the day's tag was three neko bytecode modules in the evidence zip, a loader, a library and a config module, and fourteen questions about them inside the cumulative bundle of every earlier tag: 420 fields in all.
the key insight is that the question was the parser. each of the eight configuration questions spelled out the whole algorithm: the member by its basename, a record with the magic HGRF found by scanning backward from the end, the byte offsets of its version, xor key, length and crc32, and the json path of the value. the layout was the HCFG record our readers had parsed since the first binary days; only the magic was new. our reader looked for the literal HCFG and read nothing, and the json path's first word, graph, turned out to name the record rather than a key in it.
challenge shape
single 420 fields the cumulative tags of days 1-30; 14 on the d30 tag
time trial 420 fields the same on a fresh zip
mastery 5880 fields the same over fourteen sets
the d30 fields are each member's sha-256 in zip central-directory order, the container format of each module, the four configuration values (campaign, domain, mutex, url) of config.n's record (d30_analysis_config_capsule_graph_config_*), and the same four from loader.n "after confirming all three canonical campaign graphs match when this_role is omitted" (d30_analysis_config_*). one of the latter, in full:
In evidence.zip, Use loader.n's decoded HGRF graph.config object after
confirming all three canonical campaign graphs match when this_role is
omitted. Locate the unique CRC32-valid HGRF record by scanning backward
from the end of the Neko 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 loader.n decoded HGRF JSON property graph.config.campaign, without JSON
quotes.
artifact anatomy
the evidence zip had 45 members (36 megabytes), aes-encrypted under the lane's standing password (7z x -pinfected; python's zipfile cannot open aes entries). the three d30 ones sit in central-directory order loader, library, config:
d30--sample-loader.n 20880 bytes
d30--sample-library.n 20890 bytes
d30--sample-config.n 20916 bytes
each is a neko module: the magic NEKO, then three little-endian u32 counts (214 globals, 171 field names, a code size of 9391), then the globals, the field names and the code. the string globals hold short plaintext json records of a trace schema (huntress.binary.dynamic_trace.v1: a branch, an event count, the campaign, the family, the role, effects and network); they carry the campaign value but not the domain, url or mutex the questions ask for. there is no HCFG in any of the three files.
the configuration sits in a record appended at the very end of each module; in all three it ends on the file's last byte. the header is HCFG's twelve bytes under a new magic (the loader's):
offset bytes field
0 48 47 52 46 magic "HGRF"
4 01 version
5 f1 xor key
6 b7 02 payload length, u16 little-endian: 695
8 fb 17 15 c4 crc32 of the decoded payload, little-endian: 0xc41517fb
12 ... 695 payload bytes, each xored with 0xf1
the decoded payload is a campaign graph:
{
"schema": "huntress.binary.campaign_graph.v1",
"campaign_id": "DAY30-000",
"nodes": ["loader.n", "library.n", "config.n"],
"edges": ["loader.n->library.n", "library.n->config.n"],
"load_order": ["loader.n", "library.n", "config.n"],
"config": {
"campaign": "BR30-000",
"domain": "campaign-000.day30.example.invalid",
"ipv4": "203.0.113.30",
"url": "https://campaign-000.day30.example.invalid/stage/BR30-000",
"mutex": "Global\\HuntressBR30-000",
"windows_path": "C:\\ProgramData\\HuntressLab\\day30\\BR30-000.dat",
"linux_path": "/var/tmp/huntress-lab/day30/BR30-000.dat",
"service": "HuntressLab-Day30-000",
"host_model": "workstation"
},
"this_role": "loader",
"network": "none",
"effects": "isolated_multi_process_event_graph_only"
}
the three records are identical except for this_role (loader, library, config), which is why the question drops that one key before comparing them. the root has no graph key: "graph.config.campaign" means the config.campaign of the campaign graph.
extraction method
by hand, following the question word for word, with members mapping each extracted member's name to its bytes:
import json, struct, zlib
def hgrf(body: bytes) -> dict:
pos = body.rfind(b"HGRF")
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 json.loads(payload.decode("utf-8"))
pos = body.rfind(b"HGRF", 0, pos)
raise ValueError("no crc32-valid HGRF record")
graphs = {role: hgrf(members[f"d30--sample-{role}.n"])
for role in ("loader", "library", "config")}
def without_role(g: dict) -> dict:
return {k: v for k, v in g.items() if k != "this_role"}
assert without_role(graphs["loader"]) == without_role(graphs["library"]) \
== without_role(graphs["config"])
print(graphs["loader"]["config"]["campaign"])
the binary analysis readers parse each question into a recipe (a member selector and an operation) before they look at the field name, as on days 28 and 29. the selector basename ends loader.n and the format operation were already there; the configuration operation scanned every carrier (raw, base64, hex, utf-16, xored, compressed, a packed overlay) for the literal HCFG and raised no valid hcfg blob on all eight fields. on day 30 the operation learned to take the magic from the question, to fall back to a crc-validated scan under any 4-byte magic, to walk a dotted json path whose leading words may name the record, and to compare the members' records with the named key dropped, failing loudly on the first key that differs.
validation and answer formatting
the crc32 over the decoded payload is the check: a stray HGRF in the code would not carry a matching crc, and the backward scan keeps going. a string value is submitted as the json decodes it, without quotes and without json escaping, so the mutex keeps one backslash. the single's d30 answers, all accepted:
d30_artifact_sha256_1 7df5ce6a3f45d9b723b5968541d9b62de89bc9f356d9a1c952a7e411d39cae5b
d30_artifact_sha256_2 635d57ed0e506aa317875b312d134a212824fb0df1017425c7bd2c206079a8a2
d30_artifact_sha256_3 462453a272f60cf57b1e4467bac564630ed3e514394bd088d04534f0235cae7a
d30_analysis_loader_format neko_bytecode
d30_analysis_library_format neko_bytecode
d30_analysis_config_capsule_format neko_bytecode
d30_analysis_config_campaign BR30-000
d30_analysis_config_domain campaign-000.day30.example.invalid
d30_analysis_config_mutex Global\HuntressBR30-000
d30_analysis_config_url https://campaign-000.day30.example.invalid/stage/BR30-000
d30_analysis_config_capsule_graph_config_campaign BR30-000
d30_analysis_config_capsule_graph_config_domain campaign-000.day30.example.invalid
d30_analysis_config_capsule_graph_config_mutex Global\HuntressBR30-000
d30_analysis_config_capsule_graph_config_url https://campaign-000.day30.example.invalid/stage/BR30-000
sha-256 member 1 is the loader, 2 the library and 3 the config module, by central-directory order, not by name. neko_bytecode had sat in the format enum's listed values for weeks and was graded for the first time here. the time trial's record had the same shape with other values: campaign BR30-DD133174, domain edge-f95b234c.day30.example.invalid, mutex Global\HuntressDD0F5AFC639D, url https://node-f2201c23.day30.example.invalid/node/966ae9fec5.
failed approaches and pivots
- the literal magic. the reader knew the layout and had handled a changed magic once before (day 20's
RS20, for an overlay unpacker), but its configuration scan matched the four lettersHCFG. our notes for the lane said a neko module's configuration would be a literalHCFGin the string globals; the bytes said otherwise, and the question had said so in plain words. - the first handler walked
graph,config,campaignas keys and crashed withKeyError: 'graph'; the record's root holdsconfigdirectly. the second skipped leading path words that are not keys, which is the rule the reader keeps now.
automation across modes
with the handler saved, the time trial and the mastery read every field on their first run: 0.35 seconds for the time trial's 420 fields, and the mastery's fourteen sets were solved as they downloaded, about 1.9 seconds of reading spread over the download.
lessons
- when a question spells out offsets, a magic and a path, it is the parser's specification; read it before reading the bytes.
- a record layout outlives its magic. scan for a header whose checksum verifies, with the named magic as the fast path, never for a literal.
- the first word of a dotted path can name the structure itself; walk a path by trying the longest suffix that exists, and fail with the keys that do exist.
- "map the operation end to end" did not become a field: the graph's nodes, edges and load order were never asked for.
solve times
public scoreboard · day 30 finish: below top 10
- 3:58.2single#30 of 135 solvers
- 4:02.5time trial#25 of 131 solvers
- 4:10.0mastery#16 of 130 solvers
- #14team day finishof 52 teams that cleared it, in 2h43m
- #7single 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 | 3m56.0s | 1 | 0 |
| time trial | 2.0s | 1 | 0 |
| mastery | 5.1s | 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 | 2.0s | 78.0s |
| mastery | 665.0s | 5.1s | 659.9s |
where we got stuck
- single, 3m56s. our solver's first run, nine seconds into the attempt (most of it the 36-megabyte download), answered 412 of the 420 fields; the eight configuration fields raised
no valid hcfg blob. - the next 144 seconds nobody worked those eight fields: the lane fixer was on the day's other binary challenge, a one-off static reverse-engineering file, and moved to this one 153 seconds into the attempt.
- 64 seconds from there to the first save. the fixer listed the members, grepped the three modules for
HGRF25 seconds in, and read the question text, which had held the whole algorithm from the start, 55 seconds in; the handler went down nine seconds later, 52 seconds after the fixer took the file. - the first save crashed on the guessed json shape (
KeyError: 'graph'): the handler walked the question's path without reading the decoded record's keys. the corrected save, 16 seconds after the crash, answered all eight fields, and the flag came a second later.
flags: single, time trial, and mastery [redacted].
{generated by a clanker}