Some writeup about bandit range...
本文最后更新于:1 年前
Level 0
- 连接
Level 0 ➡Level 1
- 先使用
ls
指令查看目录,再cat
打开readme
文件
Level 1 ➡Level 2
- 这里先查看当下目录,只有
-
文件,而如果直接使用cat -
会涉及指令选项的歧义,因此使用cat ./-
./
相对路径的当前路径
Level 2 ➡Level 3
- 同样是先查看,就是通关提示
spaces in this filename
文件,而直接cat
+文件名则意味着打开4个文件,因此这里使用cat
+Tab
直接自动补齐文件名。 - 这里Tab可直接用,原因是只有一个文件;若多个文件则需输入开头几个字母即可,懒人必会!!
Level 3 ➡Level 4
The password for the next level is stored in a hidden file in the inhere directory.
- 首先在
inhere
内的隐藏文件,使用cd inhere
切换至inhere
目录下,ls -la
列出文件目录,
cat .hidden
打开查看密码
Level 4 ➡Level 5
- 同上一关到查看目录,发现很多文件,这时通过
file
查看文件类型,找出密码
Level 5➡Level 6
1 |
|
- 使用
find
命令查找1033字节的文件
-type f:指定普通文件
-size 1033c:指定为1033字节
附find参数解析
-size n[cwbkMG] : 档案大小 为 n 个由后缀决定的数据块。其中后缀含义为:
b: 代表 512 位元组的区块(如果用户没有指定后缀,则默认为 b)
c: 表示字节数
k: 表示 kilo bytes (1024字节)
w: 字 (2字节)
M:兆字节(1048576字节)
G: 千兆字节 (1073741824字节)
-type c : 档案类型是 c 。
d: 目录
c: 字型装置档案
b: 区块装置档案
p: 具名贮列
f: 一般档案
l: 符号连结
s: socket
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
-user:指定user组
-group: 指定group组
-size:指定大小
后面的2>/dev/null,是因为find命令在根目录下查找会经常有一些权限的报错信息所以通常使用这种方式将错误信息重定位。
Level 7 ➡Level 8
The password for the next level is stored in the file data.txt next to the word millionth
- 当前目录下确实是
data.txt
,但直接用cat
打开无法确定flag,使用| grep
管道筛选关键词millionth
Level 8➡Level 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
- 本题flag只出现一行,使用
uniq -u
直接获取或uniq -c
列出次数找到出现一次的line
Level 9➡Level 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.
- password是以若干个‘=’开头,使用
strings
命令查看文件字符串
Level 10➡Level 11
The password for the next level is stored in the file data.txt, which contains base64 encoded data
- 使用
base64
解码,base64 -d data.txt
Level 11➡Level 12
The password for the next level is stored in the file data.txt, where all lowercase (a-z) and uppercase (A-Z) letters have been rotated by 13 positions
- 本题为字符转换,a-z以及A-Z被后移了13个位置,即对应n-z a-m N-Z A-M.
使用tr
配合管道转换得到password
Level * ➡Level * +1
···
···
···
本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!