本文的通关方法并不是唯一的最好的方法,仅供参考。

OverTheWire: Bandit

点击上边的Bandit进入Bandit的wargame

LINUX命令搜索引擎

参考书籍:

Bandit Level 0

涉及命令:

ssh , cd , cat , ls

得密码:The password you are looking for is: ZjLjTmM6FvvyRnrb2rfNWOZOTa6ip5If

Bandit Level 1

涉及命令:

ssh , cd , cat  ls

得密码:263JGJPfgU6LtdEvgfWU1XP5yac29mFx

Bandit Level 2

访问带有空格的文件名,需要用转义字符\来转义空格,用cat获得密码

得密码:MNk8KNH3Usiio41PRUEoDFPqfxLPlSmx

Bandit Level 3

考验访问隐藏文件,先用cd进入文件夹,再用ls -a列出所有文件,之后用cat访问,

得密码:2WmrDFRmJIq3IPxneAaMGhap0pFhF3NJ

Bandit Level 4

ssh , cd , cat , ls ,file

知识点补充file命令 显示或忽略重复的行。

file语法:

file(选项)(参数)

选项

-b:列出辨识结果时,不显示文件名称;
-c:详细显示指令执行过程,便于排错或分析程序执行的情形;
-f<名称文件>:指定名称文件,其内容有一个或多个文件名称时,让file依序辨识这些文件,格式为每列一个文件名称;
-L:直接显示符号连接所指向的文件类别;
-m<魔法数字文件>:指定魔法数字文件;
-v:显示版本信息;
-z:尝试去解读压缩文件的内容。

按照提示使用file命令查看,只有一个文件是ASCII编码

得密码:4oQYVPkxZOOEOO5pTW81FB8j8lxXGUQw

Bandit Level 5

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

按照提示使用find命令,按照要求搜索

https://linux.loker.ltd/c/find.html

得密码:HWasnPhtq9AVKe0dmk45nxy20cvUa6EG