bandit solution(11-20)
Bandit Level 10 → Level 11
Level Goal
The password for the next level is stored in the file data.txt, which contains base64 encoded data
这一题非常的简单只需要简单的使用base64
解码即可
andit10@bandit:~$ ls
data.txt
bandit10@bandit:~$ cat data.txt
VGhlIHBhc3N3b3JkIGlzIElGdWt3S0dzRlc4TU9xM0lSRnFyeEUxaHhUTkViVVBSCg==
bandit10@bandit:~$ base64 -d data.txt
The password is IFukwKGsFW8MOq3IRFqrxE1hxTNEbUPR
直接下一关
Bandit Level 11 → Level 12
Level Goal
The password for the next level is stored in the file data.txt, where all lowercase (a-z) and uppercase (A-Z) letters have been rotated by 13 positions
这题的关键是理解划出部分,这是一种远古且又简单的加密方式,就是每个字母往后推x
位就是真正的含义,比如a
往后推13位代表的就是n
依此类推。
明确了这一点之后只需要了解tr
指令即可Linux tr命令 | 菜鸟教程
bandit11@bandit:~$ ls | cat
data.txt
bandit11@bandit:~$ cat data.txt
Gur cnffjbeq vf 5Gr8L4qetPEsPk8htqjhRK8XSP6x2RHh
bandit11@bandit:~$ cat data.txt | tr 'A-Za-z' 'N-ZA-Mn-za-m'
The password is 5Te8Y4drgCRfCx8ugdwuEX8KFC6k2EUu
搞定😋
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!)
这一关非常非常的麻烦,建议直接看wp😥
开始吧!根据提示copy了一份data.txt
bandit12@bandit:~$ pwd
/home/bandit12
bandit12@bandit:~$ mkdir /tmp/highway && cp data.txt /tmp/highway
bandit12@bandit:~$ cd /tmp/highway
bandit12@bandit:/tmp/highway$ cp data.txt /tmp/highway/mytest
andit12@bandit:/tmp/highway$ xxd -r data.txt > mytest
bandit12@bandit:/tmp/highway$ file mytest
mytest: gzip compressed data, was "data2.bin", last modified: Thu May 7 18:14:30 2020, max compression, from Unix
经过简单Google了解到要用gzip
来解压(该指令不单单是解压还能进行压缩)
Gzip Command in Linux tips:需要代理🌏
-d option : This option allows to decompress a file using the “gzip” command.
gzip -d mydoc.txt.gz
因为 gzip
需要一个 .gz
作为后缀名所以用 mv
改一下名字就行了。解压后后缀就会消失
andit12@bandit:/tmp/highway$ mv mytest mytest.gz
bandit12@bandit:/tmp/highway$ gzip -d mytest.gz
bandit12@bandit:/tmp/highway$ file mytest
mytest: bzip2 compressed data, block size = 900k
根据提示下一步需要用到 bzip2
那么我们继续Google一下咯😥
bzip2 command in Linux with Examples tips:需要代理🌏
-d : This option is used for decompression of compressed files.
bzip2 -d input.txt.bz2
故技重施
bandit12@bandit:/tmp/highway$ mv mytest mytest.bz2
bandit12@bandit:/tmp/highway$ bzip2 -d mytest.bz2 && file mytest
mytest: gzip compressed data, was "data4.bin", last modified: Thu May 7 18:14:30 2020, max compression, from Unix
emmmm🤪🤪🤪
bandit12@bandit:/tmp/highway$ mv mytest mytest.gz
bandit12@bandit:/tmp/highway$ gzip -d mytest.gz && file mytest
mytest: POSIX tar archive (GNU)
得到是一个tar
压缩目录,我们需要用tar
来解压缩
tar command in Linux with examples tips:需要代理🌏
-x : Extract the archive
<