Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2024-4577 — CVE-2024-4577 EXP | Kitploit
Tools/GitHubGitHub/charis3306/cve-2024-4577
Vulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingRed Teaming
GitHubcharis3306/cve-2024-4577

CVE-2024-4577

CVE-2024-4577 EXP

View Repository
2 years agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

PHP-CGI Windows Platform Remote Code Execution Vulnerability (CVE-2024-4577)

Introduction

PHP is an acronym for Hypertext Preprocessor. It is now a widely used open-source scripting language that is particularly suitable for web development and embedding in HTML, and is very simple to use. CGI, which stands for Common Gateway Interface, is the mechanism by which Apache, when encountering a PHP script, submits the PHP program to the CGI application (php-cgi.exe) for interpretation. The interpreted result is returned to Apache, which then returns it to the requesting user.

Vulnerability Description

PHP, during its design, ignored the Best-Fit character conversion feature in Windows. When PHP-CGI runs on the Windows platform and uses specific locales (such as Simplified Chinese 936, Traditional Chinese 950, Japanese 932, etc.), an attacker can construct special query strings. After URL decoding, these strings may contain specific non-ASCII characters that are mapped to hyphens on Windows systems, thereby bypassing the patches for CVE-2012-1823 and CVE-2012-2311, constructing CGI-mode command-line parameters, and executing arbitrary PHP code.

Affected Versions

  • PHP Windows Version 8.3.0 <= affected versions < 8.3.8
  • PHP Windows Version 8.2.0 <= affected versions < 8.2.20
  • PHP Windows Version 8.1.0 <= affected versions < 8.1.29
  • PHP Windows Version: affected versions == 8.0.x
  • PHP Windows Version: affected versions == 7.x
  • PHP Windows Version: affected versions == 5.x
  • XAMPP Windows Version 8.2.0 <= affected versions <= 8.2.12
  • XAMPP Windows Version 8.1.0 <= affected versions <= 8.1.25
  • XAMPP Windows Version: affected versions == 8.0.x
  • XAMPP Windows Version: affected versions == 7.x
  • XAMPP Windows Version: affected versions == 5.x

Usage

python CVE-2024-4577 --target http://192.168.1.1/index.php -c "<?php system('calc')?>"

alt text

Fix

Comment out the following configuration in C:\xampp\apache\conf\extra\httpd-xampp.conf and restart the service.

root@kitploit:~
#
# PHP-CGI setup
#
# <FilesMatch "\.php$">
#    SetHandler application/x-httpd-php-cgi
# </FilesMatch>
# <IfModule actions_module>
#    Action application/x-httpd-php-cgi "/php-cgi/php-cgi.exe"
# </IfModule>

Comment out in C:/xampp/apache/conf/extra/httpd-xampp.conf:

root@kitploit:~
# ScriptAlias /php-cgi/ "C:/xampp/php/"
Download Tool