OverTheWire的WarGame对于想学习Linux和攻防的人来说是一款好游戏,可以通过不断地通关获得一些工具的使用心得。本文旨在记录通关的思路和部分知识要点,官网的密码会定期修改,故本文只能为后来人提供一点点思路。
 
OverTheWire官网

Bandit Level 0

Level Goal

The goal of this level is for you to log into the game using SSH. The host to which you need to connect is bandit.labs.overthewire.org, on port 2220. The username is bandit0 and the password is bandit0. Once logged in, go to the Level 1 page to find out how to beat Level 1.
第零关,只需要使用SSH命令,利用提供的地址bandit.labs.overthewire.org、用户名bandit0、密码bandit0,登录即可
ssh bandit0@bandit.labs.overthewire.org -p 2220

Bandit Level 0 → Level 1

Level Goal

The password for the next level is stored in a file called readme located in the home directory. Use this password to log into bandit1 using SSH. Whenever you find a password for a level, use SSH (on port 2220) to log into that level and continue the game.
第一关,在服务器内找到readme文件,使用cat、less、more、tail等命令查看文件内容。获得密码ZjLjTmM6FvvyRnrb2rfNWOZOTa6ip5If
 
 

Bandit Level 1 → Level 2

Level Goal

The password for the next level is stored in a file called - located in the home directory
第二关,主要涉及查看文件的命令,查看名为-的文件(先利用上一关的密码通过ssh命令登录到第二关的服务器,往后的关卡均需要重新登录),-和root根目录名相同,需使用绝对路径查看。获得密码263JGJPfgU6LtdEvgfWU1XP5yac29mFx
 
 

Bandit Level 2 → Level 3

Level Goal

The password for the next level is stored in a file called spaces in this filename located in the home directory
第三关,文件名中含有空格,需利用转义字符\。获得密码MNk8KNH3Usiio41PRUEoDFPqfxLPlSmx
 
 

Bandit Level 3 → Level 4

Level Goal

The password for the next level is stored in a hidden file in the inhere directory.
第四关,中含有密码内容的文件放在隐藏目录下,利用ll命令即可查看隐藏目录和隐藏文件。ll命令是ls -l,并不是一个基础命令,本地Linux要使用ll命令则需要配置。获得密码2WmrDFRmJIq3IPxneAaMGhap0pFhF3NJ
 
 

Bandit 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.
第五关,中文件编码仅有一个为ASCII码,利用file命令。获得密码4oQYVPkxZOOEOO5pTW81FB8j8lxXGUQw
 
 

Bandit Level 5 → Level 6

Level Goal

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命令搜索。获得密码HWasnPhtq9AVKe0dmk45nxy20cvUa6EG
 

Bandit Level 6 → Level 7

Level Goal

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
第七关,同样需要检索文件,find命令用于在指定目录下查找文件和目录,可以使用不同的选项来过滤和限制查找的结果。在搜索结果中找出密码文件,获得密码morbNTDkSW6jIlUc0ymOdMaLnOlFVAaj
 
 
 

Bandit Level 7 → Level 8

Level Goal

The password for the next level is stored in the file data.txt next to the word millionth
第八关,data.txt文件中密码繁多,真正的密码在单词millionth之后,使用grep命令,grep命令用于查找文件里符合条件的字符串或正则表达式。获得密码dfwvzFQi4mU0wfNbFOe9RoWskMLg7eEc
 
 

Bandit Level 8 → Level 9

Level Goal

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和uniq命令,获得密码dfwvzFQi4mU0wfNbFOe9RoWskMLg7eEc
 
 

Bandit Level 9 → Level 10

Level Goal

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.
第十关中的密码在一长串“=”之后,利用strings命令过滤human-readable strings,获得密码FGUW5ilLVJrxX9kMYMmlN4MgbpfMiqey