POC详情: ef70085212e35d303b35d55aab6b64c557ef3737

来源
关联漏洞
标题: Apache Tomcat 安全漏洞 (CVE-2024-50379)
描述:Apache Tomcat是美国阿帕奇(Apache)基金会的一款轻量级Web应用服务器。用于实现对Servlet和JavaServer Page(JSP)的支持。 Apache Tomcat存在安全漏洞。攻击者利用该漏洞可以在不区分大小写的文件系统上远程执行代码。以下版本受到影响:11.0.0-M1版本和11.0.1版本、10.1.0-M1版本至10.1.33版本和9.0.0.M1版本至9.0.97版本。
描述
ExploitDB CVE-2024-50379 a vulnerability that enables attackers to upload a JSP shell to a vulnerable server and execute commands remotely. The exploit is especially effective when the /uploads directory is either unprotected or missing on the target server.
介绍
# CVE-2024-50379-Exploit

This repository provides a Python script for exploiting **CVE-2024-50379**, a vulnerability that enables attackers to upload a JSP shell to a compromised server, granting them the ability to run arbitrary commands remotely. This exploit is particularly effective if the `/uploads` directory is missing or lacks proper security on the target server.

---

## Summary

The **CVE-2024-50379** vulnerability affects web servers that mishandle file uploads, allowing malicious users to upload JSP shells that can execute commands remotely. The included Python script automates this exploit by uploading a shell to the vulnerable server and facilitating remote command execution through a terminal interface.

---

## Requirements

Before running the script, make sure you have the following:

- Python 3.6+ (Recommended)
- `requests` library. You can install it via pip:
```bash
pip install requests
```
## Target Systems
This exploit works against servers such as Apache Tomcat or similar, where the file upload functionality is insecure or the `/uploads` directory is misconfigured.
> Warning: This tool should only be used in environments where you have explicit permission, such as during authorized penetration testing or for educational purposes. Unauthorized use is illegal and unethical.

## Instructions
### Step 1: Clone the repository
Clone the repository to your local machine:
```
git clone https://github.com/pwnosec/CVE-2024-50379.git
cd CVE-2024-50379
```
Install the necessary Python libraries:
```
pip install requests
```
Execute the script with:
```
python exploit.py
```
## Input the base URL
When prompted, enter the base URL of the vulnerable server (e.g., `http://localhost:8080`). If you omit `http://` or `https://`, it will automatically prepend `http://` to the URL.

## Upload the shell and run commands
Once the JSP shell is uploaded successfully, you can input commands to execute remotely. The tool will display the output.
```bash
[+] Enter the base URL (e.g., localhost:8080): http://127.0.0.1:8080
[+] Verifying server availability...
[+] /uploads directory not found (404), continuing upload attempt...
[+] Attempt 1/3 to upload the shell...
[+] Shell uploaded successfully! You can access it at: http://127.0.0.1:8080/uploads/shell.jsp
[+] Enter a command to run on the server (or 'exit' to quit): whoami
[+] Running command: whoami
[+] Command output:
root
```
Type `exit` to terminate the tool after your session is complete.

文件快照

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