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

Goal: 1000 CNY · Raised: 1020 CNY

100%

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.
Readme
# CVE-2021-4034
 
This is an exploit created for CVE-2021-4034 meant as a POC. It is based off the info at [https://www.qualys.com/2022/01/25/cve-2021-4034/pwnkit.txt](https://www.qualys.com/2022/01/25/cve-2021-4034/pwnkit.txt).


### How to use it:
- Download the exploit folder. Compile prog.c with `gcc prog.c`
- Go to the GCONV_PATH=. folder and ensure that the "code" file is executable (chmod +x code).
- Go to the "code" folder and compile payload.c with `gcc payload.c -o payload.so -shared -fPIC`
- Note: You'll probably want to change "YOUR_USERNAME" in payload.c if you actually want to see if it works.
- After all of this is set, go back to the main folder, and run the program with `./a.out`.
Note: You can rename this file, a.out is simply the default name from GCC.
File Snapshot

[4.0K] /data/pocs/303a32cbbe8b9271427066491531a9c83675cd5c ├── [4.0K] exploit │   ├── [4.0K] code │   │   ├── [ 68] gconv-modules │   │   └── [ 166] payload.c │   ├── [4.0K] GCONV_PATH=. │   │   └── [ 104] code │   └── [ 233] prog.c └── [ 781] README.md 3 directories, 5 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 →