Skip to content

WordPress Security Audit: 7 Stages After a Hack

A hacked site produces panic and a list of plugins to delete. A wordpress security audit produces a sequence: discover, confirm, contain, eradicate, recover, verify, report. The order is not decoration; skipping a stage is how a site gets cleaned twice.

Code: wordpress-security-ops, MIT licensed.

A skill for an agent, version 0.1.1, with seven modes: audit, harden, incident, forensic, recover, monitor, report. It works with BotBlocker Security when the site has it, and without it through WP-CLI, SSH, the database or the admin.

Stage 1 and 2: discover, then confirm

Discovery is a scan of versions, plugins, themes, users, cron, headers and firewall posture. Confirmation is the part people skip: a scan result is a suspicion until it is checked against a file, a log line or a user record.

The skill states that it never treats a single scan as proof. That sentence is the difference between a report and a panic.

Stage 3 and 4: contain, then eradicate

Containment limits damage before anything is deleted: block the source, rotate credentials, take a backup, preserve evidence. Eradication follows only after the evidence is safe, because a deleted backdoor leaves no answer to “how did they get in”.

A cleaned site with no answer to that question is a site that gets hacked again in three weeks.

Stage 5: recover without losing the business

Three options: clean, rebuild, roll back, or a hybrid. A clean is cheap and risky; a rebuild is safe and slow; a rollback is fast and loses data written since the backup.

The choice depends on what the site does, and the skill asks for it rather than deciding. A shop needs the orders from the last two hours; a brochure site needs neither.

Stage 6: 72 hours of watching

Recovery ends with a watch window: the same checks repeated for 72 hours, because a re-infection usually shows up on the first new login or the first cron run.

Without the window, “fixed” means “nothing visible yet”.

Stage 7: the report a client can read

Two documents: a client summary with what happened and what changed, and a technical report with the evidence, timeline, indicators of compromise and residual risk.

Residual risk is the part clients remember. A site that was cleaned but still runs an abandoned plugin has a risk that did not disappear with the malware.

What the first hour looks like

Versions and abandoned plugins first, because most entries come through a component nobody updated. Then users with administrator rights, then cron events that were not there before, then outgoing HTTP calls to hosts nobody recognises.

Headers and firewall posture come last, not because they do not matter, but because they explain how the site was reachable rather than how it was entered.

The safety rules that matter

Written authorisation before any work. Backup and evidence before destructive actions. Dry-run, human approval and a post-check on every write. Secrets, tokens and raw personal data never printed or committed.

The default MCP channel is read-only, and PII abilities run over REST or WP-CLI with masking. A tool that can read a user table should not be able to dump it into a chat log by accident.

What it does not do

It does not attack third parties, does not write exploits and does not hide traces. It does not promise that a site is clean, and it does not force a migration from a working security stack.

Related: privacy and confidentiality in BotBlocker for how the control plane handles data, and xml-rpc in wordpress for one of the entry points the audit checks first.