支持本站 — 捐款将帮助我们持续运营

目标:1000 元,已筹:752

75.2%

POC详情: c9192a53295215c1e9816d2a4d3cabdf8afe247b

来源
关联漏洞
标题:needrestart 安全漏洞 (CVE-2024-48990)
描述:needrestart是liske个人开发者的一款用于检查升级后需要重新启动哪些守护进程的工具。 needrestart 3.8之前版本存在安全漏洞,该漏洞源于允许本地攻击者通过诱骗needrestart使用攻击者控制的PYTHONPATH环境变量运行Python解释器,并以root身份执行任意代码。
描述
PoC for CVE-2024-48990
介绍
# PoC for CVE-2024-48990

CVE-2024-48990 is a local privilege escalation vulnerability found in the `needrestart` utility. The vuln exists in versions prior to 3.8. The service, which runs as root during events like package installations, insecurely scans all running processes. When it finds a Python process, it reads and trusts the PYTHONPATH environment variable from that process.

An unprivileged local attacker can hijack the PYTHONPATH on a "lure" process. When `needrestart` runs, it will find it, adopting the malicious path, and then execute the attacker's code with root privileges.

## Usage
1. Clone the repository in an attacker controlled directory:
```
git clone https://github.com/Mr-DJ/CVE-2024-48990
cd CVE-2024-48990
```

2. Make the exploit script executable:
```
chmod +x exploit.sh
```

3. Run the exploit. It will set the trap and wait till the SUID shell is detected(created when `needrestart` is executed by root), popping a root shell.


## Mitigation
- Patch: Update `needrestart` to version 3.8 or a patched version from your distribution
- Harden Mounts: This exploit can also be mitigated by mounting user writable directories with the `nosuid` and `noexec` options.

## References
- CVE: [https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-48990](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-48990)
- Original Advisory: [Qualys - LPEs in needrestart](https://www.qualys.com/2024/11/19/needrestart/needrestart.txt)

- NIST: [NVD-CVE-2024-48990](https://nvd.nist.gov/vuln/detail/CVE-2024-48990)
文件快照

[4.0K] /data/pocs/c9192a53295215c1e9816d2a4d3cabdf8afe247b ├── [1.8K] exploit.sh └── [1.5K] README.md 1 directory, 2 files
神龙机器人已为您缓存
备注
    1. 建议优先通过来源进行访问。
    2. 如果因为来源失效或无法访问,请发送邮箱到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
    3. 神龙已为您对POC代码进行快照,为了长期维护,请考虑为本地POC付费,感谢您的支持。