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 SecurityWhen you are the leading content management system in the world and the preferred online publishing platform for millions of businesses and loved by thousands of web developers and web designers, it’s inevitable that at some point in time, WordPress will come under attack from hackers wanting to score a “big win”.

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

These attacks were caused by computers infected with malware and programmed to attack other installations (called “botnets”).

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

About 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)

There are many ways hackers try to break into a WordPress site. One of these is by trying to guess the site’s administration login username and password. To achieve this, hackers use software tools that automatically tries to guess hundreds of possible login combinations in minutes.

If you’re using easy-to-guess login details, your website could be an easy target for hacking attempts.

This is called a “brute force” login 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.org)

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

Botnets are typically used to blast mass spam emails.

The screenshot below was taken from a site that monitors online security showing the locations of the command centers of a botnet that has been actively infecting computer networks all around the globe since 2009 called “Zeus” …

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 world since 2009. Screenshot source: SecureList.com)

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

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

Powering millions of sites worldwide makes WordPress a target for hacking attempts

(WordPress is often the target of worldwide attacks by hackers, due to its global popularity)

Does This Mean We Shouldn’t Use WordPress Anymore?

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

To learn what makes WordPress a very secure web platform, see this article: How Secure Is WordPress?

Important

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

Mike Little, one of the co-founders of WordPress, made the following 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 Brute-Force Attacks – 10 Security Checks

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

If a malicious user can exploit a vulnerability and take over your web site, that website can then be employed as a “bot” to attack more highly-valued sites.

Additional undesirable consequences of having your website hacked and your site security compromised include being blacklisted by Google, having spammy links advertising things like casinos, porn, etc. inserted into your content, redirecting visitors to phishing sites, data exfiltration (stealing information or Personal Identifiable Information from your web applications), and lots of other nasty things.

The reality is that malicious bots are searching for security weaknesses and trying to break into your blog while you are reading this page right now. Whether they can achieve this or not, depends on how hard or easy you can make things for them to continue persisting until they can find a way to get access, or give up and decide to 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 site through their WordPress security check …

WordPress Security Check(Hackertarget – WP Security Check Source: Hackertarget.com)

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

Hackertarget - Website Security Check

(WP security scan results. Product 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.

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

The ability to see what 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 in your site can be potentially valuable information to hackers, as these can inform them about any exploitable security weaknesses, especially in older versions.

If your website is driven by WordPress and you are not precautionary steps to bolster the security of your site, it’s practically guaranteed that, at some point in time, your site will be hacked, or at least targeted by bots, because these brute force attacks are systematically targeting WordPress sites all the world!

Whenever a website or blog gets hacked, site owners will find themselves “locked out” of their own site, or notice that their content has been altered or that everything has been entirely wiped out. Typically, sites will be infected with malicious scripts without the owner even being aware that this has happened.

To help avoid the heartache (and significant financial loss) of discovering that your site has been hacked into, below are 10 essential and effective security checks that will help to protect your WordPress site from being brute force attacked.

Info

Note: A few of the recommended measures shown below require some technical understanding of how to modify core WordPress and 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 a professional WordPress service provider for assistance.

***

Security Measure #1 – Get In Touch With Your Webhosting Provider

Contact your hosting provider and ask them exactly what security systems are in place to help prevent your site from being attacked, and what they are doing to ensure that your server files are regularly being backed up.

It’s important to make sure that your hosting service is backing up your server files and that, if anything goes wrong, you can quickly and easily recover your files.

Security Measure #2 – Back Up Your WordPress Data And Files And Keep Your Website Frequently Updated

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

A complete 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 themes, plugins and software components are up-to-date,
  • etc …

A proper WordPress maintenance routine looks like this …

Maintaining your WordPress web site completely backed up and updated is vitally important for WordPress security.(Maintaining your WordPress website or blog backed up and updated is vitally important for WordPress security. Screenshot source: WPTrainMe.com)

Again, we cannot stress enough how vitally important maintaining your WP website or blog regularly backed up and updated is. WP site 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 maintenance yourself, get someone else to do it but make sure it gets done. Backing up your site is the next most important thing you must do after making sure that your heart is still beating!

If you don’t want to back up your files manually, there are many free and paid plugins you can use. You can read about a WordPress backup plugin that can automate your backup process here: Backup, Copy & Protect Your WordPress Site With Backup Creator WordPress Plugin

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

The brute force attack on WordPress is mostly an attempt to compromise website administrator panels by exploiting WP installations that used “admin” as their user name.

For website security purposes, don’t set up WordPress sites with the username admin. This is the first area hackers will test. If your blog’s user name is “admin”, then make sure you change it immediately.

For a simple tutorial for WP admin users on how to change your admin username, go here: Changing Your Admin Username In WordPress

Security Measure #4 – Use A Strong Password

A “brute force” attack occurs when a malicious script continually and persistently hits a username and password field with different strings of characters in an attempt to guess the right combination that will give the hacker access to your site.

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

Weak passwords, therefore, make very easy targets for bot attacks. Make sure that you change your password combination to a string containing at least 8 characters long, with both upper and lowercase letters, and add a few “special” characters (e.g. ^, #, @, etc).

Practical Tip

Roboform is a password tool you can use to create strong passwords …

Roboform is a password tool that lets you generate different strong login passwords(You can use a password tool like Roboform to generate unguessable passwords)

We have created a simple step-by-step tutorial created especially for WP admin users on how to change your admin password here: How To Change The Login Password

Security Measure #5 – Secure Your wp-config.php File

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

wp-config.php file

(wp-config.php file)

If hackers break into your site, they will search for your wp-config.php file, because this file contains your WordPress 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.

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 accessed. 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 can be removed after installation. If you don’t want to delete these files, just rename them.

Security Measure #7 – Keep Your WordPress CMS, Themes And Plugins Up-To-Date

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

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

Security Measure #8 – Disable Your WordPress Theme Editor

WordPress installations come with a built-in editor that allows administrators to edit plugin and theme code inside the dashboard area.

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

WordPress Theme Editor Menu

(The WordPress theme editor is accessible using the WP admin menu)

The WordPress theme editor feature allows anyone accessing your blog’s admin to view and modify your WordPress theme files, and create mayhem 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 editing your wp-config.php file.

Security Measure #9 – Secure Your WordPress Uploads Directory

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

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

(WordPress uploads folder)

(WordPress uploads folder)

If any files stored in his folder have vulnerabilities that can be exploited by malicious users, this can compromise the security of your website.

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 get professional help if you are unsure about what to do.

Security Measure #10 – Use WordPress Security Plugins

There are several WordPress security plugins available that specifically address most common security issues faced by WordPress website owners, such as preventing hackers from gaining access to vital information about your site, protecting your site from malicious software, preventing injections of code into files, etc.

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

SecureScanPro - total security plugin for WordPress

(SecureScanPro – complete security software solution for WordPress)

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

Another plugin you may want to consider using is BlogDefender.

Blog Defender Security Solution For WordPress

Blog Defender WordPress Security Suite(Blog Defender)

Blog Defender is a package of WordPress security video tutorials, WordPress plugins and tools, plus WordPress security documentation in PDF and DOC formats.

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

Blog Defender Security Plugin For WordPressAnd lets you fix these quickly …

Blog Defender Security Suite For WordPressIf 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 secure web platform, but neglecting basic maintenance tasks like updating your WordPress installation, plugins and themes, tightening file and data protection and taking other necessary precautions can have disastrous consequences.

No matter what kind of business you run or plan to run online and how small you think your web presence is, website security is something you cannot ignore.

As one last reminder, below is the advice given by an expert on website security to all WordPress users following the large-scale brute force attacks by botnets on WordPress in 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 very important if you run a WordPress site. Hopefully, the information in 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 consult a professional WordPress security specialist, or search for a WordPress technical provider in our WordPress Services Directory.

Also, do yourself a favor and subscribe to WPCompendium.org to receive notifications when we publish new tutorials on WordPress security and reviews of new WordPress security plugins and solutions.

***

"If you're new to WordPress, this can stand on its own as a training course and will stay with you as you progress from beginner to advanced and even guru status." - Bruce (Columbus, Ohio)

***

Originally published as How To Protect Your WordPress Site From A Brute-Force Attack.