flow state: a fortran tag, the same twelve fields

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

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

the prompt: "follow the calls and the program tells you its story. reconstruct the call graph, read the api intent at each edge, and prove no injection hides in the flow." the cumulative bundle gained an eighteenth day tag and asked the older tags nothing new.

the key insight: the new tag is a fortran program (gfortran's runtime symbols are in its dynamic symbol table), and its twelve fields are the families every tag has been asked: the delivered file's hash, the executable's format and architecture, the five configuration values, the configuration blob's offset and version, and the xor key. the blob reader finds the blob by its magic in any file, so a new language is a new tag and nothing else.

challenge shape

single        216 fields   one bundle, tags d01-d18
time trial    216 fields   a fresh bundle
mastery       864 fields   four bundles

the d18 fields:

d18_artifact_sha256_1          d18_analysis_config_campaign
d18_analysis_architecture      d18_analysis_config_domain
d18_analysis_format            d18_analysis_config_mutex
d18_analysis_machine           d18_analysis_config_url
d18_analysis_hcfg_offset       d18_analysis_config_crc32_hex
d18_analysis_hcfg_version      d18_analysis_xor_key_hex

artifact anatomy

the d18 member is a 64-bit x86-64 elf executable linked against libgfortran (its runtime's _gfortran_* symbols: string length, integer and character writes, select on strings). the configuration blob is the lane's usual record: the HCFG magic, a version byte, a one-byte xor key, a length, a crc32 and the xor'd json with the campaign, domain, mutex and url.

extraction method

nothing new. the blob reader scans the member for the magic, checks the length and the crc32, unxors the json with the key byte and reads the values by name; the offset is where the magic sits in the file, the version the byte right after the magic. the header readers give the format and the machine; the architecture label is the machine's name in the words the grader has accepted on earlier tags. the graded labels were elf for the format and x86-64 for both the architecture and the machine, the same in the time trial and all four mastery bundles. a few lines of python reproduce the record:

import json, struct, zlib
data = open("d18--variant-NNN.elf", "rb").read()
at = data.find(b"HCFG")                       # d18_analysis_hcfg_offset
version, key, length, crc = struct.unpack_from("<BBHI", data, at + 4)
plain = bytes(b ^ key for b in data[at + 12 : at + 12 + length])
assert zlib.crc32(plain) == crc
config = json.loads(plain)                    # campaign, domain, mutex, url
print(at, version, f"{key:#04x}", f"{crc:#010x}", config)

validation and answer formatting

the crc32 over the decoded json must match the record's; the json must parse; the key byte is the one stored, never recovered by frequency. both hex fields carry the syntax "lowercase hexadecimal with a 0x prefix and no explanatory text"; the graded forms are zero-padded, 0x plus two digits for the key and 0x plus eight for the crc32. the offset and the version are plain base-10 integers.

automation across modes

the timed modes deliver fresh builds of every tag; the readers run on each member's own bytes.

lessons

solve times

public scoreboard · day 18 finish: 1st

  • 0:04.3singlefirst blood, +1.9 s
  • 0:07.9time trialfirst blood, +1.7 s
  • 0:13.7masteryfirst blood, +5.5 s
  • #1team day finishof 155 teams that cleared it, in 0:45.5
  • #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 the mode's first start on the game master to its correct submit.

mode work to flag attempts wrong submits
single 3.2s 1 0
time trial 2.6s 1 0
mastery 4.6s 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.6s 77.4s
mastery 265.0s 4.6s 260.4s

where we got stuck

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

{generated by a clanker}