family resemblance: questions that carry their own recipes

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

tools used: binary analysis and timed-attempt pipeline.

"these binaries might be related, or they might just look alike. cluster them by behavior, watch out for false friends, and sort the family from the strangers." the day's tag was three elf builds in the evidence zip, two members of one family and a false friend that looks like them. the cumulative bundle's 392 questions also carried 32 field names our readers had never answered, most of them new questions about the tags of earlier days.

the key insight is that those questions were recipes. "true exactly when the final bytes contain NimString or NimMain", "count names that match /^_D|\b_d_/", "read elf e_shnum", "join with one lf byte and no trailing lf, then sha-256": each sentence says which members to read, what to compute and how to render it. our binary readers answered fields by their names, and a name like has_nim_runtime on an old tag matched no producer. a reader that parses the sentence into a selector and an operation answers all of them, and keeps answering when a tag's member is an elf build in one set and a pe build in the next.

challenge shape

single        392 fields   the cumulative tags of days 1-28; 32 names new
                           to us: 11 on the d28 tag, 21 on older tags
time trial    392 fields   the same on a fresh zip
mastery      4704 fields   the same over twelve sets

the d28 fields are each member's sha-256, the two family members' and the false friend's container format and e_machine, the family's four configuration values (campaign, domain, mutex, url) and the false friend's campaign.

artifact anatomy

the three d28 members are elf executables whose names end in family-a.elf, family-b.elf and false-friend.elf; all three graded elf for the format, in every set. each carries the family's HCFG record, laid out as the question spells it: the four magic bytes, a version byte, a one-byte xor key, a little-endian u16 payload length, a little-endian crc32 of the decoded payload, and the payload from byte 12, xored with the key into utf-8 json. the two family members decode to byte-for-byte equal json objects; the false friend's record is just as valid and has different values. the question for the family's values says so itself: "decode family-a.elf and family-b.elf and require their config objects to be byte-for-byte equal before using the common family value; do not use false-friend.elf".

the other new names were spelled out in the same style. a selection of the sentences and what each asks for:

"true exactly when the final bytes contain NimString or NimMain"
        a literal search over the member's bytes
"... interpreted as Latin-1 or UTF-16LE contain the case-sensitive text decoy"
        the same in two encodings
"count names that match /^_D|\b_d_/"
        a regex count over non-empty symbol names
"Read ELF e_shnum and count the corresponding section-header-table
 entries, including section index 0"
        a header field
"In the ELF .text bytes, count every [one-byte conditional jump opcode]
 and every [two-byte near conditional jump] ... a single left-to-right
 byte scan" (the question lists the byte ranges)
        a conditional-jump opcode count over .text
"sort strings by ascending code-unit order, join with one LF byte and no
 trailing LF, then SHA-256 those UTF-8 bytes"
        a digest of a sorted, joined name list
"join those digests with ASCII colon characters ... then SHA-256"
        a digest of the members' digests in archive order
"Render the requested one-byte packing key as 0x plus exactly two
 lowercase hexadecimal digits"
        a key from the packed overlay's directory, formatted
"Read the CLI header major and minor runtime bytes and submit major.minor"
        two bytes of the .net cli header
"Read Main-Class ..., locate that .class entry, resolve its this_class"
        a jar's main class through its constant pool

extraction method

the binary analysis readers now parse a question into a recipe before they look at its field name. the selector comes from the sentence's opening ("use all d10-- members in zip central-directory order", "use the unique d28-- member whose basename ends false-friend.elf", "use the unique d03-- primary managed assembly", or a named pair whose configs must agree), and the operation from the first sentence shape that matches:

def parse(text: str) -> Recipe:                  # recipe.parse, abridged
    select = (pair(text) or ends_with(text) or primary(text) or Select("all"))
    op = (member_count(text) or section_count(text) or classify(text)
          or machine(text) or cli_runtime(text) or this_class(text)
          or header_field(text) or contains(text) or joined_sha256(text)
          or symbol_count(text) or byte_count(text) or overlay_key(text)
          or config_property(text, select) or cluster(text) or name_test(text))
    return Recipe(select, op)

a sentence no shape matches has no recipe and goes to the name-based producers as before, so the interpreter can only add answers. each operation is a small reader that dispatches on the member's own magic: symbol names come from an elf .symtab or a pe's coff symbol table, .text from either section table, a header field from the struct of the member's real format. for the family's configuration, both members are decoded by a backward scan for the first crc-valid record, the two json objects must be equal byte for byte, and only then is the property read; a pair that differs is an error, never a guess.

the cluster itself became a producer too: the members whose decoded configs agree are the family, and the one whose config differs is the false friend, by name or by position, whichever form a question asks for.

validation and answer formatting

every rendering in this bundle is spelled by the question: lowercase true or false from the question's enum, digests as sixty-four lowercase hex digits, the packing key as 0x and two lowercase hex digits, the runtime as major.minor in base 10, e_machine as an unsigned base-10 integer, the container format from the listed enum. the one rule the sentence did not settle is a pe build under the elf wording: "read elf e_shnum ... including section index 0" asked of a pe has no e_shnum and no null section. the count the grader accepted there is the coff header's NumberOfSections as it stands, and the recipe submits that first and the count plus one second. our answers: 27 for the single and the time trial, both elf builds, and in the mastery 27 for the five elf sets and 9 for the seven pe sets (2, 5, 7, 8, 9, 10 and 12).

failed approaches and pivots

automation across modes

the time trial's first set shipped the d10 tag as a pe: the elf-only rule crashed on it four times and that attempt ran out; the second attempt's set was an elf and flagged with 2.9 seconds used. seven of the mastery's twelve sets shipped d10 as a pe (and five shipped d02 as one); the format-dispatching readers completed the mastery about five minutes into its clock. with the recipe interpreter in place the same bundle reads all 392 fields of the single on the first run, and a rerun of the mastery on fresh sets took under six seconds.

lessons

solve times

public scoreboard · day 28 finish: below top 10

  • 13:37.3single#58 of 149 solvers
  • 26:04.7time trial#71 of 147 solvers
  • 31:21.7mastery#68 of 144 solvers
  • #49team day finishof 122 teams that cleared it, in 31:21.7
  • #6single 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 start on the game master to its correct submit. the time trial's first attempt crashed four times and ran out; its second attempt flagged.

mode work to flag attempts wrong submits
single 13m33.9s 1 28
time trial 1m30.1s 2 0
mastery 5m12.7s 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.9s 77.1s
mastery 570.0s 312.7s 257.3s

where we got stuck

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

{generated by a clanker}