Bandit系列
目录
OverTheWire: Wargameshttps://overthewire.org/wargames/
靶场地址:
OverTheWire: Wargames
https://overthewire.org/wargames/
level 0--level 1
这关直接给出登录名和密码,直接连接即可
ssh -p 2220 bandit0@bandit.labs.overthewire.org
登录成功后,有一个readme文件,cat一下,得出密码,用作下一关的ssh登录密码
level 1--level 2
利用上一关得到的密码登录ssh
ssh -p 2220 bandit1@bandit.labs.overthewire.org
ls一下,发现文件名叫- ,在linux中-有特殊意义,所以直接cat不出来,ctrl+c一下
用./表明是在当前路径下,再cat,密码就出来了
level 2--level 3
利用上一关获取的密码登录ssh
这次文件名中有空格,可以利用双引号把文件名括起来
level 3--level 4
这关是隐藏文件,在linux中,文件名前有点.就是隐藏文件可用ls -a来显示
可用ls -a来显示
level 4--level 5
Level Goal
The password for the next level is stored in the only human-readable file in the inhere directory. Tip: if your terminal is messed up, try the “reset” command.
这关题目说密码是存在人类可读的文件当中,所以需要判断文件的类型,用file 命令
file ./* //匹配当前路径下的所有文件
只有-file07为可读的ASCII text类型,所以就是它了
level 5--level 6
The password for the next level is stored in a file somewhere under the inhere directory and has all of the following properties:
- human-readable
- 1033 bytes in size
- not executable
这关同样是找文件,文件过多,一个个找不太现实,根据题目要求:人类可读、1033字节、非可执行文件,可以用find命令匹配
find . -type f -size 1033c
//
-type f
指定为普通文件,-size 1033c
指定为1033字节
找到文件,直接cat查看
level 6--level 7
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
下一级的密码存储在 服务器,并具有以下所有属性:
- 用户 Bandit7 所有
- 由 Group Bandit6 拥有
- 大小为 33 字节
这题还是找文件,所以可以用find命令
用-user指定用户,-group指定群组,-size指定大小,2>/dev/null因为find命令在根目录下查找会经常有很多权限的报错信息,所有在linux中通常用这种方式将错误信息重定向到“黑洞中”
find / -user bandit7 -group bandit6 -size 33c 2>/dev/null
level 7--level 8
Level Goal
The password for the next level is stored in the file data.txt next to the word millionth
Commands you may need to solve this level
man, grep, sort, uniq, strings, base64, tr, tar, gzip, bzip2, xxd
这关密码存在data.txt文件中,密码跟在单词millionth后面,所以用grep匹配单词
cat data.txt|grep millionth
level 8--level 9
关卡目标
下一级的密码存储在文件数据中.txt并且是唯一只出现一次的文本行
解决此级别可能需要的命令
grep, sort, uniq, strings, base64, tr, tar, gzip, bzip2, xxd
找到只出现一次的那一行,那就是用uniq命令了,但是使用之前需要先用sort命令对文本进行排序,因为uniq命令是通过对比上下两行是否一样来判断的,所以先sort再uniq,-u是直接获取
level 9--level 10
关卡目标
下一级的密码存储在文件数据中.txt存储在为数不多的人类可读字符串之一中,前面有几个“=” 字符。
解决此级别可能需要的命令
grep, sort, uniq, strings, base64, tr, tar, gzip, bzip2, xxd
直接cat data.txt会出现一堆乱码,所以用strings命令,获取可读字符