Challenge
Category: metadata-forensics (GM id metadata-forensics-day-07-seven-zip-no-relation). Day 07.
Artifacts
A password-protected (AES) outer zip delivered by the GM, containing at least one inner zip (e.g. evidence-drop-001.zip (challenge artifact, not published), named per-attempt).
Investigation
Reconstructed from the saved scripts (scripts/peek.py, scripts/run.py, scripts/submit.py) - the title is the pun: despite the "Seven-Zip" name this has "no relation" to the actual 7-Zip program/format; it's an ordinary (AES-encrypted) ZIP, and the answer is a raw structural property of the archive's bytes, not anything extracted from its contents:
- The outer zip opens with the family's standard password
infected. - The inner zip named by the question text (regex
[\w\-]+\.zipagainst the question, or the recursively discovered inner zip if the name isn't explicit) is read as raw bytes - never actually extracted/decompressed for the answer. - Its End-Of-Central-Directory (EOCD) record is located by searching for the
PK\x05\x06signature from the end of the bytes, then unpacked as<4sHHHHIIHper the ZIP spec. The "total number of entries in the central directory" field (index 4 of that tuple) is the answer - i.e. how many files the inner zip's own metadata says it contains, read directly from its EOCD structure rather than by actually listing entries via a zip library. run.pygeneralizes this across multipleanswer_ids/nested inner zips by matching each question's text to the zip filename it references;submit.pyis the simplified single-answer version actually used to submit.
Flag Recovery
The answer is the EOCD "total entries" count (an integer) of the specific inner zip the question names, submitted as the same value for every answer_id (single inner zip in the final attempt).
Minimal Reproduction
python3 scripts/submit.py
Uses challenges/_lib/ctf_gm.py's GM()/solve_mode() for the GM round-trip; scripts/run.py is the more general multi-inner-zip version if a future variant needs it.
Lessons Learned
- Matches the established "metadata-forensics" family pattern (see
ctf-evidence-note-decoy-family/ docs/attack-vectors.md): the answer is a property of the assigned file's raw bytes/structure, not its decoded content - here specifically the ZIP container's own EOCD metadata, not anything inside the archive. - Reading the EOCD directly (search for
PK\x05\x06, unpack the fixed 22-byte structure) is more reliable than trusting a zip library's entry count when the archive may be deliberately malformed/truncated for the puzzle.
Time Trial and Mastery (added 2026-10-11, writeup reconciliation)
All three modes are CORRECT on the Game Master (state.json: modes_done single_solve, time_trial, mastery). What the solve notes recorded (kb/lessons.jsonl, metadata_bytes family): unzip the outer archive (password "infected"), then read the inner zip's end-of-central-directory record directly (struct "<4sHHHHIIH" at the last PK\x05\x06); the total-entries field is the answer. The Game Master wants answers as strings (an integer was refused as invalid_answers) and answered 429 under load (the client now backs off). The writeup's scripts/run.py is the general multi-inner-zip version of the same extraction. Not recorded at solve time: the per-mode details and wall-clock times of the timed variants beyond the above; the GM state confirms all three CORRECT.