Sploitus

Exploit for Deserialization of Untrusted Data in Apache Tomcat

githubexploit Β· 2025-04-09

Exploit Code

README135 lines
## https://sploitus.com/exploit?id=BBB17262-A00F-5DCF-BFF5-C752B822F8ED
# CVE-2025-24813 Proof-of-Concept (Standalone)

This repository contains a non-destructive, standalone PoC for [CVE-2025-24813](https://nvd.nist.gov/vuln/detail/CVE-2025-24813), a vulnerability in Apache Tomcat 9.0.55 allowing remote file upload via partial `PUT` requests. This exploit demonstrates code execution by uploading and accessing a benign JSP file.

---

## πŸ“ Contents

- `proof.jsp`: Harmless JSP payload to demonstrate code execution.
- `cve_2025_24813_client_demo.py`: Python3 script to detect, exploit, verify, log, and clean up.
- `report.txt`: Auto-generated log of the testing session.

---

## 🧰 Requirements

- Python 3.7+
- Optional: `html2image` for screenshot capture:
  ```bash
  pip install html2image
  ```

---

## πŸ–₯️ Usage

```bash
python3 cve_2025_24813_client_demo.py
```

You will be prompted for:
- Target IP or hostname (e.g., `192.168.1.100`)
- Target port (e.g., `8080`)

---

## πŸ” Features

- βœ… Partial PUT vulnerability check (CVE-2025-24813)
- βœ… Optional screenshot capture (via `html2image`)
- βœ… Interactive prompts and confirmation before exploitation
- βœ… Color-coded terminal output
- βœ… Logs to `report.txt`
- βœ… Auto cleanup via HTTP DELETE after 24 hours

---

## ⚠️ Safety & Ethics

This PoC is **completely innocuous**. It does:
- No persistence
- No shell, no command execution
- Just uploads and accesses a static JSP

Use only on systems you are **authorized** to test.

---

## πŸ“Έ Example Output

```bash
[βœ”] Server appears to support partial PUT!
[βœ…] Exploit verified: JSP executed successfully.
[URL] http://target:8080/uploads/proof.jsp
[*] Sleeping for 24.0 hours before cleanup...
```

---

## πŸ“¦ Packaging for GitHub

- This repo is ready for GitHub publishing.
- Add a license of your choice (e.g. MIT).
- Push with:
  ```bash
  git init
  git add .
  git commit -m "Initial CVE-2025-24813 PoC"
  git remote add origin https://github.com/YOURUSERNAME/cve-2025-24813-poc.git
  git push -u origin main
  ```

---

## 🧼 Cleanup

After 24 hours, the script automatically issues an HTTP `DELETE` to remove the JSP. You can also remove it manually.

---

## πŸ“„ License

MIT or custom license of your choice.

---

## βœ‰οΈ Contact

Maintained by [Your Name]. For authorized use only.


## πŸ“› GitHub Badges

![MIT License](https://img.shields.io/badge/license-MIT-green)
![Python](https://img.shields.io/badge/python-3.7%2B-blue)
![PoC](https://img.shields.io/badge/status-PoC-informational)


---

## 🧩 Full Feature List

- βœ… Interactive CLI for target IP/port input
- βœ… Vulnerability detection via:
  - Partial PUT test
  - Fallback header analysis (`Server: Apache/Tomcat`)
- βœ… User confirmation before exploitation
- βœ… Harmless `proof.jsp` upload with no side effects
- βœ… Live verification via HTTP GET
- βœ… Color-coded terminal output (green, yellow, red)
- βœ… Screenshot capture with `html2image`
- βœ… Auto-cleanup via HTTP DELETE after 24 hours
- βœ… All activity logged to `report.txt`
- βœ… `.gitignore`, `LICENSE`, GitHub badges
- βœ… GitHub Pages + release-ready metadata
- βœ… `setup.sh` for optional environment prep
- βœ… Disclosure template `disclosure.md` for blog/report use
- βœ… GitHub banner image `banner.png`

---

## 🧠 Notes

This project is designed to be shared publicly and used responsibly. If you find it useful, consider starring the repo and contributing via issues or pull requests.