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
- matching by field name: 26 of the new names had no producer, and the other six failed inside one (the family's config found two different valid records, and the archive-level structural fields found none). nothing about the bytes was hard; the readers simply never read the question.
- digest guesses: before anything computed them, hex runs found in the members were tried as the answers to the two digest fields, and 25 of the single's 28 rejected values were those. a digest the question says to compute is never stored in the bytes.
- an elf-only rule: the first rules written for the 32 fields called elf readers directly, and the timed sets shipped some older tags as pe builds under the same tag and the same question text.
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
- a question that says what to compute is a program: parse its selector and its operation, and send a sentence you cannot parse to the old path rather than guessing.
- a tag is not a format: dispatch every reader on the member's magic, even when the question's wording names one format.
- two valid configuration records in one bundle are the point of a false-friend challenge, not a parsing error; require the pair to agree before using either.
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
- single, about thirteen and a half minutes: the first run at release answered 360 of 392 fields. the 32 failures waited about eight minutes for us to pick them up (a slow start on our side), and were then read by hand from their questions' recipes one field at a time, with 28 rejected values on the way.
- time trial, about twelve and a half minutes from the single's flag: its first start came about eleven minutes after that flag, time that went into turning the hand readings into solver rules in one large change instead of one field at a time, and those rules read elf only. the first attempt's d10 was a pe; four runs crashed and the attempt ran out before the fix, 1m30s from the first start to the flag.
- mastery, about five minutes: seven of twelve sets shipped d10 as a pe. making the section count dispatch on the member's format took about five minutes, inside the same attempt.
flags: single, time trial, and mastery [redacted].
{generated by a clanker}