How To Protect Your WordPress Site From A Brute-Force Attack

Learn how to protect your WordPress site from being brute-force attacked, or having its security compromised by hackers or bots.

WP SecurityWhen you are the world’s most popular CMS platform and the online publishing platform of choice used by millions of websites and loved by thousands of web developers and website designers, it’s inevitable that at some point in time, WordPress will come under attack from hackers.

In April 2013, WordPress installations around the world were subjected to a worldwide brute force attack.

These attacks were caused by botnets (networks of infected computers programmed to attack other computers).

How To Protect Your WordPress Site From A Brute-Force Attack

Brute Force Attacks – An Overview

A brute-force attack is a technique used to break an encryption or authentication system by trying all possibilities.

(Source: Chinese University Of Hong Kong)

One of the many ways hackers use to try and break into WordPress sites is by trying to guess the site admin’s login username and password. This is done using software tools that can work through hundreds of possible login combinations in minutes.

If you’re using weak usernames and passwords that are easy to guess, your website could be an easy target for hacking attempts.

This is called a “brute force” attack.

Botnets – What Are They?

A botnet is a number of Internet-connected computers communicating with other similar machines in an effort to complete repetitive tasks and objectives. This can be as mundane as keeping control of an Internet Relay Chat (IRC) channel, or it could be used to send spam email or participate in distributed denial-of-service attacks. The word botnet is a combination of the words robot and network.

(Source: Wikipedia)

A “Botnet” is a network of private computers that have been infected with malicious software, which are then controlled remotely as a group, typically without the unsuspecting computer owners’ knowledge or awareness.

Botnets are regularly used to send out mass spam emails from the infected computers of compromised user accounts.

Below is a screenshot taken from an internet security monitoring site showing the locations of the command centers of ZeuS – a botnet that has been actively compromising computer networks all around the globe since 2009 …

The Zeus botnet has been actively compromising computer networks all around the world since 2009.

(The Zeus botnet has been actively infecting computer networks all around the world since 2009. Source: SecureList.com)

These were well organized and highly distributed attacks. Over 90,000 IP addresses were identified by a number of hosting companies in the initial attack alone, when millions of attempts to force their way into WordPress user admin areas took place. The brute-force attacks continued after this, with over 30,000 WordPress sites being hacked each day.

Coverage of this brute force botnet attack was reported by all the major webhosting companies, as well as the leading technology media publications, such as TechNews Daily, Forbes, Tech Crunch, BBC News, PC Magazine, and even on the official website of the US Department of Homeland Security …

WordPress powers millions of sites around the world, making it a target for hackers

(WordPress often is targeted by hackers, due to its popularity)

Does This Mean We Should Stop Using WordPress?

No. In fact, there are lots of good reasons why you should continue using WordPress if you are concerned at all about the security of your web presence.

To understand why WordPress is a secure platform for websites, see this article: Are Open Source Web Platforms Like WordPress Secure?

Important

It’s important to note that, in the case of April 2013 mass brute-force botnet attack described above, was no specific vulnerability in WordPress being exploited (the same script was also targeting sites built using applications like Joomla).

Mike Little, the co-founder of WordPress with Matt Mullenweg, said this about the brute-force attacks:

It is a “simple” script that attempts to login using the admin login and a generated password. So if your password is too short or based on dictionary words it will be guessed and then the script can login legitimately and do whatever it wants including installing scripts (as plugins) or editing files. The attack tries to guess your password, if it succeeds, the most secure site in the world is wide open because they have your password.

(MikeLittle.org)

How To Prevent Your WordPress Site From Being Brute-Force Attacked – Ten Security Measures

Every blog with a vulnerability provides some type of opportunity to hackers. No site is guaranteed immunity from cyber attacks. Corporate web sites, personal blogs, government sites … even web sites owned by online security and anti-hacking experts can and have been targeted.

If someone can discover a way to take over your site, the web site can then be employed as part of a larger network of “bots” to target larger and more valued websites.

Additional undesirable effects of being hacked and your site security compromised include being blacklisted by search engines, having stealthy spam links advertising things like online meds, cheap offers on brand names, etc. inserted in your content and page title and descriptions, redirecting visitors to phishing sites and other websites, drive-by downloads (adding malicious software on your visitors’ computers), and lots of other nasties.

The reality is that brute-force software bots are probably trying to break into your website or blog as you are reading these very words. Whether they will hack in or not, depends on how difficult you can make things for hackers to keep persisting until they either find how to get access, or are forced to give up and go look for a less protected target.

How Much Information Are You Broadcasting To Hackers About Your WordPress Site?

If you visit a site like Hackertarget.com and run your website through their WordPress security scan …

Website Security Check(WP Security Scan Image source: Hackertarget.com)

You will see that the test returns a number of results and information about your WordPress installation …

WP Security Check

(Hackertarget – WordPress security scan results. Image source: Hackertarget.com)

It should be obvious after using the tool shown above that if you can see all of this information about your WordPress site, hackers can too.

Website Security Check(Screenshot image: BlogDefender.com)

The ability to see what version of WordPress you are using, which plugins and themes you have installed, and which files have been uploaded to certain directories can be potentially valuable information to hackers, as this informs them about any exploitable holes or weaknesses, especially where the owners haven’t updated their sites.

If your website runs on WordPress and you are not taking appropriate steps to toughen up your site, we can practically guarantee that, at some point, someone will attempt to hack your installation, because these brute force attacks are systematically hitting WordPress installations all the world!

Typically, when a site is compromised, webmasters will discover much to their dismay that they have been “locked out” of their own site, or notice that their files have been altered or even that their content has been entirely wiped out. Often, sites will be infected with malicious scripts or viruses without the owner even being aware that this has occurred.

To avoid the heartache of discovering that your website or blog has been hacked into, below are 10 essential and effective security checks that will help to prevent your WordPress site from brute force attacks.

Important Info

Note: A few of the measures shown below require some technical understanding of how to modify core WordPress and/or server files. If you have no technical skills, or don’t want to mess around with code on your site, then ask your web host or search for a WordPress service provider in our WordPress Services Directory.

***

Security Measure #1 – Contact Your Webhosting Service Provider

Contact your hosting provider and ask them exactly what precautions they have put into place to protect your site from botnet attacks, and what is done to ensure that your WordPress sites are being backed up.

It is important to make sure that your hosting service backs up your server files and that, if anything should happen, you can quickly and easily get back your files.

Security Measure #2 – Perform Full WordPress Backups And Keep Your Site Regularly Up-To-Date

You should never rely just on your hosting company for site backups. Instead, learn how to maintain and manage your WordPress site or pay someone to get this service done for you and maintain a habit of religiously performing a complete site maintenance routine on a frequent basis (e.g. weekly, monthly, etc …)

A full WordPress maintenance routine ensures that:

  • All unnecessary data and files are removed,
  • All WordPress data and files are free of errors, optimized and backed up,
  • All WP software, themes and plugins are up-to-date,
  • etc …

A full WordPress maintenance routine looks like this …

Maintaining your WP site fully backed up and up-to-date is vitally important for WordPress security.(Maintaining your WordPress website completely backed up and up-to-date is vitally important for WordPress security. Screenshot image: WPTrainMe.com)

Again, we cannot stress enough how important maintaining your WP web site backed up and up-to-date is. WordPress maintenance is not hard or time-consuming, but it must be done to ensure the security of your website or blog. If you do not want to learn how to do WP site maintenance yourself, get someone else to do it but make sure it gets done. Backing up your website is the next most important thing you must do after making sure that you are still breathing!

If you don’t want to back up your site manually, there are a number of WordPress plugins you can use. You can read about a WordPress backup plugin that can fully automate your backup process here: Back Up, Duplicate & Keep Your WP Website Protected With Backup Creator Plugin For WordPress

Security Measure #3 – Make Sure That Your Username Is Not “Admin”

the worldwide brute force botnet attack on WordPress is mostly attempting to compromise site administrator panels by exploiting sites with “admin” as their account name.

For security reasons, never set up a WordPress site with the username “admin”. This is the first area of potential vulnerability hackers will test. If your site’s user name is admin, change this immediately.

For a tutorial created especially for non-technical admin users that shows you how to change your WordPress admin username, go here: Changing Your Admin User Name In WordPress To A Different User Name

Security Measure #4 – Avoid Weak Passwords

A “brute force” attack occurs when malicious software continually hits a login or password field with different character strings trying to guess the right combination that will unlock your website.

Unless some measure is put into place to prevent the brute force attack (see further below for a couple of effective suggestions for doing this), the “bot” will just continue to attack your site until it eventually works out the combination.

Passwords that are easy to guess, therefore, are very easy targets for attacks. Make sure that you change your password combination to something that contains at least eight or nine characters long, with upper and lowercase letters, combined with “special” characters (^%$#&@*).

Practical Tip

You can use a password tool like Roboform to help you generate secure passwords …

You can use a password management software tool like Roboform to create unguessable passwords(You can use a password management software tool like Roboform to generate very secure passwords)

For a simple step-by-step tutorial on how to change your admin password, go here: What To Do If You Need To Reset WordPress Passwords

Security Measure #5 – Prevent Access To The wp-config.php File

The wp-config.php file contains important information about your site’s database and is used to define advanced options for WordPress.

wp-config.php

(wp-config.php file)

If hackers break into your WordPress site, they will typically search for your wp-config.php file, because this is the file that contains your database information, security keys, etc. Getting access to this information would allow a hacker to change anything in your database, create a user account, upload files and take control of your site.

In order to protect your WordPress site from attacks and even being used as part of a bot net, therefore, prevent your wp-config.php file from being easily accessible. This requires knowing how to edit database information, move files around in your server and changing access permissions.

Security Measure #6 – Delete Or Rename Unnecessary Installation Files

Rename or delete the install.php, upgrade.php and readme.html files from your server.

These files are completely unnecessary after installation and can be deleted. If you don’t want to delete these files, just rename them.

Security Measure #7 – Update Your WordPress Site, Themes & Plugins

Hackers are always on the lookout for vulnerabilities they can exploit in earlier versions of WordPress, including outdated versions of WP themes and plugins.

Make sure to always keep your software files, themes, plugins, etc. up-to-date.

Security Measure #8 – Disable The Theme Editor

WordPress comes with a built-in editor feature that lets the site administrator edit theme and plugin code from the dashboard area.

You can access your WordPress Theme Editor by selecting Appearance > Editor in the dashboard menu …

WP Theme Editor Menu

(Accessing the WordPress theme editor via the admin menu)

The WordPress theme feature lets anyone accessing your blog’s admin area view and change your theme files, and create havoc on your site.

To prevent people from being able to access the WordPress Theme editor, you will need to disable it. This can be done by adding code to your wp-config.php file.

Security Measure #9 – Protect The Site’s Uploads Directory

The “uploads” folder contains all the media files that get uploaded to your website.

By default, this folder is visible to online users. All a person needs to do to view all of the contents stored in your “uploads” directory is visit your directory using their browser …

(WordPress uploads folder)

(WordPress uploads folder)

If any directories in your website have vulnerabilities that can be exploited by malicious users, this could become a serious threat to the security of your website.

Protecting your directories will prevent unauthorized people from accessing your ‘uploads’ folder and other important directories. This can be done using plugins, setting file permissions, uploading a blank index.php file (this is literally a blank file named “index.php”) to your uploads directory, and so on. Again, it’s best to hire a professional if you are not sure about what to do.

Security Measure #10 – WordPress Security Plugins

There are a number of great WordPress security plugins available that will address most common security issues faced by WordPress site owners, such as preventing unauthorized users from gaining access to vital information about your site, protecting your website from botnets, preventing unauthorized file uploads, etc.

Many WordPress plugins address some but not all areas of WordPress security. One plugin that does a comprehensive job of scanning, fixing and preventing issues that could lead to hackers accessing your files and causing damage to your site is SecureScanPro.

SecureScanPro - total security software for WordPress

(SecureScanPro – WP complete security plugin)

SecureScanPro is easy to install and easy to use, and takes care of most of the security areas that WordPress users need to address.

Another plugin you may want to look at using is BlogDefender.

Blog Defender Security Suite

Blog Defender(Blog Defender)

This product is a suite of WordPress security video tutorials, WordPress plugins and tools, plus WordPress security documentation in PDF and DOC formats.

BlogDefender shows you where the security weaknesses in your WordPress installation are …

Blog Defender WordPress Security SuiteAnd lets you quickly fix these …

Blog DefenderIf you don’t want to purchase a security plugin like SecureScanPro or BlogDefender, then use various free plugins, such as Limit Login Attempts

Limit Login Attempts - WordPress Security Plugin

WordPress is a very secure web platform, but neglecting essential maintenance tasks like updating your WordPress software, plugins and WordPress themes, tightening file and data protection and taking other necessary precautions can expose your website to malicious by hackers and bots.

Regardless of the kind of business you run or plan to run online and how small you think your web presence is, you cannot ignore the importance of securing your sites.

As a final reminder, below is the advice given by an expert on website security to all WordPress users after the mass brute force attacks by botnets on WordPress in April 2013 …

Owners of websites based on WordPress CMS must improve at least basic security settings and implement best practices such as the use of robust passwords and the accurate management of “admin” accounts.

Pierluigi Paganini, Chief Information Security Officer, Security Affairs

***

As you can see, website security is very important if you run a WordPress site. Hopefully, this article has shown you what to do to prevent brute force attacks on your WordPress site. If you need any further help or assistance with WordPress security, please seek help from a professional WordPress security specialist, or search for a WordPress service provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to be notified whenever we publish new tips on WordPress security and reviews of WordPress security plugins.

***

"These tutorials have so much information and are easy to understand. If you use WordPress or plan to in the future these will help you with everything you need to know." - Valisa (Mesa, Arizona)

***