The password for the next level is stored in the file data.txt and is the only line of text that occurs only once
解密
bandit8@bandit:~$ sort data.txt | uniq -u
UsvVyFSfZZWbi6wgC7dAFyFuR6jQQUhR
知识点
-
sort命令用于排序输入内容; -
uniq -u命令将连续输入内容去重;
This is a love story
The password for the next level is stored in the file data.txt and is the only line of text that occurs only once
bandit8@bandit:~$ sort data.txt | uniq -u
UsvVyFSfZZWbi6wgC7dAFyFuR6jQQUhR
sort命令用于排序输入内容;uniq -u命令将连续输入内容去重;The password for the next level is stored in the file data.txt next to the word millionth
bandit7@bandit:~$ cat data.txt | grep 'millionth'
millionth cvX2JJa4CFALtqS87jk27qwqGhBM9plV
没啥好说的,都是之前用过的命令。
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
bandit6@bandit:~$ find / -type f -size 33c -user bandit7 -group bandit6 2>&1 | grep -v denied | grep -v 'No such'
/var/lib/dpkg/info/bandit7.password
bandit6@bandit:~$ cat /var/lib/dpkg/info/bandit7.password
HKBPTKQnIay4Fw76bEy8PVxKEDQRKTzs
find命令-user指定文件所属用户find命令-group指定文件所属用户组2>&1重定向标准错误输出到标准输出grep -v用于去除匹配输出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
bandit5@bandit:~/inhere$ find . -type f -size 1033c ! -executable -exec file {} \;
./maybehere07/.file2: ASCII text, with very long lines
bandit5@bandit:~/inhere$ cat ./maybehere07/.file2
DXjZPULLxYr17uwoI01bNLQbtFemEgo7
find命令-size指定文件大小,字节用c后缀表示;find命令-executable用于标示可执行文件,前面加否定前缀!;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.
bandit4@bandit:~/inhere$ find . -type f -exec file {} \;
./-file09: data
./-file06: data
./-file01: data
./-file02: data
./-file05: data
./-file03: data
./-file08: data
./-file07: ASCII text
./-file04: data
./-file00: data
bandit4@bandit:~/inhere$ cat ./-file07
koReBOKuIDDepwhWk7jZC0RTdopnAYKh
find命令,-type获取文件,-exec将输出给到下一个命令,使用{}代表每一个输出,最后需要\;来结束file命令可以帮助你获取文件的基本信息The password for the next level is stored in a hidden file in the inhere directory.
ssh -p 2220 bandit3@bandit.labs.overthewire.org 密码 UmHadQclWmgdLOKQ3YNgjWxGoRMb5luKcd ./inhere/ 进入题中说的目录ls -a 查看当前的隐藏文件,发现.hiddencat .hidden 得到密码 pIwrPrtPN36QITSp3EQaw936yaFoFgAB考察了ls命令的-a参数,用户查看包含隐藏文件的所有当前目录内容
The password for the next level is stored in a file called spaces in this filename located in the home directory
ssh -p 2220 bandit2@bandit.labs.overthewire.org 密码 CV1DtqXWVFXTvM2F0k09SHz0YwRINYA9cat spaces\ in\ this\ filename 得到 UmHadQclWmgdLOKQ3YNgjWxGoRMb5luK这里考察了对于不可见字符的转义,如本次的space空格符,使用\来转义
The password for the next level is stored in a file called – located in the home directory
ssh -p 2220 bandit1@bandit.labs.overthewire.org 输入密码 boJ9jbbUNNfktd78OOpsqOltutMc3MY1cat ./- 得到 CV1DtqXWVFXTvM2F0k09SHz0YwRINYA9主要考察了-符号是linux许多命令中代表“从标准输入读取”。
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.
ssh -p 2220 bandit0@bandit.labs.overthewire.org,密码bandit0,登陆cat ~/readme 得到下一关密码 boJ9jbbUNNfktd78OOpsqOltutMc3MY1主要让我们使用了cat命令,查看文件内容。
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游戏服务器
ssh -p 2220 bandit0@bandit.labs.overthewire.org
密码:bandit0