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 SecurityWordPress frequently comes under attack by hackers.

In early 2013 a global brute force attack hit WordPress installations across virtually every web host in existence.

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

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)

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. This can be achieved with software programs that can guess hundreds of login permutations in minutes.

If you’re not using strong usernames or unguessable passwords, your site could be easily hacked by a malicious software’s persistent attempts to guess your site’s login details.

This is called a “brute force” login attack.

What Is A Botnet?

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)

”Botnets” are networks of computers that have been compromised and infected with malicious code or software, which are then controlled remotely as a group, often without the unsuspecting computer owners even being aware that this is taking place.

Botnets are often used to blast mass spam emails from computers of compromised user accounts.

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 globe since 2009 …

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

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

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

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

WordPress often is targeted by hackers

(Powering millions of websites around the world makes WordPress a target for attacks by malicious users)

Does This Mean WordPress Is Not Secure And We Should Stop Using It?

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

To learn why WordPress is a secure web platform, read this article: Is WordPress Secure?

Important

It’s important to understand that, in the case of April 2013 mass brute force attack described above, no specific WordPress vulnerability was being exploited (the same script was also targeting sites built using other platforms 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)

How To Protect Your WordPress Website From Brute-Force Attacks – Ten Security Points

Every web site with a security vulnerability provides an opportunity to hackers. If you think that the information in your site is of no interest to hackers, think again. Large, medium and small websites, personal blogs, government web sites … even sites owned by online security experts can and have been targeted.

If someone can find a flaw in your security that allows them to control your blog, your website can then be used as a “bot” to attack more valued websites.

Additional undesirable effects of having your site hacked include getting blacklisted by Google, having stealthy spam links advertising things like gambling, porn, etc. in your content, redirecting visitors to phishing sites, data exfiltration (stealing information or Personal Identifiable Information from your web applications), and many other nasties.

The truth is that software-driven bots are most likely searching for exploits and trying to break into your website at this very moment. Whether they will successfully break in depends on how difficult or easy you will make it for hackers to keep trying until they either work out a way to get access, or give up and go look for a more vulnerable target.

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

Does your website run on WordPress? If so visit a site like Hackertarget.com and run your website through their WordPress security check …

WP Security Scan(WordPress Security Scan Screenshot image: Hackertarget.com)

You will see that the scan will yield a number of results and details about your WordPress site …

WordPress Security Scan

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

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

WordPress Security Scan(Screenshot: Blog Defender)

Being able 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 useful information to hackers, as these can inform them about exploitable holes or weaknesses, especially in older versions.

If your site or blog is powered by WordPress and you are not preventive steps to harden your site, it’s practically guaranteed that, at some time in the near future, 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 site is hacked, webmasters can find themselves completely “locked out” of their own site, or notice that their files have been altered or even that their content has been completely wiped out. Typically, most sites will be infected with malicious software or viruses without the owner’s knowledge or awareness.

To help avoid the heartache (and significant financial loss) 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 prevent your WordPress site from being brute-force attacked.

Important Info

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

***

Security Measure #1 – Contact Your Host

Get in touch with your webhosting service provider and ask them exactly what security precautions are in place to help prevent your site from being attacked, and what is done to make sure that your files and data get regularly backed up.

It’s important to make sure that your web host is backing up your server files and that, if disaster strikes, you can easily recover your site.

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

Never rely just on your hosting provider for site backups. Instead, learn how to manage your WordPress site or get this service done for you and develop a habit of religiously performing a full WordPress site maintenance routine frequently (e.g. weekly, fortnightly, etc …)

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

A proper WP site maintenance routine looks like this …

Maintaining your WordPress website or blog backed up and updated is vitally important for WordPress security.(Maintaining your WordPress website or blog fully backed up and up-to-date is vitally important for WordPress security. Screenshot source: WPTrainMe.com)

Again, we cannot stress enough how important maintaining your WP website completely backed up and updated is. WP site maintenance is not hard to do 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 WordPress site maintenance yourself, pay someone to do it but make sure it gets done. Backing up your website is the second most important thing you should do after making sure that your heart is still beating!

If you don’t want to perform manual backups, there are a number of free and paid plugins you can use. You can read about a WordPress backup plugin that can automate your backup process here: Backup, Duplicate & Keep Your WP Sites Protected With Backup Creator Plugin For WordPress

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

The large scale brute force attack on WordPress is mostly an attempt to compromise website administrator panels by exploiting sites that used “admin” as the username.

For reasons of website security, avoid installing a WordPress site with the username admin. This is the first thing hackers will test. If your blog’s username is admin, change it immediately.

We have created a detailed tutorial that shows you how to change your admin username here: How To Change Your Admin User Name In WordPress To A More Secure User Name

Security Measure #4 – Choose Strong Passwords

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

Unless you put some measure in 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 breaks into your admin area.

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

Tip

You can use a password tool like Roboform to generate unbreakable passwords …

You can use a password management software tool like Roboform to create unbreakable passwords(Roboform is a password management tool you can use to create strong passwords)

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

Security Measure #5 – Deny Access To Your WP Config File

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

wp-config.php file

(wp-config.php file)

If a hacker breaks into your site, they will look for your wp-config.php file, because this is the file that contains your WordPress database details, security keys, etc. Getting access to this information would allow someone 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, you must 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 – Rename Or Delete Unnecessary Site 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 remove these files, then just rename them.

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

Hackers search for vulnerabilities they can exploit in older WordPress versions, including outdated versions of WP plugins and themes.

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

Security Measure #8 – Disable Your WordPress Theme Editor

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

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

WP Theme Editor Menu

(The WordPress theme editor can be accessed using the WordPress dashboard menu)

This means that anyone logging into your site’s admin can view and change your theme templates, and cause mayhem on your site.

If you want to prevent unauthorized 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 Folder

The WordPress “uploads” folder stores all the media that gets uploaded to your website.

By default, this folder is visible to all users online. All someone has to do to see the contents in the “uploads” directory is visit the directory using their web browser …

(WordPress uploads directory)

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

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by hackers or malicious users, this could become a serious threat to the security of your website.

Protecting your directories will prevent online users from viewing 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 blank file named “index.php”) to your uploads directory, and so on. Again, it’s best to seek professional help if you are unsure about what to do.

Security Measure #10 – WordPress Security Plugins

Several WordPress security plugins are available that specifically address many 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 scripts, preventing unauthorized file uploads, 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 files and damaging your site is SecureScanPro.

SecureScanPro - security plugin for WordPress

(SecureScanPro – WordPress security software solution)

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

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

Blog Defender

Blog Defender WordPress Security Product Suite(Blog Defender Security Plugin For WordPress)

Blog Defender 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 potential security weaknesses in your WordPress site are …

Blog DefenderAnd lets you quickly and easily fix these …

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

Limit Login Attempts - WordPress Security Plugin

WordPress is a very secure web platform, but neglecting simple maintenance tasks like making sure that your WordPress core files, WordPress plugins and themes are kept updated to their latest versions, tightening file and data protection and taking other necessary precautions can have disastrous consequences.

No matter what type of business you run or plan to run online and how small you think your web presence is, you simply cannot ignore the importance of securing your web site.

As one last reminder, below is the advice given by an expert on web security to all WordPress users following the large-scale 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 above information has shown you what to do to keep your WordPress site protected from brute-force attacks. If you need any further help or assistance with WordPress security, please consult a professional WordPress security specialist, or search for a professional WordPress service provider in our WordPress Services Directory.

Also, don’t forget to subscribe to WPCompendium.org to receive notifications via email whenever we publish new tips on WordPress security and tutorials about 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

***