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 SecurityWordPress is frequently the target of malicious attacks by hackers.

In early 2013 a global brute-force attack began hitting WordPress installations across almost every WP host server in existence.

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

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

What Are Brute-Force Attacks?

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 will attempt to break into a WordPress site is by trying to guess the site’s administration login username and password. This can be achieved with software tools that automatically tries to guess hundreds of login permutations in minutes.

If you’re not using strong usernames or unguessable passwords, your site could be an easy target for hackers.

This is called a “brute force” attack.

Botnet Definition

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/botnet)

A “Botnet” is a network of computers that have been infected with malicious scripts or software, which are then controlled remotely as a group, typically without the computer owners even being aware that this is happening.

Botnets are normally used used to blast out mass spam emails.

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

ZeuS is 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 globe since 2009. Screenshot image: SecureList.com)

These were highly distributed and well organized attacks on WordPress sites. Over 90,000 IP addresses were identified by a number of webhosting companies just in the initial attack, when the web was flooded with millions of attempts to force their way into WordPress site admin areas. The mass brute force attacks then continued, with over 30,000 WordPress blogs being hacked each day.

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

Powering millions of websites worldwide makes WordPress an obvious target for attempted attacks by hackers

(WordPress often is targeted by hackers)

Does This Mean We Should Stop Using WordPress?

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

We explain why WordPress is a secure platform for websites in this article: How Secure Is WordPress?

Important

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

Mike Little, one of the co-founders of WordPress, 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 Protect Your WordPress Site From Being Brute-Force Attacked – Ten Security Measures

You may think that your site has nothing to offer to hackers, but the reality is that every website has value to a malicious user.

If someone can discover a security weakness that allows them to access and take over your blog, your web site can then be used to target more highly-valued sites.

Additional undesirable impacts of being hacked and your site security compromised include getting blacklisted by Google, having spammy links advertising things like casinos, discounted fashion, etc. in your content and page title and descriptions, redirecting visitors to phishing sites or other websites, data exfiltration (stealing information or Personal Identifiable Information from your web applications), and lots of other nasties.

The harsh reality is that brute-force software bots are very likely trying to hack into your website at this very moment. Whether they will be successful depends on how difficult you will make it for hackers to keep persisting until they can discover a way to get in, or give up and decide to look for a more vulnerable target.

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

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

Hackertarget - Website Security Scan(WP Security Scan Source: Hackertarget.com)

You will see that the check will yield various results and details about your website setup …

Hackertarget - WP Security Scan

(Hackertarget – WordPress security check results. Source: Hackertarget.com)

It should be obvious after using the above tool that if you are able to freely access all of this information, then so can hackers.

WP Security Scan(Screenshot image: BlogDefender website)

Being able to see which version of WordPress you are using, which plugins and themes you have installed, and which files have been uploaded to certain directories can all be potentially valuable information to hackers, as this informs them about potentially exploitable security vulnerabilities, especially in older versions.

If your website is driven by WordPress and you’re not proactive steps to bolster the security of your site, then we can practically guarantee that, at some time in the near future, your site will be hacked, or at least targeted by bots, because these attacks are systematically targeting WordPress installations worldwide!

Typically, whenever a site gets compromised, blog owners will discover much to their dismay that they have been “locked out” of their own site, or notice that their content has been altered or even entirely wiped out. Often, sites will be infected with malicious software without the owner even being aware that this has happened.

To avoid the heartache and aggravation (and potential financial loss) that comes with having your website or blog being hacked into, below are 10 simple, yet essential and effective security checks that will help to prevent your WordPress site from being brute-force attacked.

Note

Note: Some of the recommended steps listed below require some technical skills to modify core WordPress and server files. If you have no web coding skills, or don’t want to mess around with code on your site, then ask your web host or search for a professional WordPress service provider in our WordPress Services Directory.

***

Security Measure #1 – Contact Your Webhosting Service

Contact your hosting provider and ask them what security systems are in place to help prevent your site from botnet attacks, and what they do to make sure that your WordPress sites get backed up.

It’s important to check that your hosting provider backs up your sites and that, if anything goes wrong, you can quickly and easily get back your site.

Security Measure #2 – Back Up Your WordPress Data And Files And Keep Your Website Frequently Up-To-Date

You should never rely on your hosting service provider for your site backups. Instead, learn how to manage your WordPress site or pay someone to get this done for you and maintain a habit of performing a full site maintenance routine frequently (e.g. weekly, fortnightly, etc …)

A complete WordPress maintenance routine ensures that:

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

A proper WordPress maintenance routine looks like this …

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

Again, we cannot stress enough how vitally important it is to maintain your WP website or blog backed up and updated. WordPress maintenance is not hard or time-consuming, but it must be done to ensure the security of your website or blog. If you don’t want to learn how to do WordPress 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 perform manual backups, there are a number of plugins you can use. Learn about a WordPress backup plugin that can automate your backup process here: Backup, Copy & Keep Your WordPress Website Protected With Backup Creator Plugin For WordPress

Security Measure #3 – Do Not Use “Admin” As The Admin Username

The mass brute force botnet attack on WordPress is mostly attempting to compromise site admin panels and gain access to sites by exploiting installations using “admin” as their username.

For website security purposes, avoid setting up a WordPress site with the username “admin”. This is the first thing hackers will test. If your blog’s user name is “admin”, then change this immediately.

We have created a step-by-step tutorial on how to change your admin username here: How To Change Your WordPress Admin Username To A More Secure Username

Security Measure #4 – Choose Strong Passwords

A “brute force” attack occurs when a malicious script persistently tries to guess the right username and password characters that will unlock your site.

Unless some measure is put into place to stop the brute force attack from happening (see further below for a couple of effective ways to do this), the “bot” will just persist in attacking your site until it eventually “cracks” the code.

Weak passwords, therefore, make very easy targets for hackers. Make sure that you change your password combination to something that contains at least 8 or 9 characters long, with upper and lowercase letters, combined with a few “special” characters (%^#$@&*).

Useful Tip

Roboform is a password management tool that lets you easily generate secure passwords …

You can use a password software tool like Roboform to generate hard-to-crack passwords(You can use a password program like Roboform to generate passwords)

For a tutorial for WP admin users that shows you how to change your login password, go here: Changing Passwords

Security Measure #5 – Prevent Your wp-config.php File From Being Visible

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

wp-config.php file

(WordPress WP Config file)

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

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

Security Measure #6 – Rename Or Delete Unnecessary WordPress Installation Files

Delete or rename your install.php, upgrade.php and readme.html files.

You can remove these files after installation. If you don’t want to remove these files, then just rename them.

Security Measure #7 – Keep Your WordPress Blog, Plugins & Themes Up-To-Date

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

Ensure that all of your WordPress software files, plugins, themes, etc. are always up to date.

Security Measure #8 – Disable The WordPress Theme Editor

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

In WordPress, you can access the WordPress Theme Editor by selecting Appearance > Editor in your admin menu …

WordPress Theme Editor Menu

(Accessing the WordPress theme editor using the dashboard menu)

The WordPress theme editor feature allows anyone accessing your blog to view and modify all of your WordPress theme templates, or cause havoc on your site.

If you want to prevent unauthorized people from being able to access your 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 – Remove Access To Your WordPress Uploads Folder

The “uploads” folder contains all the media that gets uploaded to your WordPress site.

Normally, this folder is visible to online users. All a person needs to do to view the contents stored in the “uploads” directory is navigate to your directory using their web browser …

(WordPress uploads directory)

(WordPress has an uploads folder where your media files are stored)

If any directories in your website have weaknesses or vulnerabilities that can be exploited by hackers, someone can upload unauthorized file types to your site.

Protecting your directories will prevent online users from accessing your ‘uploads’ folder and other important directories. This can be done using plugins, setting file permissions, adding a blank index.php file (this is literally a file with nothing in it called “index.php”) to your uploads directory, and so on. Again, it’s best to ask for assistance from someone with experience if you are unsure about what to do.

Security Measure #10 – Use WordPress Security Plugins

Several security plugins for WordPress are available that specifically address common security issues faced by WordPress site owners, such as preventing unauthorized users from gaining access to vital areas of your site, protecting your files from brute-force attacks, preventing injections of code into files, etc.

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

SecureScanPro - complete security plugin for WordPress

(SecureScanPro – complete security plugin for WordPress)

SecureScanPro is easy to install and easy to use, and does a great job of fixing most of the security issues that WordPress users need to address.

Another great security plugin you may want to consider using is BlogDefender.

Blog Defender

Blog Defender(Blog Defender WordPress Security Product Suite)

Blog Defender is a suite of WordPress security video tutorials, WordPress plugins and tools, plus a WordPress security PDF/DOC file.

BlogDefender shows you where potential security holes in your web site are …

Blog Defender Security SuiteAnd then shows you how to easily fix these …

Blog Defender WordPress Security SuiteIf you don’t want to invest in a premium 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 platform, but neglecting simple maintenance tasks like keeping your WordPress core files, WordPress plugins and WP themes updated to their latest versions, tightening file and data protection and taking other necessary precautions can expose your site 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 afford to ignore the importance of securing your web sites.

As one last reminder of the importance of keeping your websites protected, 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, WordPress security is of the utmost importance if you run a WordPress site. Hopefully, the information in this article has provided you with the initial steps you need to take 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 professional WordPress service provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to receive notifications via email when we publish new information on WordPress security and reviews of new security plugins.

***

"Wow! I never knew there's so much to learn about WordPress! I bought one of the WordPress for Dummies three years ago, such authors need to be on this course!" - Rich Law, Create A Blog Now

***