php2shell-checker README

The project's README from github.com/openai/php2shell-checker. As one markdown file: README.md.

PHP Version Checker

Check a website or local PHP binary to see if it's vulnerable to php2shell.

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"

Check the local CLI PHP

node phpcheck.js --local

Results

Result Exit code Meaning
OK 0 Stable PHP patch version above the embedded cutoff for a listed major/minor branch.
VULNERABLE 1 PHP version at or below the embedded cutoff for that branch.
UNKNOWN 3 No PHP version or response, an unrecognized version/branch, or a newer prerelease build.

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

Tests

node --test phpcheck.test.js

Tests run the CLI against local HTTP servers and a fake PHP executable. No PHP installation or external website is required.

Limitations

The checker only evaluates versions exposed in HTTP response headers or by php -v. It 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.

OK is a version comparison based on the assumption that subsequent stable patches in each listed branch contain the fix. It does not independently verify a security fix. Check the versions against the official PHP security release. Headers can be hidden or changed, and distribution backports may not change the upstream version. UNKNOWN does not mean the target is patched!

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)

php-security
Searching Database…

What is this?A command-line tool (plus matching Codex skills) that checks whether a PHP website or a local PHP binary is running a version vulnerable to php2shell, based on reported version numbers.
Is this a standalone CLI or does it need Codex?It works both ways: you can run the CLI directly, or install it as two Codex skills, phpcheck-server for when you have server access and phpcheck-url for when you only have a URL.
How do I check a site or a local PHP binary?Run the CLI against a website URL or against the local php executable; add --json to get machine-readable output instead of plain text.
Do I need a real PHP install to try it?No, the test suite runs entirely against local fake HTTP servers and a fake PHP executable, so no PHP installation or external website is needed just to try the checker.
How reliable is the VULNERABLE or OK verdict?It only reads the version from HTTP response headers (X-Powered-By, Server) or 'php -v' output, never follows redirects or checks response bodies, and an OK result just assumes later patches in that branch include the fix rather than confirming it.
What do the OK, VULNERABLE and UNKNOWN results actually mean?OK (exit 0) means the detected PHP patch is above the embedded cutoff for its branch; VULNERABLE (exit 1) means it's at or below the cutoff; UNKNOWN (exit 3) means no usable version was found, such as a hidden header or unrecognized branch.
Does an UNKNOWN result mean the target is safe?No. The README explicitly warns that UNKNOWN does not mean the target is patched - it just means the checker couldn't determine the version.
Could a server hide or spoof its real PHP version from this checker?Yes - the tool relies on headers like X-Powered-By and Server, or php -v, and the README notes these can be hidden, changed, or affected by distro backports that don't update the reported version.
Creator
openai
Size
<0.1 MB
Stars
1.4K
Updated
CommitOct 22
Age
5d
Commits · 90 Days