PHP-CGI 远程代码执行漏洞

漏洞信息

漏洞名称: PHP-CGI 远程代码执行漏洞

漏洞编号:

  • CVE: CVE-2024-4577

漏洞类型: 命令执行

漏洞等级: 严重

漏洞描述: 受影响产品: PHP-CGI是PHP的一个通用网关接口实现,广泛用于Web服务器如Apache和Nginx中,以处理PHP脚本的执行。它是许多网站和应用的基础组件,尤其是在使用CGI模式运行PHP的环境中。由于其广泛的应用,该漏洞的影响范围非常广泛。

漏洞解释: 此漏洞为远程代码执行(RCE)类型,攻击者可以通过特制的查询参数利用auto_prepend_file=php://input机制,在服务器上执行任意PHP代码。这主要是因为PHP-CGI在处理输入时未能正确过滤或验证特定的参数,导致攻击者可以注入并执行恶意代码。

影响分析: 该漏洞允许攻击者在未授权的情况下远程执行任意代码,可能导致服务器被完全控制,数据泄露,服务中断等严重后果。由于漏洞利用不需要认证,且可以通过自动化工具大规模扫描和利用,因此风险极高。攻击者可以利用此漏洞在受影响的服务器上安装后门,窃取敏感信息,或发起进一步的攻击。

产品厂商: PHP

产品名称: PHP-CGI

来源: https://github.com/CirqueiraDev/MassExploit-CVE-2024-4577

类型: CVE-2024:github search

仓库文件

  • CVE-2024-4577.py
  • README.md
  • requirements.txt

来源概述

CVE-2024-4577 Mass Scanner & Exploit Tool

This Python script automates the detection of servers vulnerable to CVE-2024-4577, a critical vulnerability in PHP-CGI that allows remote code execution (RCE) through specially crafted query parameters.

The tool sends a PHP payload (<?php phpinfo(); ?>) using auto_prepend_file=php://input and detects vulnerability by analyzing the server’s response for signs of successful code execution.


Usage

1
pip install -r requirements.txt
1
python CVE-2024-4577.py list.txt 50
  • list.txt: A file containing one domain per line
  • 50: Number of threads to use

Output

  • Vulnerable URLs are saved to vulnerable.txt

Disclaimer

This tool is created for educational purposes or authorized security assessments only.
Unauthorized scanning or exploitation of third-party systems is illegal and may violate service terms or criminal laws.
Use responsibly.


Coded by CirqueiraDev


PHP-CGI 远程代码执行漏洞
http://example.com/2025/07/23/github_3045532272/
作者
lianccc
发布于
2025年7月23日
许可协议