第1关直接ssh连接,获得密码NH2SXQwcBdpmTEzi3bvBHMM9H66vVXjL,用这个密码连接第2关
第2关,连接之后查看

存在特殊字符的文件

因为使用 - 作为参数是指 STDIN/STDOUT 即 dev/stdin 或 dev/stdout 。所以如果你想打开这种类型的文件,你必须指定文件的完整位置,例如作为 ./- 。例如。 ,如果您想查看该文件中的内容,请使用 cat ./-
获得密码:rRGizSaX8Mk1RTb1CNQoXTcYZWU6lgzi,使用该密码连接第3关

发现存在空格文件名,引号引起来就行

获得密码:aBZ0W5EmUfAf7kHTQeOwd8bauFJ2lAiG,连接第4关

这一关用ls -al命令查看隐藏文件,然后打开就行,获得密码:2EW7BBsr6aMMoJ2HjW067dm8EgX26xNe,连接第5关
第5关是这样的

文件一个个打开,在第8个文件

获得密码:lrIWWI6bB37kxfiCQZqUdOIYfr6eEeqR,连接第6关

可以看到有很多的文件夹,根据题目的提示该文件是个1033字节大小的文件

这里使用到命令find -type f -size 1033c ! -executable
find
命令是在Unix和类Unix系统中用于搜索文件和目录的强大工具。以下是一些常用的find
命令选项:
-
路径和条件:
-name pattern
: 根据文件名进行搜索,可以使用通配符。-iname pattern
: 类似于-name
,但是不区分大小写。-path pattern
: 根据完整路径进行搜索,可以使用通配符。
-
类型判定:
-type type
: 根据文件类型进行搜索,其中type
可以是f
(普通文件)、d
(目录)、l
(符号链接)等。
-
时间相关:
-mtime n
: 根据文件修改时间进行搜索,n
表示天数。-atime n
: 根据文件访问时间进行搜索。-ctime n
: 根据文件状态改变时间进行搜索。
-
大小相关:
-size n
: 根据文件大小进行搜索,n
可以是正数(大于n),负数(小于n),或者零(等于n)。
-
执行操作:
-exec command {} \;
: 对每个找到的文件执行指定的命令。-exec command {} +
: 类似于\;
,但多个文件一次性传递给一次命令。
-
逻辑操作:
-and
,-or
,-not
: 用于组合多个条件。
! -executable是排除可执行文件的意思
获得密码:P4L4vucdmLnm8I7Vl7jG1ApGSfjYKqJU,连接第7关
第7关也是查找命令的运用,使用find . -group bandit6 -user bandit7进行查找,因为题目提示了
The password for the next level is stored somewhere on the server and has all of the following properties:
- owned by user bandit7
- owned by group bandit6
- 33 bytes in size

然后打开该文件就行,获得密码:z7WtoNQU2XfjmMtWA8u5rN4vzqu4v99S,连接第8关

连接后有一个data.txt文件,打开后是一堆数据,题目有提示:The password for the next level is stored in the file data.txt next to the word millionth

直接用grep搜索即可得到密码:TESKZC0XvTetK0S9xNwm25STk5iWrBvP,连接第9关
题目提示为:The password for the next level is stored in the file data.txt and is the only line of text that occurs only once (下一级的密码存储在文件data.txt中 ,并且是唯一只出现一次的文本行)

这里使用了命令:sort data.txt |uniq -c
sort命令:这会按字母顺序对文件 filename 的内容进行排序,并将结果输出到标准输出。
uniq命令:uniq filename 这会从文件 filename 中删除相邻的重复行,只保留一个副本。 计算重复行的数量
uniq -c filename 使用 -c 选项,uniq 会显示每行在输入文件中出现的次数。
可获得密码:EN632PlfYiZbn3PhVK3XOGSlNInNE00t,连接第10关
第10关提示:The password for the next level is stored in the file data.txt in one of the few human-readable strings, preceded by several '=' characters.(下一级的密码存储在文件data.txt中,位于少数几个人类可读的字符串之一中,以几个"="字符开头。)
我们先来试着cat一下这个文件

发现是一堆乱码,这里可以用strings命令查找可以读的字符串

得到密码:G7w8LIi6J3kTb8A7j9LgrywtEUlyyp6s