Categories: Tips and Tricks

In this post I'll discuss my first hand experience using Claude-code to:

  1. Provision a pre-existing WordPress website from WPEngine to my local machine in a Docker instance.
  2. Remediate that site because it was compromised by an attacker.
  3. Redeploy to WPEngine.

I have personally done dozens of full-scale remediations of WordPress websites but never with AI or something as integrated as Claude-code. So my mission on this client project was to evaluate how Claude-code and ChatGPT would streamline the process, enhance it with more precision and fewer mistakes, and automate retrieval of sites to a secure environment to run audits, evalute and execute solutions, and then re-deploy with the fixes.

 

What was the problem?

The website was being redirected to another site. The website itself didn't appear to be a scam, rather it appeared that the script was trying to drive false traffic or link juice to the domain.

 

What was the cause?

I am still evaluating the whole thing but it is definitely atp.php file that is public and anyone can visit. Upon doing so it executes code. How it got there I have not determined but it's a common file after attacks and likely an SQL injection throguh the contact form.

 

What did I use AI to do?

  • I wrote a prompt to deploy the zipped site and it's database into a Docker container on my machine.
  • Then I give it explicit instruction to use ClamAV, MalDav and WPScan to scan it and report to me the problem.

 

What could I have done differently?

  • I could have had Claude connect to WPEngine via SFTP and MySQL or possibly Git, to clone the application down instead of manually downloading it.

 

What challenges did I face?

  • While Claude was able to easily create the Docker container and deploy WordPress to it and get it available at localhost:8080, it struggled to copy all the site files and import the database.
    • I suppose the solution would be more context and explicit instruction. But it seems obvious to me it would know and overcome this.
  • Because of this I had to manually have it create a user for me, to then login and see in Plugins everything was missing. Then I gave it instruction to reimport all files. Then a separate prompt to import the database.
  • But when it reimported the database it broke everything again. Meaning the front end was completely unreachable.