Online shop (confidential) · Online retail

Removing a backdoor and a card skimmer from a WooCommerce shop

Attackers broke into a WooCommerce shop through a security hole in WordPress core. I found and removed the skimmer that stole card details at checkout, deleted the attackers’ accounts, closed the way in and prepared material for the lawyer’s report to the data protection authority.

confidential Free quote
Home page of the website: Online shop (confidential)
of the shop’s files checked, with no unknown files or accounts left after the clean-up
100%
the way in, with the security hole patched, the attacked endpoint blocked on the firewall and updates running again
closed
the exact period of the data leak, established from the logs, so that only the customers actually affected were notified
5 days

01 · Task

Task

The owner of a WooCommerce shop heard about the problem from customers. At the payment stage, an extra window appeared and asked for card details. That window came from a skimmer, a script planted in the shop that captures payment card details during a purchase and sends them to the attackers. The order still goes through normally, so the theft itself is easy to miss. The antivirus scanner installed in the shop reported several suspicious files, but deleting them changed nothing. I had to establish how the attacker had got in, what exactly they had done and how many orders had gone through the tampered payment step, and present the findings in a form the client’s lawyer could use for the report to the data protection authority.

02 · Solution

Solution

I started with the server logs rather than the files. The timeline showed a series of requests to one WordPress API endpoint. Through it, the attackers exploited a recently disclosed security hole in WordPress core, created administrator accounts and got into the admin panel without a password, using forged session cookies. A few days later, one of the groups planted the skimmer. It sat in the database, in a settings field of a plugin used for inserting scripts, which is why the file scanner could not see it.

Then I took these steps:

  • I compared all WordPress core files with the official version and checked the server for unknown files. There were no web shells, and the scanner’s alerts turned out to be false alarms.
  • I deleted the attackers’ accounts, cleared the field with the skimmer and replaced all keys and passwords for the admin panel, the database and login sessions. The stolen login details stopped working, and everyone who was logged in was logged out.
  • I found out why the shop had not installed updates: two automatic update mechanisms were blocking each other. I fixed this and checked that security updates run again.
  • I added a firewall rule that blocks the API endpoint used in the attack and updated the plugins with known security holes.
  • From the logs, I determined the actual period when the skimmer was active and the number of orders that went through it, and checked for traces of the customer database being downloaded.

03 · Result

Result

The shop is selling again, with clean code, working updates and the attack vector blocked. Instead of guesses, the client’s lawyer received material with a specific time window and a list of the orders at risk. This limited the notification to the customers who were actually affected. I describe how I handle cases like this on the WordPress malware removal page.

I reply within 24 hours

Free quote

Tell me what needs to be built or fixed. I answer every enquiry myself and do the work myself.