Share
## https://sploitus.com/exploit?id=C99986A2-7B57-5939-9BD1-AA95A6572AF3
# CVE-2024-4577

In PHP when using Apache and PHP-CGI on Windows, if the system is set up to use certain code pages, Windows may use "Best-Fit" behavior to replace characters in command-line given to Win32 API functions. PHP CGI module may misinterpret those characters as options, which may allow a malicious user to pass options to PHP binary being run, and thus reveal the source code of scripts, run arbitrary code on the server, etc.

# Usage

```
usage: CVE-2024-4577.py [-h] [-v] URL COMMAND

PHP CGI Remote Code Execution (CVE-2024-4577) PoC. Reference: https://devco.re/blog/2024/06/06/security-alert-cve-2024-4577-php-cgi-argument-injection-vulnerability-en/

positional arguments:
  URL            target address
  COMMAND        command to execute e.g. <?php system('calc')?>

optional arguments:
  -h, --help     show this help message and exit
  -v, --version  show program's version number and exit
```