目录
0x00 准备
下载链接:https://download.vulnhub.com/dc/DC-5.zip
介绍:
As far as I am aware, there is only one exploitable entry point to get in (there is no SSH either). This particular entry point may be quite hard to identify, but it is there. You need to look for something a little out of the ordinary (something that changes with a refresh of a page). This will hopefully provide some kind of idea as to what the vulnerability might involve.
And just for the record, there is no phpmailer exploit involved. 😃
只有一个可利用的入口点可以进入(也没有 SSH)。这个特定的切入点可能很难识别,但它就在那里。你需要寻找一些不寻常的东西(随着页面的刷新而改变的东西)。这有望提供一些关于漏洞可能涉及的内容的想法。
仅供记录,不涉及 phpmailer 漏洞。😃
0x01 主机信息收集
执行命令:ifconfig
kali本机的ip:192.168.22.36,网卡eth0
发现目标主机ip:netdiscover -i eth0 -r 192.168.22.0/24
目标主机ip:192.168.22.37
探测目标主机开放端口:nmap -sS -sV -A -n 192.168.22.37
开放了80端口,使用的是nginx1.6.2;111端口,rpcbind服务。
0x02 站点信息收集
前面对这个环境的介绍有一句:随着页面的刷新而改变的东西。所以在浏览站点的时候要格外注意下刷新页面后变化的地方。
看一下站点的目录结构:dirsearch -u 192.168.22.37
这几个目录都是可以直接在页面上点击就可以访问到的,只有footer.php不可以。
访问一下这个目录:192.168.22.37/footer.php
后面在跟网站交互的时候可以多注意一下展示这个信息的地方。
访问站点,再contact页面下有个留言板提交,提交一下试一试。
发现每提交一次,这里的时间就会变一下,2017,2018,2019,2020循环。
综合上面的信息,留言板提交后的URL,可以猜测一下,thank.php中包含了footer.php文件。
php中常见的可以导致文件包含漏洞的函数:include(), include_once(), require(), re-quire_once(), fopen(), readfile()等。
下一步的思路就是去找thank.php的文件包含的参数。
0x03 漏洞查找与利用
1. 利用burpsuite爆破文件包含的参数
访问提交留言的页面,抓包,发送到Intruder模块,利用参数字典对参数进行爆破。
访问后抓包:
发送到Intruder模块,利用参数字典进行爆破,只选择一个参数:
payload这里导入保存的参数fuzz的字典:
对结果按照length进行排序,可以得到一个参数file。
就可以构造thank.php?file=/etc/passwd来读取文件。
2. 文件包含
多次访问: