EASYCTF - Zipperoni
21 Feb 2018I’ve created a dastardly chain of zip files. Now you’ll never find my flag! The first file is begin.zip, with password coolkarni.
Based on the instruction we can unzip
begin.zip with coolkarni
and we have the following files:
- filename.txt : name of the next zip file
- hash.txt
- pattern.txt : pattern of the password for the next file.
The goal is quite clear, we have to unzip all the file and bruteforce the password based on the pattern.
The pattern wasn’t very understandable , at first I thought you had to guess the “_” when it fact this character was a part of the password.
Hint: You need to guess the password of the next zip file. However, the underscores in the pattern appear in the same positions as they do in the actual password, so you don’t need to guess them. For example, the first pattern is _0_0, which means that you need to guess the 3rd and 5th characters.
With this hint we can start cracking the passwords. Let’s start by generating our wordlist with mp64.
mp64 uses the following masks in order to generate a custom wordlist:
?l = abcdefghijklmnopqrstuvwxyz
?u = ABCDEFGHIJKLMNOPQRSTUVWXYZ
?d = 0123456789
?s = !"#$%&'()*+,-./:;<=>?@[\]^_{|}~
?a = ?l?u?d?s
?b = 0x00 - 0xff
With theses masks in mind we can parse the pattern to match our expectations, and then give the wordlists to fcrackzip
The final script took around 10min to find the passwords and extracts the 100 zip files.