πPolkit/Pwnkit
π― Overview
Polkit (PolicyKit) authorization service vulnerability CVE-2021-4034 "Pwnkit" allows local privilege escalation through pkexec memory corruption, affecting most Linux distributions.
π¨ CVE-2021-4034 (Pwnkit)
Vulnerability Details
Impact: Memory corruption in pkexec β immediate root shell
Affected: Most Linux distributions with polkit
Hidden: Over 10 years undetected (published Nov 2021)
Requirement: None - any local user can exploit
Version Check
# Check pkexec availability
which pkexec
pkexec --version
# Check polkit version
apt list --installed | grep polkit
rpm -qa | grep polkitπ Exploitation
Download and Compile Pwnkit
Alternative Exploits
π§ Manual Exploitation
Understanding the Vulnerability
DIY Exploit (Advanced)
π Detection & Enumeration
Polkit Vulnerability Check
System Information
π Quick Reference
Immediate Checks
Emergency Exploitation
HTB Academy Example
β οΈ Exploit Characteristics
Pwnkit Advantages
Universal impact - Works on most Linux distributions
No prerequisites - Any local user can exploit
Reliable exploitation - High success rate
Silent execution - Minimal system logs
Limitations
Compilation required - Need gcc on target or transfer binary
Patched systems - Fixed in updated polkit versions
Detection possible - Modern EDR may detect exploitation
π‘οΈ Defensive Measures
Patch Status Check
Mitigation Options
Pwnkit (CVE-2021-4034) represents one of the most significant Linux privilege escalation vulnerabilities - any local user can exploit polkit's pkexec for immediate root access on unpatched systems.
Last updated