managed expectations: a module version id in a .net assembly's metadata tables
huntress ctf 2026, day 12 · metadata forensics · all three modes
tools used: archive and metadata toolkit, cross-lane field resolution and timed-attempt pipeline.
the prompt: "the .net assemblies share names, versions, and source ancestry, but their module identities remain distinct. separate rebuilds from renames." each delivery was a zip with one managed dll, and one question per set: the module version id, a guid the compiler writes into every module it builds.
the key insight: the mvid is not a header field and not an exiftool tag. it lives in the assembly's own metadata tables, one row of the Module table, stored as an index into the #GUID heap. our .net reader already parsed those tables for the binary lane; the metadata lane had no way to ask it, which is what cost us the minute. the guid's text form also depends on byte order: the heap stores the 16 bytes the way .net keeps a Guid in memory, with the first three groups little-endian.
challenge shape
single 1 field one zip, one managed dll
time trial 1 field one zip, one managed dll
mastery 2 fields one outer zip holding a zip per set, one dll in each
the field id is d12-dotnet-00N-dotnet-mvid-guid, the question asks for dotnet.mvid_guid, and the format is a pattern: "canonical guid text in 8-4-4-4-12 hexadecimal form, including hyphens".
every dll was a .net 8 assembly built deterministically: a debug directory of type 16 (reproducible build) and no codeview record, and a coff timestamp that is a hash, not a date. the assemblies shared their name pattern, version and attributes; the mvid was the one thing that differed per build.
artifact anatomy
a managed pe points to its metadata through the cli header (data directory 14). the metadata root starts with the signature BSJB, a runtime version string, and a list of streams:
#~ the compressed metadata tables
#Strings utf-8 names, indexed by offset
#US user strings (utf-16)
#GUID 16-byte guids, indexed by 1-based position
#Blob signatures and attribute values
the #~ stream opens with a header: a HeapSizes byte (bit 0x02 widens every #GUID index from 2 to 4 bytes), a 64-bit mask of the tables present, and one row count per present table. the rows follow, table by table, with column widths that depend on those counts and on HeapSizes. the Module table (0x00) always has exactly one row:
Generation u16
Name #Strings index
Mvid #GUID index the module version id
EncId #GUID index edit-and-continue, 0 here
EncBaseId #GUID index edit-and-continue, 0 here
extraction method
the reader walks the tables without a .net library: it locates the streams from the metadata root, computes every column width from the table schema (ecma-335 ii.22) and the row counts, and reads the Module row's third column. an index n names heap bytes 16 * (n - 1) to 16 * n:
def _guid(t: Tables, index: int) -> str:
if index == 0:
return ""
return str(uuid.UUID(bytes_le=t.guids[(index - 1) * 16 : index * 16]))
bytes_le is the point: .net's Guid.ToString() reads the first four bytes as a little-endian u32 and the next two pairs as little-endian u16s, and prints the last eight bytes in order. printing the heap bytes as one hex run gives a different, wrong guid with the same digits.
with a public library the same row is one line: dnfile (a python .net metadata parser on top of pefile) gives the canonical form directly, str(dnfile.dnPE(path).net.mdtables.Module.rows[0].Mvid).
since day 12 this reader answers the metadata lane by name: every module and assembly column, the assembly's string attributes and its references are available as dotnet-<name> properties through cross-lane field resolution.
validation and answer formatting
two checks decide the byte order without the grader. the guid compilers write for a deterministic build carries the version and variant bits of a random (version four) guid: in the right reading the 13th hex digit is the version digit and the 17th carries the rfc 4122 variant bits. read in heap order the version digit lands elsewhere. and an independent reading (the dnfile Module row above) agreed with ours on every delivery.
the answer is lowercase, hyphenated, without braces, as the syntax asks.
failed approaches and pivots
the property name dotnet-mvid-guid matched no metadata property, no raw header field and no exiftool tag, and the solver refused to guess, as it should. the value then came from decoding the Module row by hand while the reader that already parsed it sat in another part of the library. that gap is what cross-lane field resolution closes.
automation across modes
the same reader answered the single, the time trial and both mastery sets; mastery's zip of zips is resolved into one member list per set before any reader runs.
lessons
- a .net assembly's identity lives in its metadata tables, not in its headers: the mvid, the module and assembly names and the assembly version are table rows.
- a guid's text form is a byte-order decision. check the version and variant bits before trusting a reading.
- a parser written for one problem should be reachable by the name of what it reads, from every other problem.
solve times
public scoreboard · day 12 finish: 1st
- 1:03.7single#4 of 200 solvers
- 1:05.3time trial#2 of 192 solvers
- 1:06.5mastery#2 of 189 solvers
- #1team day finishof 166 teams that cleared it, in 1:06.5
- #5single 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 | 62.5s | 1 | 0 |
| time trial | 1.0s | 1 | 0 |
| mastery | 2.1s | 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 | 30.0s | 0.9s | 29.1s |
| mastery | 30.0s | 0.5s | 29.5s |
where we got stuck
- the single: about 38 seconds went to decoding the
Modulerow and the#GUIDheap by hand, because the property name reached no reader. the value was right the first time. - the first submission of that value then met the game master's rate limit and waited for the next clock minute, about 18 seconds more.
- the timed modes ran on the same reading in under a second each.
flags: single, time trial, and mastery [redacted].
{generated by a clanker}