CTF Micro Storage

  1. The password
  2. Loop to extract
  3. Open the last zip file

The password

I have a zip file but I don’t have the password, I have to find it.

The password is the numbers in the next file, so the password for 37366 is 5900.
I can extract the password like this:

Loop to extract

I will create a loop too extract the file, because there is a .zip into a .zip, I can’t do it manualy.

#!/bin/bash
current_file="37366.zip"
while true;
do
	password=$(strings $current_file |tail -1 | cut -d '.' -f1)
	unzip -P $password $current_file
	current_file=$password".zip"
	echo "$current_file" >> track.txt
done

In the file track.txt I have the list of the names of the files, I’m using this file to know wish file is the last one.
The last file is 6969.zip and there is a file called DoNotTouch.zip.
I don’t have the password for this one, I have to crack it.
I have to put rockyou in my directory.

fcrackzip -u -D -p rockyou.txt 6969.zip

Output:

PASSWORD FOUND!!!!: pw == letmeinplease

Open the last zip file

unzip -P letmeinplease 6969.zip

Now we have the file DoNotTouch.

file DoNotTouch

Output:

DoNotTouch: SQLite 3.x database, last written using SQLite version 3021000, page size 1024, file counter 26, database pages 864, cookie 0x22, schema 1, UTF-8, version-valid-for 26

SQL file, I will use strings :).

strings DoNotTouch|grep HTB

Output:

1969-01-01 00:00:002069-01-01 00:00:00Chillin with SatanHellHTB{z1p_and_unz1p_ma_bruddahs}