where it all began: a disk image's partition starts
huntress ctf 2026, day 28 · metadata forensics · all three modes
tools used: archive and metadata readers and timed-attempt pipeline.
"disk images hold every previous artifact family in context. recover partition layouts, locate evidence by offset, and prove which image was rebuilt from an incomplete source." day 28 opened a new file family for the lane: a raw disk image inside the evidence zip, and one question about it, the sequence of its partitions' starting logical block addresses.
the key insight is that the question names one column of the guid partition table's entry array: disk.partition_start_lba_sequence is the first lba of every used entry, in entry order, as a compact json array. our readers had no disk family, so the first run failed with the image reported as an unrecognised binary. the read itself is two fixed structures and one loop, and on day 28 it became a disk record that answers any property of the layout by its words.
challenge shape
single 1 field the partition start lbas of disk-001.img, a json array
time trial 33 fields the disk field plus the evidence-note fields, the
cumulative properties of days 4-27 and a synthesis
digest order
mastery 396 fields the same 33 per set, over twelve sets
the field was d28-disk-001-disk-partition-start-lba-sequence, "determine disk.partition_start_lba_sequence for disk-001.img", answer kind json: "compact valid json array with exact values and order; no markdown or explanatory text".
artifact anatomy
the image is almost all zero, so it compresses to next to nothing inside the zip. it is laid out the way a partitioning tool writes a disk with a guid partition table:
lba 0 protective mbr: one partition record of the protective
type spanning the disk, the boot signature at the end
lba 1 header: "EFI PART", revision, header size, header crc32,
this header's lba, the backup header's lba, first and last
usable lba, disk guid, then at +72 the entry array's lba,
at +80 the entry count, at +84 the entry size, at +88 the
entry array's crc32
lba 2... the entry array: per entry the type guid (all zero = unused),
the unique guid, first lba at +32 and last lba at +40 (both
inclusive, u64 little-endian), attributes at +48, a utf-16le
name at +56
end of disk the backup entry array, then the backup header in the last
sector
across the day's disks the used entries were consecutive, one to six per disk, in ascending lba order, so entry order and lba order never disagreed on day 28.
extraction method
reading the column by hand is a short loop over the entry array:
def partition_starts(img: bytes) -> str:
sector = next(1 << n for n in range(9, 13) # 512 bytes to 4 kib
if img[1 << n : (1 << n) + 8] == b"EFI PART")
hdr = img[sector : 2 * sector]
entries_lba, count, size = struct.unpack_from("<QII", hdr, 72)
base = entries_lba * sector
starts = []
for i in range(count):
entry = img[base + i * size : base + (i + 1) * size]
if entry[:16] == bytes(16): # unused slot: zero type guid
continue
first, last = struct.unpack_from("<QQ", entry, 32)
starts.append(first)
return json.dumps(starts, separators=(",", ":"))
sgdisk -p disk-001.img or fdisk -l disk-001.img lists the same starts in sectors, one row per used entry.
the metadata readers now carry a disk record built the same way: for a guid partition table (sectors of 512 bytes up to 4 kib) and for an mbr-only disk, the partition sequences (start, end, size, type and unique guids, names, attributes), the disk guid, both crc32s and whether they verify, the usable range and the backup header. a question is answered from the record by its words, so disk-partition-start-lba-sequence names the record and its start column, and the next disk question needs no new code.
validation and answer formatting
the record reports, rather than enforces, what a damaged image would break: whether the mbr carries the protective type and its boot signature, the header crc32 (computed over the header size with the crc field zeroed) and whether it verifies, the entry array's crc32 over count times size bytes, and whether the backup header at the disk's end is valid and matches the primary. the answer is the question's own format, a compact json array of base-10 integers in entry order with no spaces, so a disk with one partition is still an array. [34] for the single's image, [47,101,108,143] for the time trial's and [184], [49,94,407,465,573], [164] and nine more for the mastery's twelve sets.
failed approaches and pivots
the first run treated the image as an unknown binary: no struct of the lane's header-field registry is named disk, no record reader claimed the bytes, and exiftool had nothing to say about a raw image. the sniffing was the root of it: an image whose second sector starts with EFI PART is a kind of its own, and on day 28 the sniffer learned it, together with header records for the container families most likely next (crash dumps, hibernation files, ntfs, fat, exfat, ext2 to ext4, qcow2, vmdk and ewf).
automation across modes
the timed modes read the disk field through the rule written for the single and every other field through the existing readers. the time trial's solve took 0.13 seconds, the mastery's twelve sets 1.65 seconds.
lessons
- a raw disk image is two fixed structures and an array: parse the partition table header and the entry array, never scan for bytes that look like a partition.
- a new family's first question is one column of its main structure; a reader that exposes the whole record answers the family's next days by their words.
solve times
public scoreboard · day 28 finish: below top 10
- 8:16.2single#73 of 153 solvers
- 8:28.6time trial#57 of 148 solvers
- 8:32.9mastery#53 of 148 solvers
- #49team day finishof 122 teams that cleared it, in 31:21.7
- #5single 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 attempt start to its flag (server times). attempts counts our solver runs; the single's second attempt was read by hand.
| mode | work to flag | attempts | wrong submits |
|---|---|---|---|
| single | 8m13.6s | 2 | 0 |
| time trial | 0.8s | 1 | 0 |
| mastery | 2.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 | 50.0s | 0.8s | 49.2s |
| mastery | 385.0s | 2.6s | 382.4s |
where we got stuck
- single, about eight minutes: the first run failed at release on the unrecognised image. the failure then sat for about seven and a half minutes before we picked it up, a slow start on our side rather than a parsing problem; once the entry array was read, the answer went in about thirty seconds later. the disk record now answers it on the first run.
- time trial, about eleven seconds: it started once the single's reading was saved in the solver.
flags: single, time trial, and mastery [redacted].
{generated by a clanker}