PHP SECURITY / READ-ONLY AUDIT

Know what
needs patching.

Turn PHP2Shell uncertainty into a clear inventory. Discover PHP services, collect version evidence and prepare your next remediation step.

CVE-2026-109618 CVE-2026-109619

Two scripts. Linux + Windows. Reports stay on your machine.

AUDIT WORKSPACE01 / DISCOVER
bash / php_audit.sh

$ bash php_audit.sh '192.168.1.0/24' en

SCOPE Authorized IPv4 targets

OUTPUT report.html + report.csv

↳ Review evidence. Prioritize remediation.

ILLUSTRATIVE WORKFLOWNo scan runs in your browser.
01 No permanent agents02 No remote changes03 English / Portuguese reports04 Evidence before conclusions

BUILT FOR THE FIRST RESPONSE

From network scope
to a practical next step.

Run from one machine inside an authorized network. No central infrastructure or Ansible required.

01 / DISCOVER

Find web-facing services.

Check TCP ports 80, 443, 8080 and 8443, then make a bounded HTTP request. Configure additional ports, timeouts and concurrency for your environment.

IPv4Lists & rangesCIDR subnets
02 / INVESTIGATE

Collect PHP evidence.

Look for PHP and application hints. With existing, authorized SSH or WinRM access, collect runtime, package and service evidence, subject to permissions.

PHP-FPMApache / Nginx / IISDocker metadata
03 / COMMUNICATE

Leave with a clear report.

Open a local HTML report with expandable evidence and recommendations. Use the CSV for follow-up. Choose English or Portuguese when you run the script.

HTML + CSVLocal outputEN / PT
APPLICATION HINTS

WordPress · Nextcloud · Joomla · Drupal · Laravel · Magento · MediaWiki · phpBB · WHMCS

Fingerprints are indicators, not proof of an installation or a vulnerability.

THE PHP2SHELL VULNERABILITIES

The runtime
needs attention.

PHP2Shell refers to two critical PHP vulnerabilities that can allow unauthenticated remote code execution. Updating a PHP application alone does not establish that its underlying PHP runtime is fixed.

Read the PHP security advisory
UPSTREAM FIX REFERENCEBOTH CVEs
First upstream releases fixing both PHP2Shell vulnerabilities
PHP branchFirst fixed release
8.28.2.35 ↗
8.38.3.36 ↗
8.48.4.27 ↗
8.58.5.12 ↗

Use these releases or newer stable releases in the same branch. For PHP 8.1 and earlier, verify vendor support and backports or migrate to a supported branch.

A version number is only part of the evidence.

Debian, Ubuntu and RHEL packages may include backported fixes. Confirm coverage for both CVEs against your vendor's advisory and the web runtime actually serving requests.

QUICK START

Your targets.
Your language. One command.

Download the script for your operating system, review it, then open a terminal in its folder. No code editing required.

Linux

Bash script

Download .sh

RUN WITH YOUR AUTHORIZED TARGETS

bash php_audit.sh '192.168.1.0/24' en

Replace 192.168.1.0/24 with your scope. Use pt for a Portuguese report. Without arguments, the script asks for both.

Requirements & optional SSH inventory

Bash 3.2+, curl 7.21+ with HTTPS, coreutils (including timeout and mktemp), awk, grep and sed.

For optional Linux inventory, use an existing SSH key or agent and verified host keys:

bash php_audit.sh '192.168.1.10' en --ssh-user auditor

No sudo or password prompts. Insufficient access leaves missing evidence inconclusive.

Windows

PowerShell script

Download .ps1

RUN WITH YOUR AUTHORIZED TARGETS

.\PHP-Audit.ps1 '192.168.1.0/24' en

Or open the script in PowerShell ISE and press F5. Enter your targets and choose en or pt when prompted.

Requirements & optional WinRM inventory

Windows PowerShell 5.1 with .NET Framework 4.7.2+, or PowerShell 7 on Windows. Follow your organization's script execution policy.

For optional Windows inventory, use existing authorized PowerShell Remoting:

.\PHP-Audit.ps1 '192.168.1.10' en -Credential (Get-Credential) -UseSSL

The script does not change WinRM, firewall rules or TrustedHosts.

What goes in the target field?

Use IPv4 addresses you are authorized to audit.

One server
192.168.1.10
Several servers
'192.168.1.10,192.168.1.20'
An IP range
'192.168.1.10-30'
A subnet
'192.168.1.0/24'

When it finishes, open report.html.

The printed output path points to reports/<timestamp>/ beside your script. A CSV is saved there too. Keep reports and target lists private.

Full README
Want to try it without scanning a network?

The built-in self-test checks version and classification logic, then generates clearly marked simulated reports. It makes no network requests.

bash php_audit.sh --self-test en
.\PHP-Audit.ps1 -SelfTest -Language en

READ THE RESULT CORRECTLY

Uncertainty stays visible.

No PHP detected does not mean no vulnerability. A CLI version or HTTP banner alone never proves that a website is fixed.

POTENTIALLY VULNERABLE

Investigate and prioritize.

An older PHP version needs review. Check vendor backports and confirm the web runtime before drawing a conclusion.

INCONCLUSIVE

More evidence is needed.

Missing versions, unreachable hosts and CLI-only findings remain inconclusive. A fixed-looking banner is insufficient too.

VULNERABLE / FIXED

Evidence must match.

Confirmed states require reviewed, matching web-runtime evidence for both CVEs. The tool does not automatically certify vendor backports or an entire server.

Coverage limits: name-based/SNI virtual hosts, proxies, hidden installations, other paths and restricted containers may be missed. Public exposure can be declared by the technician; it is not tested from the Internet.

A FEW IMPORTANT DETAILS

Before you run.

Does Fix Check apply patches?

No. It inventories services and collects evidence to support remediation decisions. It does not install, update, restart or change target servers. Plan and validate updates separately with your vendor.

Does it run exploits or stress tests?

No. Network discovery uses TCP checks and a bounded GET request to the root path. There are no exploits, DoS tests or WAF bypass attempts. Optional SSH and WinRM collection uses existing authorized access.

Do I need credentials?

No credentials are needed for web discovery. Remote Linux inventory uses SSH keys or an agent; remote Windows inventory uses existing WinRM access. Passwords are not written to the reports or logs.

Can I adjust ports and scan speed?

Yes. Defaults are 80, 443, 8080 and 8443, with eight concurrent workers and a limit of 4,096 IPv4 addresses. Use Bash --ports / --concurrency or PowerShell -Ports / -Concurrency. Consult the README for TLS ports and timeouts.

MAKE THE NEXT STEP AN INFORMED ONE

Start with evidence.

View on GitHub

Review the code. Audit your authorized scope. Plan the fix.