All levels

Bandit · Level 12

Level 12

Login

SSH: ssh [email protected] -p 2220

Challenge URL: https://overthewire.org/wargames/bandit/bandit13.html

Task

The password for the next level is stored in the file data.txt, which is a hexdump of a file that has been repeatedly compressed.

Solution

Let's see the files present:

bandit12@bandit:~$ ls
data.txt

We have the hexdump in ASCII. Use mktemp -d and do all the changes in the tmp folder, since changes in the /home and /tmp folder aren't allowed.

To reverse the hexdump:

xxd -r filename.txt newfile

Use the file command to get the file signature, then use mv to rename to that extension.

ExtensionFormat
.gzgzip
.tartar
.bz2bzip2

To uncompress:

# gzip
gunzip filename
 
# tar
tar -xf archivename
 
# bzip2
bzip2 filename

Extra: Try to create a shell script for this.