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 powers millions of websites and blogs worldwide, making it an obvious target for malicious attacks by hackers.

In early 2013 a global brute-force attack hit WordPress installations on almost every web host in existence around the world.

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

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)

There are many ways hackers try to break into a WordPress site. One of these is by trying to guess the site admin’s login username and password. This can be done with software tools that automatically tries to guess hundreds of possible login combinations in minutes.

If you’re using predictable user names and weak passwords that are easy to guess, your site can be easily hacked by the script’s persistent attempts to guess your site’s login details.

This is called a “brute-force” attack.

What Are Botnets

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)

”Botnets” are networks of private computers that have been infected with malicious code, which are then controlled remotely as a group, often without the computer owners even being aware that this is happening.

Botnets are regularly used to blast out mass spam emails.

Below is a screenshot taken from an online 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 compromising computer networks all around the world since 2009. Screenshot: SecureList.com)

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

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

WordPress often is targeted by hackers

(WordPress powers millions of websites and blogs worldwide, making it an obvious target for hacking attacks)

Does This Mean We Should Stop Using WordPress?

No. In fact, there are lots of great reasons why you should choose WordPress if you are concerned about the security of your web presence.

To learn what makes WordPress a very secure platform for websites, see this article: Is WordPress A Secure Website Platform?

Useful Information

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 web 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 Website From Being Brute Force Attacked – 10 Security Points

You may think that your website has nothing to offer to hackers, but the reality is that to a hacker, all websites are an opportunity to gain some advantage at your expense.

If a malicious user can exploit a vulnerability that allows them to gain remote access of your blog, that website or blog can then be used as a “bot” to attack more valued websites.

Additional undesirable consequences of having your site hacked and your site security compromised include getting blacklisted by search engines, having spammy links advertising things like casinos, porn, etc. in your content and meta data, malicious redirects to phishing sites, drive-by downloads (adding malicious scripts on your visitors’ computers), and many other nasty things.

The truth is that software-driven bots are searching for security weaknesses and trying to break into your website at this very moment. Whether they can get into your site successfully depends on how hard you can make things for hackers to keep persisting until they work out how to get access, or give up and go look for an easier target.

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

Do you own a WordPress site? If so, visit a site like Hackertarget.com and run your site through their WordPress security scan …

Hackertarget - WordPress Security Check(Hackertarget – WordPress Security Scan Product image: Hackertarget.com)

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

Hackertarget - WP Security Check

(WordPress security scan results. Product image source: Hackertarget.com)

It should be obvious after using the above tool that if you are able to see all of this information about your website, so can hackers.

WordPress Security Scan(Image source: BlogDefender.com)

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 potentially valuable information to hackers, as this informs them about any exploitable vulnerabilities, especially where the owners haven’t updated their sites.

If your website runs on WordPress and you’re not proactive steps to harden your site, then we can practically guarantee 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 installations all the world!

Whenever a website gets hacked, website owners will discover much to their dismay that they have been “locked out” of their own site, or notice that their files have been interfered with or even that their content has been entirely wiped out. Typically, sites will become infected with malicious scripts or viruses without the owner even being aware that this has occurred.

To help avoid the heartache (and significant financial loss) that comes with discovering that your website or blog has been hacked into, we have listed below 10 simple, yet essential and effective security checks that will help to prevent your WordPress site from being attacked by brute-force botnet hacking attempts.

Note

Note: A few of the measures below require some technical understanding of how 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 a professional WordPress service provider for help.

***

Security Measure #1 – Get In Touch With Your Web Host

Contact your hosting provider and ask them exactly what security precautions have been put in place to protect your site from brute force attacks, and what is done to make sure that your site files get regularly backed up.

It’s important to check that your host backs up your sites and that, if anything goes wrong, 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 just on your hosting provider for your site backups. Instead, learn how to maintain and manage your WordPress site or pay someone to get this done for you and maintain a habit of religiously performing a full WordPress site maintenance routine on a regular basis (e.g. daily, weekly, fortnightly, etc …)

A full WordPress maintenance routine ensures that:

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

A proper WordPress maintenance routine looks like this …

Maintaining your WordPress site backed up and updated is vitally important for WordPress security.(Maintaining your WordPress site fully backed up and up-to-date is vitally important for WordPress security. Image source: WPTrainMe.com)

Again, we cannot stress enough how vitally important it is to maintain your WP installation regularly backed up and up-to-date. WordPress 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 site maintenance yourself, pay a professional to do it but make sure this gets done. Backing up your site is the second most important thing you should do after making sure that your heart is still beating!

If you don’t want to back up your data manually, there are many plugins you can use. Learn about a WordPress backup plugin that can fully automate your backup process here: Back Up, Clone And Protect Your WP Website With Backup Creator WordPress Plugin

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

The large scale brute-force attack on WordPress is mostly attempting to compromise website administrator panels and gain access to the site by exploiting sites with “admin” as the user name.

For security purposes, never install WordPress sites with the username admin. This is the first area of potential vulnerability hackers will test. If your blog’s user name is “admin”, then make sure you change it immediately.

We have created a detailed step-by-step tutorial created especially for non-technical WP admin users that shows you how to change your login username here: Changing Your WP Admin User Name To Another Username

Security Measure #4 – Change Your Password

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

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

Passwords that are easy to guess, therefore, become really easy targets for attacks. Make sure that you change your password to something containing at least eight or nine characters long, with upper and lowercase letters, and “special” characters (e.g. ^, #, &, etc).

Useful Tip

Roboform is a password tool you can use to generate different unguessable passwords …

You can use a password software tool like Roboform to generate hard-to-guess passwords(You can use a password tool like Roboform to generate secure login passwords)

For a step-by-step tutorial created especially for non-technical admin users that shows you how to change your password, go here: What To Do If You Need To Change Your Login Password

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

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

wp-config.php

(wp-config.php)

If a hacker breaks into your WordPress site, they will typically try to access your wp-config.php file, because this is the file that contains your database details, 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 being attacked and even being used as part of a bot net, therefore, prevent people from accessing 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 – Delete Or Rename Unnecessary Blog 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 remove these files, just rename them.

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

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

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

Security Measure #8 – Disable Your Theme Editor

WordPress comes with a built-in editor feature that allows site administrators to edit theme and plugin code inside the dashboard.

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

WP Theme Editor Menu

(Accessing the WordPress theme editor via the WordPress dashboard menu)

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

To prevent people from accessing 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 WordPress “uploads” folder stores 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 see the contents stored in your site’s “uploads” directory is navigate to your directory using their web browser …

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

(WordPress uploads folder)

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by hackers or malicious users, someone could upload unauthorized file types or 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, uploading a blank index.php file (this is literally a file with nothing in it named “index.php”) to your uploads directory, and so on. Again, it’s best to consult a professional if you are unsure about what to do.

Security Measure #10 – Use WordPress Security Plugins

Some great WordPress security plugins are available that will address most security issues WordPress site owners face, such as preventing unauthorized users from gaining access to vital information about your site, protecting your website from malicious software, preventing injections of code into files, etc.

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

SecureScanPro - WP security software

(SecureScanPro – WordPress total security software solution)

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

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

Blog Defender Security Plugin

Blog Defender(Blog Defender Security Product Suite For WordPress)

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

BlogDefender scans you WordPress installation for security vulnerabilities …

Blog Defender Security Plugin For WordPressAnd then shows you how to easily fix these …

Blog DefenderIf you don’t want to invest in a security plugin like SecureScanPro or BlogDefender, you can use various free WP 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 ensuring that your WP software, plugins and themes are kept updated to their latest versions, tightening file and data protection and taking other necessary precautions can have disastrous consequences.

Regardless of the kind of business you run or plan to run online and how small you think your web presence is, web security is something you simply cannot ignore.

As a final reminder of the importance of website security, 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 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 receive notifications via email when we publish new information on WordPress security and reviews of new security plugins and solutions.

***

"Your training is the best in the world! It is simple, yet detailed, direct, understandable, memorable, and complete." Andrea Adams, FinancialJourney.org

***