πŸ”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