Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
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.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2021-4034-PwnKit- — Este repositorio muestra cómo explotar la vulnerabilidad CVE-2021-4034. | Kitploit
Tools/GitHubGitHub/igonzalez357/cve-2021-4034-pwnkit-
Privilege EscalationVulnerability AnalysisExploitationPenetration TestingLearning & EducationBinary Exploitation
GitHubigonzalez357/cve-2021-4034-pwnkit-

CVE-2021-4034-PwnKit-

Share

Este repositorio muestra cómo explotar la vulnerabilidad CVE-2021-4034.

View Repository
1321 year agoNot yet reviewed

CVE-2021-4034 (PwnKit) - Analysis and Exploitation

This repository contains the source code to demonstrate the exploitation of the CVE-2021-4034 vulnerability, also known as PwnKit, discovered in pkexec (part of the Polkit package). This flaw allows local privilege escalation to root through the use of malicious environment variables.


⚠️ Warning

This code is provided solely for educational and research purposes. It should not be used on production systems or without explicit authorization. Misuse may be illegal and violates the author's terms of use.


🧠 Technical Description

The vulnerability occurs when pkexec is executed without arguments, i.e., argc == 0. In this case, pkexec attempts to access argv[1] without checking that argv[0] exists, causing it to read from envp[0]. This allows the attacker to:

  • Read and overwrite environment variables such as GCONV_PATH.
  • Force the loading of an arbitrary .so library to execute code as root.

The exploit takes advantage of this condition to load a malicious library that opens a shell as the root user.


📁 Repository Files

  • cve-2021-4034.c: Source code of the exploit that invokes pkexec with argv[] = {NULL} and modified environment variables.
  • pwnkit.c: Source code of the malicious library that opens a shell as root.

🛠️ Compilation

gcc -Wall -o cve-2021-4034 cve-2021-4034.c
gcc -Wall -shared -fPIC -o pwnkit.so pwnkit.c

🧪 Usage Instructions (Environment Preparation and Execution)

mkdir GCONV_PATH=.
echo 'module UTF-8// PWNKIT// pwnkit 1' > gconv-modules
cp $(which true) GCONV_PATH=./pwnkit.so:.

./cve-2021-4034
Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    1.1k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    618
  • 3

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    411
  • 4

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    328
  • 5

    jumpserver

    jumpserver/jumpserver

    JumpServer is an open-source Privileged Access Management (PAM) platform that provides DevOps and IT teams with on-demand and secure access to SSH, RDP, Kubernetes, Database and RemoteApp endpoints through a web browser.

    314
  • 6

    Aliens_eye

    arxhr007/aliens_eye

    AI powered OSINT engine to discover and map 7,700+ social media identities across the web

    275

Explore all tools

Browse our collection of tools

View all tools →