
Questo script è un proof of concept (PoC) che dimostra una tecnica di privilege escalation (Elevazione di privilegi) sfruttando una vulnerabilità teorica di sudo (es. CVE-2025-32463). Il PoC forza sudo a caricare una libreria .so manipolata sfruttando la funzionalità -R (chroot) e la configurazione personalizzata di NSS (nsswitch.conf).
This script is a proof of concept (PoC) that demonstrates a privilege escalation technique exploiting a theoretical vulnerability in 'sudo' (e.g. CVE-2025-32463).
The PoC forces 'sudo' to load a manipulated .so library by leveraging the '-R' (chroot) functionality and a custom nsswitch.conf configuration.
Warning: This script is for research or testing purposes only in controlled environments. It must not be executed on production systems or on machines you do not own or manage.
The main change compared to the original script is the integration of the .so library directly inside the script in base64 format.
Before: The .so library had to exist as an external file in the filesystem and was copied with: cp "$SCRIPT_DIR/woot1337.so.2" libnss_/woot1337.so.2
Now: The .so library is included in the script in textual format (base64) and is written dynamically to the temporary filesystem at runtime, using:
cat << 'EOF' | base64 -d > libnss_/woot1337.so.2
(base64 content here)
EOF
The script creates a structure like this:
/tmp/sudowoot.stage.xxxxxx/ ├── woot/ │ └── etc/ │ ├── nsswitch.conf (manipulated configuration) │ └── group (copy of /etc/group) └── libnss_/ └── woot1337.so.2 (.so library decoded from base64)
To make the script executable:
chmod +x sudo-chwoot.sh
Standard execution:
./sudo-chwoot.sh
- Starts a root shell (if the exploit succeeds)
Execution with a command:
./sudo-chwoot.sh id
- Runs 'id' as root (if the exploit succeeds)
To integrate a custom .so library into the script, first convert it to base64:
base64 woot1337.so.2 > woot1337.so.2.b64
Then copy the content of the .b64 file into the script in the section:
cat << 'EOF' | base64 -d > libnss_/woot1337.so.2
(paste the base64 content here)
EOF
Using .so libraries dynamically loaded via NSS and chroot can lead to the execution of arbitrary code with elevated privileges. This type of exploit should only be used in testing contexts and never on real systems without explicit authorization.
This script is provided for educational and research purposes only. The author assumes no responsibility for any misuse of the code, nor for any damages caused. Use only in lab environments, with awareness and authorization.