A defensive, read-only triage helper for administrators investigating PHP runtime exposure and possible post-exploitation indicators.
Status: Early prototype. Review and test on systems you administer before relying on its output.
PHP2Shell Sentinel checks local PHP CLI/FPM version signals, selected PHP error logs, common Linux web access logs, selected web-root integrity clues, and a few persistence indicators. It does not send network requests, execute exploit payloads, or attempt to prove remote exploitability.
- Checks PHP CLI/FPM binaries found in common Linux locations.
- Compares detected upstream versions against configurable fixed-version thresholds included in the script.
- Reviews common PHP/FPM logs for memory-related errors.
- Summarizes POST request counts in common Nginx/Apache logs.
- Optionally checks a supplied web root for Git working-tree changes and PHP files in commonly writable directories.
- Reviews selected cron and SSH authorized-key locations.
- Prints findings, warnings, skipped checks, and limitations.
- This is a Linux-oriented local triage script, not a remote website scanner.
- It is not designed for Windows/IIS/Plesk hosts.
- It does not prove that PHP2Shell is present or that exploitation occurred.
- Memory errors, POST requests, changed files, cron entries, and SSH keys can all have legitimate explanations. Treat them as leads to investigate, not proof.
- Upstream version comparisons can produce false positives when Linux distributions or hosting vendors backport security fixes. Check the vendor advisory and package changelog.
- It does not comprehensively inspect every log source, container, PHP SAPI, or persistence mechanism.
- A clean report does not prove that a host is uncompromised.
- Bash 4+ recommended
- Linux
- Standard utilities such as
grep,find,sort,awk,sed - Optional:
dpkgfor Debian-style version comparison andgitfor working-tree review
Clone the repository:
git clone https://github.com/YOUR_GITHUB_USERNAME/php2shell-sentinel.git
cd php2shell-sentinelRun against the local server you administer:
bash scripts/php2shell-sentinel.shPass a web root to inspect:
sudo bash scripts/php2shell-sentinel.sh /var/www/exampleThe script reads local files and logs. Root access may expose more logs, but only run it on a server where you have authorization. Review the source before using sudo.
- Confirm the host and application are within your authorized scope.
- Preserve relevant logs and snapshots if you suspect a compromise.
- Run the script on the server that actually hosts PHP—not on your laptop when the target is remote.
- Validate version findings against the operating-system or hosting vendor's security advisory and package changelog.
- Investigate each warning manually and document benign explanations.
- If compromise is suspected, follow your incident-response process and rotate secrets from a trusted administrative environment.
Please include:
- OS and version
- Bash version (
bash --version) - PHP package/runtime information (redact secrets)
- The relevant output section
- Steps to reproduce on a system you administer
Do not post session cookies, credentials, API keys, private IP information, or unredacted logs.
This project is intended for defensive administration and authorized incident response. You are responsible for ensuring you have permission to inspect the system. The tool is provided “as is”, without warranty, and is not a substitute for vendor guidance, forensic analysis, or a professional incident-response process.
MIT. See LICENSE.