Abno's blog

Bandit Level 12-13

This time, we are facing multiple layers of compression.

If we run file command, it seems as if the file was a normal text file. The problem is, that when we open it, we can see that it is a hexdump and does not look like an answer whatsoever.

First, we want to change it into whatever it was previously. To do so, we can use one of many commands listed on the wikipedia page suggested by overthewire.

The one I chose was xxd. Running it with the -r flag, will reverse the process.

Then, we want to know what kind of a file it is, so we can run the file command.

xxd -r data.txt | file - 

output:

/dev/stdin: gzip compressed data, was "data2.bin", last modified: Thu May 7 18:14:30 2020, max compression, from Unix

Then we have to unzip the gzip file, so we have to pipe it again.

xxd -r data.txt | zcat | file -

output:

/dev/stdin: bzip2 compressed data, block size = 900k

And so on... the fun continues.

In the end it will look like this:

zcat is for zip bzcat for bzip2 tar x0 for tarball, not really a compression but an archive folder

xxd -r data.txt | zcat | bzcat | zcat | tar xO | tar xO | bzcat | tar xO | zcat | file -

output: -/dev/stdin: ASCII text

Then, we can remove the file command to see the output.

output: The password is ---flag---