Hacked WordPress: the written procedure behind every rescue

How I clean a hacked site so it stays clean. Evidence first, every hiding place checked, the way in found and closed, and proof at the end.

Typical cleanup, when the site can be cleaned in place
3-6 h
Full rebuild, when it can't
2-3 days
Steps, always in the same order
11
Known traps written down
20

The problem

Most cleanups remove what is visible: the strange ads, the redirect, the files a scanner flags. A few weeks later the site is hacked again, and it looks like bad luck. It isn’t. Whoever got in left themselves a way back, and it is usually not a file. It is an extra administrator account, code stored in the database, a scheduled task, or a password that keeps working after everyone’s password has been reset.

A scanner that reports “clean” only tells you that the files it knows about are unchanged. It says nothing about what was added.

What I do

I follow one written procedure of eleven steps, in the same order every time. These are the ones that matter most.

  1. Keep the evidence before removing anything. Every malicious file is copied off the server and fingerprinted, and the database is exported. If something has to be checked later, it still exists.
  2. Contain it if it is doing harm. If the site is serving malware to visitors, a maintenance page goes up first, served from outside the infected folder so it can’t be tampered with.
  3. Compare against a copy I can trust. The site’s files are checked against the original WordPress, plugin and theme code, and against the project’s own history. First I confirm that copy is really current, or the comparison means nothing.
  4. Look where files aren’t. Every administrator account, compared with the number the owner expects. Code stored in the database. Scheduled tasks. Application passwords. The folders WordPress loads before everything else.
  5. Find how they got in. The time the first malicious file appeared is matched against the server’s access log for that minute. Until I can say how they entered, the job isn’t finished.
  6. Decide: clean or rebuild. If the server itself was taken over, or there is no trustworthy copy to compare against, the site is rebuilt on a fresh server from clean code and a cleaned database.
  7. Remove, then close the door. The entry point is blocked at the server, write access is taken away from the folders that were written to, and WordPress, plugins and theme are updated.
  8. Prove it. Every “it’s clean” at the end is a command and its output, not an opinion.

What a scanner misses

Each of these is in the procedure because it happened on a real site.

The result

A cleanup that takes hours instead of days, because nothing is being worked out from scratch, and a short report at the end: what happened, how they got in, what was removed, what was changed, and what to do so it doesn’t happen again. Every time a site surprises me, the procedure gets a new entry.

What this means for you

If your site has been hacked, or was cleaned once and it came back, this is what you get with a website rescue: one fixed price, the same procedure, and the proof in writing.

Tell me what’s happening

Send me your website address.

I'll reply myself, usually the same day, with what I found. No commitment, and no sales call unless you want one.

Hary