Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2021-4034-pwnkit — PoC educacional do CVE-2021-4034, o PwnKit, LPE via pkexec do polkit. Uso autorizado apenas. | Kitploit
Tools/GitHubGitHub/mac3d0/cve-2021-4034-pwnkit
Privilege EscalationVulnerability AnalysisExploitationPenetration TestingLearning & EducationBinary Exploitation
GitHubmac3d0/cve-2021-4034-pwnkit

CVE-2021-4034-pwnkit

PoC educacional do CVE-2021-4034, o PwnKit, LPE via pkexec do polkit. Uso autorizado apenas.

View Repository
22 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2021-4034, PwnKit

Proof of concept for PwnKit, a local privilege escalation in polkit's pkexec. On a default install any unprivileged local user can become root.

About the bug

Vulnerable versions of pkexec mishandle the process argument count. That lets controlled environment variables get reintroduced into pkexec's environment, which ends up running an attacker controlled shared object as root. It was disclosed on 25 January 2022 by the Qualys Research Team and scores 7.8 high on CVSS v3.1. The NVD entry is CVE-2021-4034.

Practically every polkit release since 2009 was affected until the coordinated fix. Distributions shipped patched packages on or after the disclosure date, so keep your vendor updates current.

Why this repo exists

This is an educational reference for a well documented, publicly disclosed vulnerability. I use it to study the pkexec argument handling flaw, to validate patch status in authorized labs and assessments, and to keep detection and remediation notes.

Build and run

Only run this on systems you own or are authorized to test.

root@kitploit:~
gcc cve-2021-4034-poc.c -o cve-2021-4034-poc
./cve-2021-4034-poc

On a vulnerable host it drops you into a root shell. Verified against Debian 10 buster and CentOS 7.

Remediation

Patch polkit and pkexec to your distribution's fixed release. If you cannot patch right away, remove the SUID bit with chmod 0755 on the pkexec binary, accepting that you lose pkexec privilege delegation. For detection, alert on pkexec runs with an empty argv or with an odd environment such as GCONV_PATH, CHARSET or SHELL right before a root shell shows up.

Credits

The vulnerability was found and responsibly disclosed by the Qualys Research Team.

oss-security advisory: https://seclists.org/oss-sec/2022/q1/80

Qualys write up: https://blog.qualys.com/vulnerabilities-threat-research/2022/01/25/pwnkit-local-privilege-escalation-vulnerability-discovered-in-polkits-pkexec-cve-2021-4034

Legal and ethical use

This code is published only for study and authorized security testing. Running it against systems you do not own or have written permission to test is illegal and can carry criminal and civil liability. Use it in your own labs or under a signed engagement scope. You are responsible for what you do with it.

Download Tool