Wordpress Sites Forwarding To Unknown Domain

Hi DigitalOcean, I’m running Ubuntu 20.04 with a LEMP stack. There are two WordPress sites on this Droplet. I recently added the second, and wonder if somehow the WordPress site was compromised, because now both sites are unresponsive, when attempting to visit either site, they both forward to a crypto-based website (Virus?)

Can you help troubleshoot this issue?

Thanks, W

Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

Thanks, Bobby.

I solved the issue by:

  1. Deleting all files inside /var/www/ where the infected files were placed
  2. Uploading fresh versions of the files via sftp
  3. Resetting passwords, including mysql database user password
  4. Following your instructions above to create .htaccess files
  5. And adding a reCaptcha in the login page
Bobby Iliev
Site Moderator
Site Moderator badge
November 16, 2020

Hi there @willbeing,

Yes indeed, this sounds like the sites might have been compromised.

What I could suggest is running a scan for both websites, you could use a plugin like Wordfence to do so. Another option is to scan both sites with software like Maldet for example.

If you are unable to clear the malicious content, the safest bet would to restore a backup of your sites to a clean state. And then follow the steps from this answer here on how to secure your websites:

Regards, Bobby

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.