28 October 2026 / Security operations / 8 chapters

Find out what each server actually runs

From Patching php2shell across a mixed PHP fleet

The first job on every server was to find out what was really there. Hostnames and old setup documents can be out of date. The version that matters is the one in memory serving requests.

On each host the agent recorded:

  • The operating system release, from the system itself. One server's hostname suggested a newer release than the one it was actually running.
  • The installed PHP packages and where they came from.
  • Which handlers serve web requests: mod_php, PHP-FPM pools, or both.
  • When the running PHP processes started.
  • Every site on the host that depends on that PHP install.

The start time was more useful than I expected. On one server, the PHP-FPM master process had started on 7 October, two weeks before the fix existed. Whatever happened to the packages afterwards, that process could only be running vulnerable code until it was restarted.

The installed package changelog was the other key check. On that same server the package version looked plausible, but its security changelog had nothing newer than January. The package manager's cached metadata listed the installed version as the newest candidate, which could easily be read as "up to date". It only meant the configured package source had nothing newer to offer.

CISA's alert starts its action list with the same step: identify and inventory every system running PHP, noting that PHP is often a component of other software and may not be directly visible. That matched what we found. One site was a set of static HTML pages, and PHP was installed only so that the root address would redirect to the homepage file. Nothing else on the site used it. That host could have dropped PHP entirely by replacing the redirect with a web server rule and refusing PHP requests outright. We checked exactly what would break first. Without the routing change, the homepage would have returned a 502 error.

All articles