Site icon API Security Blog

Exploit for OS Command Injection in Php

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. optional arguments: -h, –help show this help message and exit -v, –version show program's version number and exit…Read More

Exit mobile version