Learn linux command by playing wargame. The Bandit wargame is aimed at absolute beginners. It will teach the basics needed to be able to play other wargames. Below is the solution of Level 12 → Level 13. Bandit In this post we will learn about various compression techniques and how to decompress file. We will learn how to convert binary to hex file and vice-versa. Previous Post Bandit Level 0 to Level 3 Bandit Level 4 to Level 8 Bandit Level 9 to Level 11 Level Goal The password for the next level is stored in the file , which is a hexdump of a file that has been repeatedly compressed. For this level it may be useful to create a directory under /tmp in which you can work using mkdir. For example: mkdir /tmp/myname123. Then copy the datafile using cp, and rename it using mv (read the manpages!) data.txt Commands you may need to solve this level grep, sort, uniq, strings, base64, tr, tar, gzip, bzip2, xxd, mkdir, cp, mv, file Solution : Command to connect remote host : password is ssh bandit12@bandit.labs.overthewire.org -p 2220 5Te8Y4drgCRfCx8ugdwuEX8KFC6k2EUu As mentioned in question make a new directory in /tmp and rename the file. program is used to make a hexdump or to do the reverse. Option convert hexdump into the binary. File is a hexdump and convert it into a binary file using command xxd -r myfile.txt myfile1.bin xxd -r myfile.txt > myfile1.bin Using command , we found that is a . file myfile1.bin myfile1.bin gzip compressed data is a program supplied with and is used to decompress . zcat gzip gzip compressed files zcat myfile1.bin > myfile2 Again using command on , we found that it is . file myfile2 bzip2 compressed data program is supplied with and is used to decompress . bzcat bzip2 bzip2 compressed files bzcat myfile2 > myfile3 is so use program to decompress it in . is a POSIX tar archive. myfile3 gzip compressed file zcat myfile4 myfile4 program is used for archiving file and options is used to extract an archive, is used to specify name of the tar archive and is used for more detailed listing. tar x f v tar -xvf myfile4 This command outputs file which is again a . Again use program on which outputs . is a and use program to decompress it to . data5.bin tar archive tar data5.bin data6.bin data6.bin bzip2 compressed file bzcat myfile7 is a and use program which outputs . is a and use to decompress it to file . myfile7 tar archive tar data8.bin data8.bin gzip compressed file zcat myfile9 contains and tells the password for the next level. myfile9 ASCII text cat myfile9 The password for the next level is . 8ZjyCRiBWFYkneahHwxCv3wb2a1ORpYL Reference : The Linux Command Line – A Complete Introduction https://linux.die.net/man/1/xxd Next Post Bandit Level 13 to Level 15 Bandit Level 16 to Level 18 Bandit Level 19 to Level 20 Bandit Level 21 to Level 22 Bandit Level 23 → Level 24 Bandit Level 24 → Level 25 Bandit Level 25 to Level 26 Bandit Level 27 to Level 31 Bandit Level 32 → Level 33 Originally posted at Programmercave .