Clean an attacked website

Basic Security Steps

Since Wordpress is so popular there are a lot of drive by hacks knocking around taking advantage of flaws in basic security. All Wordpress users should take the following basic and easy steps to protect themselves:-

  • Do not use wp_ as the database table prefix, use any string of random characters that appeals.
  • Turn off Wordpress DB errors.
  • Make sure your directory's are set to chmod 755 and files 644.
  • Use a secure password generator (use at least 15 characters).
  • Do not use admin as a username.
  • Place a blank .htaccess file in the wp-admin directory.
  • Read Wordpress hardening
  • Check the Google Cache of your site for hidden malware.
  • Remove <meta name="generator" content="WordPress X.X.X" /> from your site's header by placing remove_action('wp_head', 'wp_generator'); in your functions.php file (drive by attackers will not have an easy way to find which version they are targeting).

TimThumb Hack

There also is a very popular drive by hack associated with an old version of the popular tim thumb script, which causes a lot of problems for webmasters. Check your uploads directory for php files and ensure you've upgraded to the latest version of the script to avoid this.

Advice

I run about 10 different Wordpresses and have found the WP-Security plugin and account from website defender invaluable, it scans your site regularly and reports on security errors, malware, and even page errors via email so you can be assured that you know when something goes wrong.

WP-Firewall is also very useful for defense against 0-Day exploits and VirusTotal is handy if you suspect an infection.

Akismet and Disqus.com are useful tools for defending against comment spam, and you should read the webmaster pros community wiki on this subject.

Webmaster Tools

You should also sign up to webmaster tools, but if you suspect an infection, take all steps to find and clean it up first or you may end up with Google warning your users that yours is a reported attack site.

If it detects an infection Google will send an email to all of the following addresses abuse@, admin@, administrator@, contact@, info@, postmaster@, support@, webmaster@ so you should ensure that you have at least one of these in place and monitored.

Paid Removal Services / Where To Get Help

There are also a number of sites which offer paid malware removal services, I would be very suspicious of these - many appear to be scams of one sort or another.

There is plenty of high quality help and support available for free in the wordpress forums, here on webmaster pro's, the wordpress stackexchange site and on stackoverflow. Don't pay for things you can fix on your own.


You need to completely remove every file from your website and do a fresh install of Wordpress. The odds are they uploaded files that allow them continuous access to your site. Unless you want to go file by file trying to figure out which one(s) they are a complete install from scratch is the best thing you can do.

Tags:

Botattack