$ cat writeup.md…
$ cat writeup.md…
broncoctf2026
Task: a mislabeled challenge.zip is actually a 1250-layer deep chain of recursively nested archives (gzip -> tar -> bzip2 -> password-protected 7z -> zip -> repeat). Solution: script 7z as a universal driver to list+extract each layer, deriving each 7z password from the first member's filename, filtering the tar @PaxHeader artifact, and recursing until flag.txt.
$ cat /etc/rate-limit
Rate limit reached (20 reads/hour per IP). Showing preview only — full content returns at the next hour roll-over.
"I was trying to compress my files and my script got a little carried away... Can you help me find my original file?"
Hint: the 7z files are password protected, and the password is the name of the first file inside.
Given a single challenge.zip downloaded from the CTFd instance. Goal: recover the original file (which holds the flag) from a runaway recursive compression chain.
Despite the .zip extension, file challenge.zip reports gzip-compressed data (was "layer1.tar"), so the extension is misleading — this is a matryoshka-style nested archive.
The chain cycles the same compression pattern once per "round", repeating for hundreds of rounds:
gzip (.tar.gz) -> tar (.tar) -> bzip2 (.bz2) -> 7z (password-protected AES) -> zip -> (back to gzip)
Two gotchas per round:
@PaxHeader: tar extraction emits an extra @PaxHeader pseudo-file that must be filtered so the "single next file" logic keeps working.layer290 contains layer292.zip, so its password is layer292.zip.7z handles gzip, bzip2, tar, zip and 7z transparently, so a single loop using 7z as a universal driver can walk every layer type.
Automate the traversal:
...
$ grep --similar