hive mind: a registry hive's root key, under a name one word short

huntress ctf 2026, day 25 · metadata forensics · all three modes

tools used: archive and metadata readers, cross-lane field resolution and timed-attempt pipeline.

"registry hives from multiple systems have been renamed and separated from host labels. identify each true root, regroup the systems, and isolate the planted hive." the day's new family was the windows registry hive, the regf file behind NTUSER.DAT, SOFTWARE and SYSTEM, and its first property was the name of the hive's root key.

the key insight: the parsing was already done. our hive record had read the root key's name since day 14 and kept it as root_key_name. the question called the property hive_root_name, without the word key, and our property matcher only accepted a record field whose every word the property names. one missing word was the whole stall.

challenge shape

single          1 field    registry.hive_root_name of one hive
time trial     30 fields   the new property beside one from each earlier
                           day, member hashes, sizes, magic bytes and bom,
                           a member's filename, and a synthesis order
mastery       270 fields   the same over nine sets

artifact anatomy

a hive is a 4096-byte base block followed by hive bins (hbin), each a whole number of 4 kib pages and filled with cells. the base block fields that matter:

offset  size  field
0x000   4     "regf"
0x004   4     primary sequence number
0x008   4     secondary sequence number (differs from the primary
              while a write is in progress: a dirty hive)
0x00c   8     last written, filetime
0x014   4     major version (1)
0x018   4     minor version
0x01c   4     file type (0: primary file)
0x020   4     file format (1: direct memory load)
0x024   4     root cell offset, relative to the first hbin
0x028   4     size of the hive bins data
0x02c   4     clustering factor
0x030   64    file name, utf-16le: the tail of the path it was saved as
0x1fc   4     checksum: the xor of the 127 dwords before it

the single's hive is the base block and one 4096-byte hbin. its sequence numbers are equal, its major and minor versions are 1 and 3, its checksum is valid, and the root cell is the bin's first cell, right after the 32-byte hbin header. the file-name field is worth noticing for this prompt: it keeps the name the hive was saved under (cut to the field's 31 characters plus a terminator), so a hive renamed on disk still carries a trace of its original name inside its own header.

a cell starts with its size as a signed 32-bit integer (negative while in use). the root cell is a key node, nk:

offset  size  field (from the "nk" signature)
0x00    2     "nk"
0x02    2     flags: 0x04 root key, bit 5 name stored as latin-1
0x04    8     last written, filetime
0x14    4     number of subkeys
0x24    4     number of values
0x48    2     name length in bytes
0x4c    n     name

the single's root key has the flags 0x04, 0x08 and bit 5 (root, not deletable, latin-1 name), no subkeys and two values: a marker string and an ordinal number. its name is the answer.

extraction method

the hive record reads the base block with one struct call and then follows the root cell offset to the key node:

seq1, seq2, written, major, minor, ftype, fmt, root, size = struct.unpack_from(
    "<IIQIIIIII", data, 4
)
nk = 0x1000 + root + 4                      # first hbin + offset + cell size
if data[nk : nk + 2] == b"nk":
    flags, nk_written = struct.unpack_from("<HQ", data, nk + 2)
    length = struct.unpack_from("<H", data, nk + 0x48)[0]
    raw = data[nk + 0x4C : nk + 0x4C + length]
    out["root_key_name"] = raw.decode("latin-1" if flags & (1 << 5) else "utf-16le")
    out["root_subkey_count"] = struct.unpack_from("<I", data, nk + 0x14)[0]
    out["root_value_count"] = struct.unpack_from("<I", data, nk + 0x24)[0]

the field id d25-registry-001-registry-hive-root-name splits at its dNN-<family>-NNN stem (day 23's rule) into the property registry-hive-root-name. the record guesser sets aside the words that name the family (registry, hive) and looks for a record field whose words are all among the rest, root and name. root_key_name has key as well, so it was not a candidate, and nothing else was either: the run failed with no registry-hive record field for 'registry-hive-root-name'.

the guesser now has a second tier for exactly this case. when no field fits inside the property's words, it takes the one field that holds every remaining property word and has at most one word more, provided the property has at least two words of its own; two fields at the same distance are a failure, never a pick. the reader inventory, which matches any reader's output keys against a field, has the same tier after its exact matches. both are described on the tooling pages linked above.

validation and answer formatting

the key node is read only when the root cell offset lands on an nk signature, and the name's encoding comes from the node's own flag rather than from a guess: a latin-1 name decoded as utf-16 comes out as cjk noise, and the reverse doubles every character with a zero. the answer is the name exactly as the node stores it, HuntressArtifactAssemblyLine for our hive, Ht0tPTUcpV0x7yydXVxmkNGkDiSi for the time trial's and CRde9GwEWypLZlsse, V8nw2pcGyDXfMFbsJ, QYqdXzi7VjAZyifpMf5oP8diL and six more for the mastery's nine sets.

the record also carries the base block's checksum and whether it matches the xor of the first 127 dwords. the single's matched; a hive edited by hand and not resealed would not, which is one way to find a planted hive.

failed approaches and pivots

the word-subset rule had held for every record family since day 14, and for a reason: a field that shares some words with a property but not all of them is usually a different field (lnk-network-share-name is not a shortcut's description just because both have a name). the rule's blind spot is the other direction, a property that names fewer words than our field. one extra word in our spelling is cheap to accept when it is the only candidate; more than one, or a tie, still fails loudly.

automation across modes

the time trial's 30 fields came from the same readers as every earlier day's properties, plus the hive record for the new one; they were solved in about 0.2 seconds. the mastery's nine sets of 30 took 1.38 seconds.

lessons

solve times

public scoreboard · day 25 finish: below top 10

  • 0:18.5single#8 of 161 solvers
  • 0:20.9time trial#5 of 158 solvers
  • 0:24.3mastery#5 of 157 solvers
  • #11team day finishof 138 teams that cleared it, in 6:15.3
  • #5single orderof the day's 8, 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 16.9s 2 0
time trial 0.7s 1 0
mastery 2.2s 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 50.0s 0.7s 49.3s
mastery 295.0s 2.2s 292.8s

where we got stuck

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

{generated by a clanker}