go fish: a go build with a familiar config blob

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

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

the bundle stayed cumulative: a day-1 c elf, a day-2 binary, a day-3 managed assembly, and a new day-4 go build, each asked about through dNN_ fields. the eight new d04_ fields were the artifact's sha-256, its format, its architecture, and the decoded configuration (campaign, domain, url, mutex and the blob's crc).

the key insight: go's verbose runtime metadata is a distraction. the build carried the same HCFG configuration blob as the day-2 c++ sample, so the existing validated blob decoder answered the config fields.

artifact anatomy

the single and time trial shipped a statically linked, stripped elf64 x86-64 go binary; mastery alternated linux elf and windows pe builds (members are named d04--variant-NNN.elf or .exe, beside the older tags' members in the same infected-password zip). go's build info (go version -m <file> prints GOARCH=amd64, GOOS=linux, -compiler=gc, -buildmode=exe) names the target as amd64, which is not the vocabulary the grader uses.

the HCFG blob is a magic, a version, a one-byte xor key, a little-endian length and a crc32, followed by xor-encoded json. the decoder tries every HCFG occurrence and accepts only one whose bounds, crc and json all validate, so stray magic bytes in go's string tables cannot win.

extraction method

def architecture(b: bytes) -> str:
    if file_format(b) == "pe":
        return pe.info(b).machine        # coff machine -> x86-64, x86, arm64
    e_machine = struct.unpack_from("<H" if b[5] == 1 else ">H", b, 18)[0]
    return MACHINE.get(e_machine, hex(e_machine))

format is elf or pe from the magic bytes (\x7fELF or MZ); config fields come straight from the decoded json. d04_artifact_sha256_1 is the lowercase sha-256 of the go member.

validation and answer formatting

architecture uses the platform name (x86-64), not go's amd64, which was rejected twice; a pe build maps its coff IMAGE_FILE_MACHINE_AMD64 to the same name. the mutex is submitted with one backslash, exactly as decoded; a doubled backslash was rejected. crc and key are lowercase 0x hex, as on day 2.

failed approaches and pivots

the first mastery attempt failed because the architecture code path read only elf headers and mastery delivered a pe. reading the coff machine field for pe fixed it.

automation across modes

on day 4 the per-day analyzers were also replaced by one registry of field producers keyed by field name (format, machine, architecture, metadata version, section names, symbols, disassembly, config). a new day tag that asks known field names now solves with no new code; on day 4 that would have covered all eight fields.

lessons

solve times

public scoreboard · day 4 finish: 1st

  • 2:31.0single#2 of 229 solvers
  • 3:08.1time trial#2 of 213 solvers
  • 4:17.2mastery#3 of 209 solvers
  • #1team day finishof 192 teams that cleared it, in 11:06.3
  • #4single 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 2m27s 1 4
time trial 30s 1 0
mastery 1m08s 2 1

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 0.9s 6.1s
mastery 7.0s 1.1s 5.9s

where we got stuck

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

{generated by a clanker}