php2shell-checker README

项目的 README,来自 github.com/openai/php2shell-checker。合并为一个 markdown 文件:README.md。

PHP Version Checker

Get a version-based PHP2Shell warning from a website's PHP headers or local installation.

To install both skills, ask Codex:

$skill-installer install both skills from https://github.com/openai/php2shell-checker

Use phpcheck-server when you have server access, or phpcheck-url when you only have a URL:

$phpcheck-url check https://example.com
$phpcheck-server check the PHP version serving my site

Run directly

Check a website:

node phpcheck.js "https://example.com"

Results

Result Exit code Meaning
OK 0 Advertised version meets an upstream fixed release.
POTENTIALLY VULNERABLE 1 Advertised version is in an affected range.
UNKNOWN 3 Missing or unrecognized version, prerelease, or failed check.

Use --json for machine-readable output. patch_status is ok, potentially_vulnerable or unknown. Invalid arguments exit with code 2.

Versions below a listed upstream fix return potentially_vulnerable and exit 1. PHP 5.4–5.6, 7.0–7.4, 8.0 and 8.1 also return this warning, even with a higher patch number such as 8.1.35.

URL checks

URL mode reads X-Powered-By and Server, sends HEAD, and falls back to GET only when HEAD returns 405 or 501. It does not follow redirects or inspect response bodies. Missing or hidden PHP headers return UNKNOWN.

The upstream fixed releases are 8.2.35, 8.3.36, 8.4.27 and 8.5.12, from the October 21 PHP advisory. HTTP headers cannot tell whether the version contains a backported fix. Even OK only describes the advertised version - it doesn't verify the installation! The checker does not send exploit probes.

Contributing

OpenAI is not accepting external code contributions to this project. Bug reports and non-code feedback are welcome through GitHub issues. See CONTRIBUTING.md.

License

This project is licensed under the Apache License 2.0.

php2shell-checker (openai/php2shell-checker)

正在搜索数据库…

这是什么?这是一个命令行工具(另附配套的 Codex 技能),它根据报告的版本号,检查 PHP 网站或本地 PHP 二进制文件所运行的版本是否存在 php2shell 漏洞。
这是独立的命令行工具,还是必须配合 Codex 使用?两种方式都可以:你可以直接运行命令行工具,也可以将其安装为两个 Codex 技能:有服务器访问权限时用 phpcheck-server,只有 URL 时用 phpcheck-url。
我该怎么检查网站或本地 PHP 二进制文件?对网站 URL 或本地 php 可执行文件运行命令行工具;加上 --json 可获得机器可读的输出,而不是纯文本。
试用它是否需要安装真正的 PHP?不需要。测试套件完全基于本地模拟的 HTTP 服务器和模拟的 PHP 可执行文件运行,因此仅为试用该检查工具,无需安装 PHP,也无需外部网站。
VULNERABLE 或 OK 的结论有多可靠?它只从 HTTP 响应头(X-Powered-By、Server)或 'php -v' 的输出中读取版本号,从不跟随重定向,也不检查响应正文;而 OK 结果只是假定该分支之后的补丁已包含修复,并未实际确认。
OK、VULNERABLE 和 UNKNOWN 结果到底是什么意思?OK(退出码 0)表示检测到的 PHP 补丁版本高于其分支内置的截止版本;VULNERABLE(退出码 1)表示等于或低于该截止版本;UNKNOWN(退出码 3)表示未找到可用的版本信息,例如响应头被隐藏或分支无法识别。
UNKNOWN 结果是否意味着目标是安全的?不是。README 明确警告,UNKNOWN 并不代表目标已打补丁,它只表示检查工具无法确定版本。
服务器能否向这个检查工具隐藏或伪造其真实的 PHP 版本?能。该工具依赖 X-Powered-By、Server 等响应头或 php -v 的输出,而 README 指出,这些信息可能被隐藏、被修改,或受到发行版的回移(backport)补丁影响,这类补丁不会更新所报告的版本号。
作者
openai
大小
<0.1 MB
星标
1.5K
更新
提交Oct 22
时长
28天
提交 · 90 天