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.

WordPress SecurityPowering millions of websites worldwide makes WordPress a natural target for hacking.

In April 2013, WordPress installations around the world were subjected to global-scale brute force attacks.

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

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

Brute Force Attacks – Definition

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 WordPress sites is by trying to guess the site’s administration login username and password. To do this, hackers use software tools and scripts that automatically tries to guess hundreds of login combinations in minutes.

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

This is called a “brute-force” attack.

Botnet – What Is This?

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.org)

A “Botnet” is a network of private computers that have been compromised and infected with malicious code or software, which can then be controlled remotely as a group, often without the computer owners’ knowledge or awareness.

Botnets are often used to send mass spam emails.

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

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

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

The ongoing botnet attacks were well organized and highly distributed. Over 90,000 IP addresses were identified by several hosting companies just in the initial attack, when the web was flooded with millions of attempts to force their way into WordPress site administration areas. The attacks then continued, with over 30,000 WordPress sites being hacked per day.

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

WordPress is the world's most popular CMS making it a natural target for hackers

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

Does This Mean We Should Stop Using WordPress?

No. In fact, there are many very good reasons why you should continue using WordPress if you are concerned at all about the security of your online business.

We explain why WordPress is a secure platform for websites in this article: Can You Build A Secure Business Online Using WordPress?

Info

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

Mike Little, one of the co-founders of WordPress, made this comment about the botnet 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)

Protecting Your WordPress Site From Being Brute-Force Attacked – Ten Security Points

Every web site with a security vulnerability can present an opportunity to hackers. Every website has some value to hackers. Corporate web sites, personal blogs, government websites … even sites owned by online security experts can and have been targeted.

If a malicious user can exploit a way to gain complete control of your website, that web site can then be used as a “bot” in a planned cyber-attack against more valued web sites.

Additional undesirable consequences of being hacked include getting blacklisted by search engines, having spammy links advertising things like online meds, porn, etc. inserted into your content, redirecting visitors to phishing sites, data exfiltration (stealing customer details or Personal Identifiable Information from your web applications), and lots of other nasty things.

The truth is that software-driven bots are most likely searching for security weaknesses and trying to break into your blog as you are reading these very words. Whether they can achieve this or not, will depend on how difficult or easy you have made things for hackers to keep trying until they discover how to get access, or give up and go look for a less protected target.

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

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

Hackertarget - Website Security Check(Website Security Check Screenshot source: Hackertarget.com)

You will see that the check returns a number of results and information about your site …

WP Security Scan

(WordPress security check results. Image source: Hackertarget.com)

It should be obvious after using the tool shown above that if you can freely access all of this information about your blog, then so can hackers.

WP Security Check(Screenshot source: BlogDefender website)

The ability to see which version of WordPress you are using, which plugins and themes you have installed on your site, and which files have been uploaded to certain directories can be useful information to hackers, as these can inform them about any exploitable holes or weaknesses, especially where site owners haven’t updated their sites.

If your website runs on WordPress and you are not proactive steps to harden your site, then we can practically guarantee that, at some point, someone will attempt to hack your site, because these brute force attacks are systematically targeting WordPress installations worldwide!

When a website is compromised, site owners will find themselves completely “locked out” of their own site, or notice that their files have been modified or even that their content has been entirely wiped out. Typically, compromised sites will be infected with malicious software without the owner even being aware that a breach has taken place.

To avoid the heartache and frustration that comes with having your website or blog being hacked into, below are ten simple, yet essential and effective security measures that will help to protect your WordPress site from brute force attacks.

Important

Note: A few of the recommended measures shown below need some technical skills to modify core WordPress and server files. If you have no web skills, or don’t want to mess around with file code, then ask your web host or a professional WordPress service provider for help.

***

Security Measure #1 – Contact Your Hosting Service

Contact your host and ask them exactly what security precautions are in place to help prevent your site from botnet attacks, and what they are doing to make sure that your server files and data are being backed up.

Make sure that your hosting provider backs up your server files and that, if anything should happen, you can quickly and easily get your files back.

Security Measure #2 – Back Up Your WordPress Data And Files And Keep Your Site Regularly Updated

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

A full WordPress maintenance routine ensures that:

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

A full WordPress maintenance routine looks like this …

Maintaining your WP site regularly backed up and up-to-date is vitally important for WordPress security.(Maintaining your WP site completely backed up and updated is vitally important for WordPress security. Source: WPTrainMe.com)

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

If you don’t want to back up your files manually, there are many WordPress plugins you can use. Learn about a WordPress backup plugin that can fully automate your backup process here: Back Up, Duplicate & Keep Your WordPress Web Site Protected With Backup Creator WP Plugin

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

The mass brute force botnet attack on WordPress sites was mostly attempting to compromise website administrator panels and gain access to sites by exploiting installations that used “admin” as their user name.

For website security reasons, avoid installing sites with the username “admin”. This is the first area of potential vulnerability hackers will test. If your blog’s username is “admin”, change this immediately.

For a simple tutorial created especially for WordPress admin users that shows you how to change your admin username, go here: How To Change Your WP User Name From Admin To Another Username

Security Measure #4 – Your Password

A “brute force” attack occurs when malicious software persistently tries to guess the right combination of password and username characters that will give them access to your website.

Unless some measure is put into place to block the brute-force attack from happening (see further below for a couple of simple and effective ways to do this), the “bot” will just keep attacking your site until it eventually breaks into your admin area.

Weak passwords, therefore, become very easy targets for brute-force attacks. Make sure that you change your password combination to something that is at least 8 characters long, with both upper and lowercase letters, combined with a few “special” characters (e.g. ^, $, &, etc).

Tip

If you have trouble coming up with strong passwords or are reluctant to set up different passwords for all your online logins, then use a password tool like Roboform …

Roboform is a password management software you can use to create different secure passwords(Roboform is a password management tool that lets you create really secure passwords)

We have created a simple tutorial on how to change your login password here: Changing Your WordPress Password

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

The wp-config.php file allows WordPress to communicate with the database to store and retrieve data and is used to define advanced WordPress options.

WordPress WP Config file

(WordPress WP Config file)

If a hacker breaks into your site, they will typically look for your wp-config.php file, because this file contains your database information, 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.

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 – Rename Or Delete Unnecessary WordPress Installation Files

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

These files can be removed after installation. If you don’t want to delete these files, then just rename them.

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

Hackers look for vulnerabilities they can exploit in earlier versions of WordPress, including out-of-date versions of WordPress plugins and themes.

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

Security Measure #8 – Disable Your Theme Editor

WordPress installations come with a built-in editor that lets you edit theme and plugin code from the dashboard.

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

WordPress Theme Editor Menu

(The WordPress theme editor is accessible using the WordPress main menu)

The WordPress theme feature lets anyone accessing your blog view and change your WordPress theme files, and cause havoc on your site.

If you want 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 – Remove Access To Your Site’s Uploads Folder

The WordPress “uploads” directory 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 see all of the contents in your site’s “uploads” directory is visit the directory using a web browser …

(WordPress has an uploads directory where media content is stored)

(WordPress has an uploads directory where media content is stored)

If any files stored in his folder have vulnerabilities that can be exploited by malicious users, this can become a serious threat to the security of 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, uploading a blank index.php file (this is literally a blank file called “index.php”) to your uploads directory, and so on. Again, it’s best to get professional help if you are not sure about what to do.

Security Measure #10 – WordPress Security Plugins

A number of WordPress security plugins are available that will address common security issues WordPress website owners face, such as preventing unauthorized users from gaining access to vital areas of your site, protecting your files from malicious exploits, preventing injections of code into files, etc.

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

SecureScanPro - security plugin for WordPress

(SecureScanPro – total security software solution for WordPress)

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

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

Blog Defender

Blog Defender Security Suite For WordPress Web Sites(Blog Defender WordPress Security Plugin)

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 the security weaknesses in your website are …

Blog Defender Security Product Suite For WordPressAnd lets you quickly fix these …

Blog DefenderIf you don’t want to purchase a premium security plugin like SecureScanPro or BlogDefender, then use various free WP 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 themes up-to-date, tightening file and data security and taking other necessary precautions can expose your site to attacks 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, securing your websites is something you simply cannot afford to ignore.

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 of the utmost importance if you run a WordPress site. Hopefully, the information in this article will help prevent brute-force attacks on your WordPress site. If you need any further help or assistance with WordPress security, please consult a professional WordPress security specialist, or search for a professional WordPress technical provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to receive notifications when we publish new articles and tutorials on WordPress security and reviews of new security plugins and solutions.

***

"This is AMAZING! I had learnt about how to use WordPress previously, but this covers absolutely everything and more!! Incredible value! Thank you!" - Monique, Warrior Forum

***