event horizon: an event log's record count, and a member the question could not name
huntress ctf 2026, day 24 · metadata forensics · all three modes
tools used: archive and metadata readers and timed-attempt pipeline.
"windows event logs from several hosts have been duplicated, truncated, and bundled with reports. count records accurately and find the selectively shortened timeline." the day's new family was the windows event log (.evtx), and its first property was the number of records in the log.
the key insight: the record count was the easy part. the file header states it, a walk of the records confirms it, and our event-log record had read both since day 14. the time was lost on a question about a different member: "what is the exact filename of the roster?", whose answer is a member's name, so the question cannot name the member it is about.
challenge shape
single 1 field evtx.record_count of one event log
time trial 29 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 232 fields the same over eight sets
artifact anatomy
an evtx file is a 4096-byte header block followed by 64 kib chunks. the header's first 128 bytes:
offset size field
0 8 "ElfFile\0"
8 8 first chunk number
16 8 last chunk number
24 8 next record identifier
32 4 header size (128)
36 2 minor format version
38 2 major format version (3)
40 2 header block size (4096)
42 2 number of chunks
120 4 file flags (dirty, full)
124 4 crc-32 of the first 120 bytes
each chunk starts with its own ElfChnk\0 header (first and last record numbers, offsets, checksums) and holds records: the magic 2a 2a 00 00, the record's size, its identifier, a filetime timestamp, the event as binary xml, and the size again so the chunk can be walked backwards.
the single's event log was the header block and one chunk, nothing more. that arithmetic is also the prompt's "truncated" test: a complete log is 4096 + chunks * 65536 bytes long, so a copy cut short is shorter than its own header says. every log we received was complete.
extraction method
the event-log record reads the header and answers the count as the next record identifier minus one: a log that has never wrapped numbers its records from 1, so the identifier the next event would get is one past the count. a log that has overwritten its oldest records does not start at 1, which is why the same reader also walks the chunks with python-evtx and counts the events it parses: a second, independent reading.
first, last, next_id, hsize, minor, major, block, chunks = struct.unpack_from(
"<QQQIHHHH", data, 8
)
record = {
"record_count": max(0, next_id - 1),
"chunk_count": chunks,
"expected_size_bytes": 4096 + chunks * 65536,
}
record["event_count"] = len(walk_records(data))
the field id d24-evtx-001-evtx-record-count splits at its dNN-<family>-NNN stem (day 23's rule), and evtx-record-count reaches the record's record_count by its words.
one reading that looks natural is wrong here: counting distinct EventRecordID values from the records' xml. in every log of the timed modes those values took only two distinct values, however many records the log held, so they identify nothing; the header and the walk agreed in every set.
the member the question could not name
the time trial's roster-filename asked "what is the exact filename of the roster?" with the artifact given as the bundle alone. every other member question names its member in the artifact line (evidence.zip -> <member>), and a sibling, roster-sha1, did; a filename question cannot, because the name is the answer.
our member resolver tried, in order: the question's artifact, a member whose stem is exactly the field's stem, the stem's trailing number as a whole token, the sole member. the roster was roster- plus six hex digits and .csv, so the exact stem roster matched nothing and the run raised no member for 'roster'. after the exact stem the resolver now takes the member whose leading name tokens are the stem's tokens; when several members qualify, an ordinal word in the question picks one in sorted order. the leading-token match prefers the members with the fewest tokens, so evidence-note-<hex> is the evidence note and evidence-note-copy-<hex> its renamed copy.
def tokens(name):
return [t for t in re.split(r"[-_]+", name.split(".")[0].lower()) if t]
def led_by(name, stem):
want, have = tokens(stem), tokens(name)
return bool(want) and len(have) > len(want) and have[: len(want)] == want
led = sorted((n, b) for n, b in members.items() if led_by(n, stem))
if led:
nearest = min(len(tokens(n)) for n, _ in led)
led = [(n, b) for n, b in led if len(tokens(n)) == nearest]
if len(led) == 1:
return led[0]
nth = ordinal(question) # "first" -> 0, "second" -> 1, "last" -> -1
if led and nth is not None and -len(led) <= nth < len(led):
return led[nth]
validation and answer formatting
the count is a base-10 integer, 3 for the single, 74 for the time trial and 57, 107, 119 and five more for the mastery's eight sets. the record carries both readings, the header's arithmetic and the number of records the walk parses; the answer is the header's, and in every set the walk gave the same number. the two are worth comparing on the family's next questions: a log whose header claims more records than its chunks hold is a truncated or doctored copy, and there the walk is the one to trust.
the filename answer is the member's base name with its extension, as the question's syntax asks; the resolver returns the name exactly as stored in the archive.
failed approaches and pivots
the resolver's exact-stem rule had always been enough: earlier filename questions either named the member or used a member whose stem was the field's stem. on day 24 every member the generic questions asked about carried a hex suffix after its stem (the evidence note, its copy and the roster), and the roster was the first such member that a filename question asked about. the sibling's artifact line would also have named it, but a resolver that depends on another question being asked is fragile; the stem's leading tokens are always present.
automation across modes
the record reader answers the count in every set; the earlier days' properties come from their own readers. the mastery's eight sets of 29 fields each were solved in about 1.3 seconds.
lessons
- a question whose answer is a name cannot name its member; resolve the member from the field's own stem, by its leading tokens when the stored name carries a suffix.
- count a log two ways (header arithmetic and a record walk): the prompt's duplicated and truncated copies are exactly the cases where one reading alone is wrong.
- an identifier field that repeats is not an identifier; check that a value you plan to count by is unique before you count by it.
solve times
public scoreboard · day 24 finish: top 3
- 0:03.4singlefirst blood, +0.72 s
- 1:01.4time trial#10 of 161 solvers
- 1:04.8mastery#6 of 159 solvers
- #3team day finishof 139 teams that cleared it, in 3:47.1
- #2single 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.
| mode | work to flag | attempts | wrong submits |
|---|---|---|---|
| single | 0.9s | 1 | 0 |
| time trial | 56.2s | 3 | 0 |
| mastery | 2.4s | 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 | 265.0s | 2.4s | 262.6s |
the time trial's winning attempt is its second: both runs on the first attempt crashed on the filename field, and that attempt's clock ran out while the resolver was fixed.
where we got stuck
- time trial: two runs crashed on
roster-filenamewith no member for the stem; the other 28 fields answered. the failure report listed the bundle's members but not what the field asked, so part of the next minute went to finding the question; the fix itself was a few lines. about 55 seconds from the first crash to the corrected run, which answered all 29 fields on fresh bytes in 0.8 seconds. failure reports now carry each crashing field's question (see the solver pipeline).
flags: single, time trial, and mastery [redacted].
{generated by a clanker}