Skip to Content

Forensic analysis and containment of a WordPress website that kept getting reinfected

Restoring the backup didn't help. We followed the attacker through the code, the database, the server's memory and the hosting control panel, until we found the door that was still open.
26 November 2026 by
Forensic analysis and containment of a WordPress website that kept getting reinfected
Fairy | SolveIT
Sector
Confidential
Company size
Confidential
Business lines
Cybersecurity
Solutions
Cybersecurity, GDPR
The challenge

Restoring the backup didn't help: the infection came back

We were asked to help with a WordPress website that was showing content that wasn't its own. A backup had already been restored, the infection had come back and that day the home page had gone blank.

When that happens, the attacker still has a way in, in the backup or outside the website. Cleaning what you can see isn't enough: you have to find how they're getting in.

And personal data was involved. With an outsider inside the admin panel, the company had 72 hours to notify the breach to the Spanish Data Protection Agency (AEPD).

  • Find everything the attacker had left behind, including what was already gone
  • Be in time for the breach notification
In numbers

What we had to read to find it all

1 million+ lines of website and hosting logs, reviewed
15+ back doors the attacker used that were no longer on the website, rebuilt from the logs
0 antivirus detections in the back doors still on the website
<24 h to have the technical annex for the notification
How we handled it

Three days on the attacker's trail

Day 1, afternoon: the copy

We copied the website's files to an isolated server, and the database as soon as it was contained. The file and database analysis was done there, without running anything from the copy.

Day 1, night: containment

We removed the malicious code, comparing every file with the copy before touching it. We changed the WordPress and database passwords and keys and deleted the attacker's account that was still in the database.

Day 2: the panel door

The website got reinfected without going through WordPress. The hosting logs explained it: someone was coming in through the hosting panel with a valid password, in sessions linked to the attacker's. That night we found and stopped their remote access tool.

Day 3: the watchdog

They came back in through the panel, from one of the attacker's addresses, and changed the website's code to fool search engines. The watchdog we had left in place restored the code on its own.

What we found

What was inside, and what was already gone

We compared every file with its official version, where there was one, and cross-checked the website and hosting logs against the account's mailbox. What was no longer on the website was still in the logs.

Back doors everywhere

In the languages folder, in a code snippet stored in the database and inside two paid plugins of doubtful origin, which let anyone upload files without a password and were used. And more than fifteen that the attacker used and that were already gone.

A password stealer

Code added to a free plugin, set up to send out the password of every administrator who logged in.

Inside the database

With a database admin tool they uploaded themselves, the attacker queried the database and added an administrator account by hand.

Remote access, still running

Its files had already been deleted, but the process was still alive in the hosting account, next to a program of theirs stored in the server's memory. We stopped the process and deleted the program, keeping a copy as evidence.

Password recovery in their hands

When someone changed the hosting panel password on them, they got it back in a couple of minutes: they had access to the recovery code.

Fake dates

New files with old dates so they would go unnoticed. No file date could be used, on its own, to date the attack.

The reinfection

The door wasn't in WordPress

The new code only fooled search engines. Google and mobile phones from one particular country were shown spam; every other visitor saw the usual website. An infection like that can go on for a long time without anyone at the company noticing.

There was nothing in the WordPress logs. No login to the panel, no odd requests. The hosting logs did have it: the change was made with the file manager in the hosting panel, using a valid password, and the sessions came from different rented servers and VPNs. Everything points to a single actor.

Changing the panel password wasn't enough. The attacker had already got it back once in a couple of minutes. The recovery route has to be closed first, and that's done from the hosting account itself. In the meantime, we put the original code back and stepped up monitoring.

What nobody was seeing

Lost alerts, lost forms

More than two hundred security alerts reached nobody. The website's security system was sending alerts, but to an address that bounced them. And its firewall was in learning mode: it logged attacks and blocked none of them. We left it blocking, and turned off installing and editing code from the WordPress panel.

The website's forms hadn't been arriving for weeks. The company's own email was rejecting them because of how its domain was set up, and they were piling up in a mailbox on the hosting account, within the attacker's reach. With visitors' details inside.

The technical annex for the notification, in under 24 hours. What had happened, what data could have been within the attacker's reach and what had been done to stop it, within the 72 hours the GDPR allows for notifying the AEPD. When the analysis found more, like the forms, we kept correcting it.

What we learned

What would have changed this story

Cleaning WordPress isn't enough if the hosting account is compromised. The website was clean and got reinfected from the hosting panel. The passwords in both places are changed together, and two-step verification is turned on in both.

Before changing a password, check where its recovery goes. If the attacker controls it, the new password lasts them minutes.

The antivirus didn't find any of the back doors on the website. What found them was comparing every file with its official version, reading the code and reading the logs.

A pirated plugin is a door you don't know who opened. So is one that hasn't been updated.

An alert that reaches nobody is no use. Neither a security alert nor a customer's form.

The independent reviews found what we had missed. Two back doors, the remote access tool and more. An incident analysis isn't closed without one.

If you want to see how we handle the security of your systems, take a look at our cybersecurityline; if an incident involves personal data, the GDPR side is handled by the same team.

Has your website been reinfected after restoring it?

Tell us what's happening. The first step is a copy, before touching anything.