Bandit Level 12 → Level 13
Level Goal
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. 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!)
Level Answer
1. mkdir [DIRECTORY]
$ mkdir /tmp/mydir
2. cp [SOURCE] [DIRECTORY]
$ cp data.txt /tmp/mydir
3. cd [DIRECTORY]
$ cd /tmp/mydir
4. xxd [-r] [infile] [outfile]
- [-r] reverse operation: convert hexdump into binary.
/tmp/mydir$ xxd -r data.txt data2
5. file [FILE]
/tmp/mydir$ file data2
data2: gzip compressed data, was "data2.bin", last modified: Thu Dec 28 13:34:36 2017, max compression, from Unix
6. mv [SOURCE] [DEST]
/tmp/mydir$ mv data2 data2.gz
7. gzip [-d] [FILE]
- [-d] Decompress.
/tmp/mydir$ gzip -d data2.gz
8. file [FILE]
/tmp/mydir$ file data2
data2: bzip2 compressed data, block size = 900k
9. mv [SOURCE] [DEST]
/tmp/mydir$ mv data2 data2.bz
10. bzip2 [-d] [FILE]
- [-d] Force decompression.
/tmp/mydir$ bzip2 -d data2.bz
11. file [FILE]
/tmp/mydir$ file data2
data2: gzip compressed data, was "data4.bin", last modified: Thu Dec 28 13:34:36 2017, max compression, from Unix
12. mv [SOURCE] [DEST]
/tmp/mydir$ mv data2 data2.gz
13. gzip [-d] [FILE]
- [-d] Decompress.
/tmp/mydir$ gzip -d data2.gz
14. file [FILE]
/tmp/mydir$ file data2
data2: POSIX tar archive (GNU)
15. tar [-xvf] [FILE]
- [-x] extract files from an archive
- [-v] verbosely list files processed
- [-f ARCHIVE] use archive file or device ARCHIVE
/tmp/mydir$ tar -xvf data2
data5.bin
16. file [FILE]
/tmp/mydir$ file data5.bin
data5.bin: POSIX tar archive (GNU)
17. tar [-xvf] [FILE]
- [-x] extract files from an archive
- [-v] verbosely list files processed
- [-f ARCHIVE] use archive file or device ARCHIVE
/tmp/mydir$ tar -xvf data5.bin
data6.bin
18. file [FILE]
/tmp/mydir$ file data6.bin
data6.bin: bzip2 compressed data, block size = 900k)
19. mv [SOURCE] [DEST]
/tmp/mydir$ mv data6.bin data6.bin.bz
20. bzip2 [-d] [FILE]
- [-d] Force decompression.
/tmp/mydir$ bzip2 -d data6.bin.bz
21. file [FILE]
/tmp/mydir$ file data6.bin
data6.bin: POSIX tar archive (GNU)
22. tar [-xvf] [FILE]
- [-x] extract files from an archive
- [-v] verbosely list files processed
- [-f ARCHIVE] use archive file or device ARCHIVE
/tmp/mydir$ tar -xvf data6.bin
data8.bin
23. file [FILE]
/tmp/mydir$ file data8.bin
data8.bin: gzip compressed data, was "data9.bin", last modified: Thu Dec 28 13:34:36 2017, max compression, from Unix
24. mv [SOURCE] [DEST]
/tmp/mydir$ mv data8.bin data8.bin.gz
25. gzip [-d] [FILE]
- [-d] Decompress.
/tmp/mydir$ gzip -d data8.bin.gz
26 . file [FILE]
/tmp/mydir$ file data8.bin
data8.bin: ASCII text
27 . cat [FILE]
/tmp/mydir$ cat data8.bin
The password is 8ZjyCRiBWFYkneahHwxCv3wb2a1ORpYL
28. ssh [-p port] [user@]hostname
- [-p port] Port to connect to on the remote host.
$ ssh -p 2220 [email protected]
Level Password
8ZjyCRiBWFYkneahHwxCv3wb2a1ORpYL