what's my name again: the original filename in a pe version resource
huntress ctf 2026, day 11 · metadata forensics · all three modes
tools used: archive and metadata toolkit and timed-attempt pipeline.
the prompt: "filenames have been randomized, but windows version resources remember what the binaries called themselves. recover the original identities and expose the impersonator." each delivery was a zip with one windows pe under a randomized name, and one question per set.
the key insight: the question was a single version-resource string, read by key. the day 10 reader already walked the resource tree to VS_VERSIONINFO and returned any StringFileInfo string by name, so OriginalFilename needed no new code. the "impersonator" was never asked, and nothing in the bytes played one.
challenge shape
single 1 field one zip, one pe
time trial 1 field one zip, one pe
mastery 2 fields one outer zip holding a zip per set, one pe in each
the field id is d09-pe-00N-pe-version-original-filename, the question names pe.version_original_filename, and the answer is exact text: "exact ordered artifact-derived text requested by the question". the d09-pe prefix is a family name, not a date: it marks the pe family that day 9 introduced, and day 11 kept it.
every pe was a go build for windows. each set's file name was randomized, so the delivered name could not answer the question.
artifact anatomy
the version resource sits in the resource directory (data directory 2) as type RT_VERSION (16), three levels deep: type, name, language. its data is a tree of nodes, each with the same header:
wLength u16 bytes in this node, children included
wValueLength u16 value size (words for text values)
wType u16 1 = text, 0 = binary
szKey utf-16le, nul-terminated
padding to a 4-byte boundary
value then the children, each 4-byte aligned
the root VS_VERSIONINFO carries a binary VS_FIXEDFILEINFO (signature 0xfeef04bd, the numeric file and product versions) and two children: StringFileInfo, with one string table per language and code page (here 040904b0, english and unicode), and VarFileInfo with the translations.
these builds carried five strings: CompanyName, FileVersion, OriginalFilename, ProductName and ProductVersion. no InternalName or FileDescription was present to disagree with them.
extraction method
the reader parses raw bytes, without a pe library: it maps the resource directory's rva to a file offset through the section table, walks the three levels to the RT_VERSION leaves, and then parses the node tree with explicit bounds on every length:
def _node(data: bytes, start: int, at: int, limit: int) -> _Node:
length = _u16(data, at)
value_length, type_ = _u16(data, at + 2), _u16(data, at + 4)
end = at + length
if length < 6 or end > limit:
raise ValueError(f"version node at 0x{at:x} length {length} overruns its parent")
pos = at + 6
while pos + 2 <= end and data[pos : pos + 2] != b"\x00\x00":
pos += 2
...
the property name maps to the string by its words: pe-version- plus a key in kebab case (original-filename) selects OriginalFilename from the string table. a key that is not present raises, and a name that matches no struct field and no string key raises too, so a missing string is never answered as an empty one.
with a public tool, exiftool -s -OriginalFileName telemetry-agent-NNN.exe reads the same string from the version resource.
validation and answer formatting
the reader cross-checks what it can. every string table is kept under its own language and code-page key (version strings are utf-16le whatever the key says), and when the asked name is found in more than one place (two string tables, or a FileVersion string and the fixed block's file version) with different values, it raises instead of picking one. here each OriginalFilename also agreed with its own build: the name each file called itself matched the cpu its coff header names in Machine, a different one per delivery.
the answer is the string verbatim, extension included, with no path and no case change.
failed approaches and pivots
none on the day. the one preparation that mattered was day 10's: the version resource reader was written for a pe-version-... question that had not been asked yet, with every string key reachable by name.
automation across modes
the same reader answered the single, the time trial, and both mastery sets. mastery delivered a zip of zips; the archive layer resolves nested archives into one member list per set before any reader runs.
lessons
- read the resource tree yourself when you need offsets or strict bounds: the node format is small, and every length can be checked against its parent.
- a property name that ends in a key name can be answered generically: map the kebab-case words to the version string's key.
- a story in the prompt is not a question. no field asked about the impersonator.
solve times
public scoreboard · day 11 finish: 1st
- 0:02.1single#2 of 204 solvers
- 0:04.3time trialfirst blood, +0.68 s
- 0:05.8masteryfirst blood, +0.98 s
- #1team day finishof 164 teams that cleared it, in 0:10.1
- #1single 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 when we started working on the mode to its flag.
| mode | work to flag | attempts | wrong submits |
|---|---|---|---|
| single | 1.8s | 1 | 0 |
| time trial | 2.1s | 1 | 0 |
| mastery | 1.5s | 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 | 7.0s | 1.0s | 6.0s |
| mastery | 7.0s | 0.6s | 6.4s |
where we got stuck
- nowhere. the field was one the reader already answered, and each mode took one attempt.
flags: single, time trial, and mastery [redacted].
{generated by a clanker}