Article chapter 04 of 08
Restart the workers and check what's loaded
Installing a fixed package doesn't fix PHP that's already running. PHP-FPM, Apache with mod_php and anything else that keeps PHP in memory will carry on serving the old code until it's restarted.
The Tenable FAQ makes this point and adds one that's easy to miss in a hurry: Google Cloud's guidance, with input from Mandiant, says to capture worker memory first on any server that shows signs of probing, because a restart wipes that evidence. Amazon reported exploitation attempts as early as 17 October, four days before disclosure, so the useful window for checking logs starts there and not on the release date.
After each update the agent restarted the relevant services, including the background job workers that run PHP outside the web server. On one server that included a background message worker for the application, which restarting the web server alone wouldn't have touched. Then it checked the running processes directly:
- The loaded PHP module or FPM binary is the updated one.
- No running PHP process still maps a deleted or replaced library file.
- OPcache mappings point at current files.
- Package integrity checks pass for the PHP packages.
That last group of checks is how you tell "the packages are installed" apart from "the patched code is running". On two servers I only asked for verification, with no changes, because the updates had been applied the day before. The checks showed that the module upgrades had happened on 22 October, Apache had been restarted afterwards, and nothing stale was still loaded.