Tootsie Pop - H@cktivityCon CTF

Category: Scripting
Solves (at time of writing): 195
Description: How many licks does it take to get to the center of a tootsie pop?

Tootsie Pop

We are given a zip file.

Unzipping it gives us a gz file.

Unpacking that gives us a.... etc.. etc..

It's basically just many compression layers stacked on top of one another.

I instantly had an Idea for a script.

The 7z x command can extract almost everything, so I dont have to switch between unpackers.

Then extract the first one, put it in the folder 1, extract everything from folder 1 and put it in folder 2 etc.. etc...

So this is the finished script:


!#/bin/bash
i=1
7z x pop.zip -o1
for (( ; ; ))
do
7z x $i/* -o$(($i+1))
if [ $? -ne 0 ]
then
exit
fi
i=$(($i+1))
done
    

Running it gives us 1547 folders, and in the 1547 folder the flag!

~sw1tchbl4d3, 03/08/2020 (dd/mm/yyyy)