Some writeup about bandit range...

本文最后更新于:1 年前

Level 0

  • 连接

BahJeg.pngBahYwQ.png

Level 0 ➡Level 1

  • 先使用ls指令查看目录,再cat打开readme文件

Bahtoj.png


Level 1 ➡Level 2

  • 这里先查看当下目录,只有-文件,而如果直接使用cat -会涉及指令选项的歧义,因此使用cat ./-
    • ./相对路径的当前路径

BahUFs.png


Level 2 ➡Level 3

  • 同样是先查看,就是通关提示spaces in this filename文件,而直接cat+文件名则意味着打开4个文件,因此这里使用cat+Tab直接自动补齐文件名。
    • 这里Tab可直接用,原因是只有一个文件;若多个文件则需输入开头几个字母即可,懒人必会!!

BahdWq.png


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打开查看密码

BahBlV.pngBah0S0.png


Level 4 ➡Level 5

  • 同上一关到查看目录,发现很多文件,这时通过file查看文件类型,找出密码

BahDyT.png


Level 5➡Level 6

  • DMb9wF.md.png
1
find 路径 -type f -size 1033c
  • 使用find命令查找1033字节的文件

DMbCo4.md.png

-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

DMbFY9.md.png

-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

DMbkWR.png


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

DMbVQx.png

DMbES1.png


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命令查看文件字符串

DMbZy6.png

DMbeOK.png


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

DMbneO.png


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

DMbuwD.png

Level * ➡Level * +1

···

···

···


本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!