A hacked site that needed a second pass
Covered: security, hosting
Short version: a hacked site was cleaned, went down again the next day, and a second pass found what the first one missed. I never confirmed how the attackers got in. That is why there is always a second pass.
The situation
A small business site went down. When I looked, it had been taken over. There were several backdoors, hundreds of tampered server configuration files, injected code in the main WordPress configuration file, about a dozen fake plugins that were really remote-control tools, two administrator accounts nobody had created that were still logged in, and about two dozen spam tables in the database.
The host’s own backups were infected too, so restoring one was not a way out.
What I found and did
Round one. I removed the backdoors, the tampered files, the injected code, the fake plugins, the rogue accounts and the spam tables. I reinstalled WordPress itself from copies checked against the official checksums. The site came back up. The owner got a written note that day: what happened, what I did, and what they needed to do.
The next day, the site was down again. Something had survived. I went through everything again, more slowly, and found about half a dozen more backdoors. One of them could pull new malicious code onto the site by itself. It had survived round one.
The first round missed it. I would rather say that plainly than pretend one pass is always enough.
Hardening. After round two I added a web application firewall, switched off XML-RPC (an old remote-publishing interface that attackers use), replaced the security keys so every existing login was ended, and tightened file permissions.
What changed
The site was restored and scanned clean after round two.
How the attackers first got in was never confirmed. That is the honest limit of this case, and it is the reason for the second pass. When the way in is not known, the safe assumption is that the first pass missed something. So I go back and look again, every time.
Honest limits: the entry point was never found, and I did not measure time to restore. I measure it now.