
This is an alternative poc for the CVE-2024-32019 written in python
ndsudo (Netdata Local Exploit)This is an alternative POC to exploit a vulnerable ndsudo utility bundled with Netdata to perform a local privilege escalation.
The exploit works by adding the script inside the user’s PATH substituting an allowed command (nvme) by ndsudo and execute it as root.
ndsudo command.You can either create or upload the script directly to the target machine as long as it's called as one of the allowed commands.
To check the allowed commands by ndsudo just launch ndsudo --help.
For this poc we'll use the command nvme-list, so the script will be called nvme.
Once the script has been created and named after an allowed command by ndsudo we need to inject it at the beginning of the PATH variable so it will be the first one to be found and executed
export PATH="/tmp/nvme:$PATH"
Obviusly the script needs to have execution permissions
chmod +x /tmp/nvme
Once everything is set up, just launch ndsudo with the rogue script and you're root.
ndsudo nvme-list
Hack responsibly 💀