Wargames — Bandit

Level 0

ssh -p 2220 bandit0@bandit.labs.overthewire.org

Level 0 → Level 1

cat readme

image

Level 1 → Level 2

cat ./-

image

输入cat - , - 会被当作参数前缀

Level 2 → Level 3

cat ./spaces in this filename

image

空格需要用转义字符形式" "表示。

或者可以利用Tab补全功能

Level 3 → Level 4

cd inhere
ls -a # -a 表示显示所有文件,包括隐藏文件
cat .hidden

image

Level 4 → Level 5

cd inhere
ls
file ./* # *代表匹配所有文件
cat ./-file07 # 只有-file07为可读的ASCII text类型

image

Level 5 → Level 6

cd inhere
find . -size 1033c ! -executable -exec file {} ;
cat ./maybehere07/.file2

image

Level 6 → Level 7

cd / # 回到服务器根目录
find . -user bandit7 -group bandit6 -size 33c 2>/dev/null
cat ./var/lib/dpkg/info/bandit7.password

image

find命令中2>/dev/null的作用是重定向“Permission denied”错误,使其不显示

Level 7 → Level 8

grep millionth data.txt # 在data.txt中查找包含"millionth"的行

image

Level 8 → Level 9

sort data.txt | uniq -u # 必须先排序再使用uniq,-u表示仅显示出一次的行

image

Level 9 → Level 10

strings data.txt | grep -E "=+" # 找出data.txt中包含“=”的可读字符串

image

可以根据密码长度做进一步筛选

strings data.txt | grep -E "=+.{20,}" # "="号后面至少有20个字符

image

未完待续。。。

内容来源于网络如有侵权请私信删除

文章来源: 博客园

原文链接: https://www.cnblogs.com/lmyybh/p/15038929.html

你还没有登录,请先登录注册
  • 还没有人评论,欢迎说说您的想法!