# 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: [-h] [-v] URL COMMAND

PHP CGI Remote Code Execution (CVE-2024-4577) PoC. Reference:

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