Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2024-4577 PoC — Argument Injection in PHP-CGI

Source
Associated Vulnerability
Title:Argument Injection in PHP-CGI (CVE-2024-4577)
Description:In PHP versions 8.1.* before 8.1.29, 8.2.* before 8.2.20, 8.3.* before 8.3.8, 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 PHP 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 PHP code on the server, etc.
Description
A PHP CGI Vulnerability Scanner for CVE-2024-4577
Readme
# PHP CGI Scanner

## Screenshot

![PoC Screenshot](poc.png)

## Overview

**PHP CGI Scanner** is a Python 3 utility designed to help identify
systems potentially exposed to
[CVE-2024-4577](https://nvd.nist.gov/vuln/detail/CVE-2024-4577).\
It checks for visible PHP versions, common CGI endpoints, and phpinfo
outputs to provide a quick risk assessment.

> **Disclaimer:** This tool is for authorized security testing only. Use
> responsibly.

## Features

-   Detects PHP version from headers and phpinfo output.
-   Scans for common PHP-CGI endpoints.
-   Classifies server API (CGI, FPM, module).
-   Provides clear verdicts (SAFE, POTENTIALLY VULNERABLE,
    INCONCLUSIVE).
-   Optional colorized output and ASCII banners.

## Requirements

-   Python 3.6+
-   [requests](https://pypi.org/project/requests/)
-   [colorama](https://pypi.org/project/colorama/) (optional)
-   [pyfiglet](https://pypi.org/project/pyfiglet/) (optional)

## Installation

Clone the repository and install dependencies:

``` bash
git clone https://github.com/yourusername/PHPCGIScanner.git
cd PHPCGIScanner
pip install -r requirements.txt
```

## Usage

### Basic Scan

``` bash
python3 PHPCGIScanner.py <target>
```

Example:

``` bash
python3 PHPCGIScanner.py http://example.com
```

### With phpinfo URL

``` bash
python3 PHPCGIScanner.py <target> --phpinfo-url http://example.com/phpinfo.php
```

### Ignore TLS Warnings

``` bash
python3 PHPCGIScanner.py <target> --insecure
```

## Exit Codes

-   **0** -- SAFE / Not vulnerable
-   **1** -- POTENTIALLY VULNERABLE (needs review)
-   **2** -- UNKNOWN / Error

## Notes

-   Vulnerable PHP versions checked:
    -   8.3.0--8.3.7
    -   8.2.0--8.2.19
    -   8.1.0--8.1.28
-   Designed for security engineers and penetration testers with
    permission.

## License

MIT License. See `LICENSE` file for details.
File Snapshot

[4.0K] /data/pocs/02b1855828fc33750e2dcb7d4e85510d3b64a327 ├── [1.0K] LICENSE ├── [ 11K] PHPCGIScanner.py ├── [237K] poc.png ├── [1.8K] README.md └── [ 27] requirements.txt 0 directories, 5 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →