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 often is targeted by hackers.

In April 2013 a global brute-force attack hit WordPress installations across almost every WP hosting server in existence around the world.

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

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

What Is A Brute Force Attack?

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 admin’s login username and password. To do this, hackers use scripts and software that automatically tries to guess hundreds of possible logins in minutes.

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

This is called a “brute-force” login attack.

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)

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

Botnets are typically used to blast out mass spam emails.

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

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

(ZeuS is a botnet that has been actively infecting computer networks all around the world since 2009. Screenshot source: SecureList.com)

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

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

WordPress powers millions of websites worldwide, making it a target for attempted hacking attacks

(WordPress is frequently the target of mass malicious attempts by hackers)

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

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

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

Info

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

Mike Little, one of the co-founders 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)

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

You may think that your site is of little value to hackers, but the reality is that to a hacker, all websites provide an opportunity to benefit or profit at your expense.

If a malicious user can exploit a security flaw in your system and gain remote access and control of your website, your site can then be used as part of a larger network of “bots” to target larger and more highly-valued web sites.

Additional undesirable effects of being hacked and your site security compromised include being blacklisted by search engines, having spammy links promoting things like casinos, porn, etc. inserted in your content, malicious redirects to phishing sites or other websites, data exfiltration (stealing information or Personal Identifiable Information from your web applications), and lots of other nasty things.

The harsh reality is that brute-force software bots are probably trying to break into your blog at this very moment. Whether they will get into your site successfully will depend on how hard or easy you can make things for hackers to continue trying until they either can find how to get in, or are forced to give up and go look for a less protected target.

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

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

Website Security Scan(Hackertarget – WordPress Security Check Source: https://hackertarget.com/wordpress-security-scan)

You will see that the check returns various results and information about your site …

Hackertarget - WordPress Security Scan

(Hackertarget – website security scan results. Image source: Hackertarget.com)

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

Hackertarget - Website Security Scan(Product image source: 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 are all useful information to hackers, as this informs them about potentially exploitable vulnerabilities, especially in older versions.

If your site or blog is driven by WordPress and you are not taking appropriate steps to harden 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 is broken into, webmasters will discover much to their dismay that they have been “locked out” of their own site, or notice that their files have been modified or even entirely wiped out. Often, most sites will become infected with malicious software without the owner even being aware that a security breach has happened.

To help avoid the heartache (and significant loss of valuable business data) that comes with discovering that your website has been hacked into, we have listed below ten simple, yet essential and effective security measures that will help to protect your WordPress site from being attacked by brute-force botnets.

Note

Note: A few of the recommended steps listed below need 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 file code, then ask your web host or search for a WordPress technical provider in our WordPress Services Directory.

***

Security Measure #1 – Contact Your Host

Get in touch with your web host and ask them exactly what security precautions are in place to protect your site from being attacked, and what is done to make sure that your WordPress sites are being backed up.

Make sure that your webhosting provider backs up your sites and that, if anything goes wrong, you can easily get your files back.

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

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

A full WordPress maintenance routine ensures that:

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

A complete WP maintenance routine looks like this …

Maintaining your WP installation completely backed up and up-to-date is vitally important for WordPress security.(Maintaining your WordPress site fully 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 WordPress installation regularly backed up and up-to-date. WordPress site maintenance is not hard to do 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 WordPress maintenance yourself, pay a professional to do it but make sure this gets done. Backing up your website is the next 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 WordPress plugins you can use. Learn about a WordPress backup plugin that can automate your backup process here: Backup, Duplicate And Keep Your WP Sites Protected With Backup Creator Plugin For WordPress

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

The mass brute-force attack on WordPress sites was mostly an attempt to compromise website administrator panels and gain access to the site by exploiting installations with “admin” as the username.

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

We have created a simple step-by-step tutorial for WordPress admin users on how to change your WordPress username here: Changing Your WordPress Admin Username

Security Measure #4 – Avoid Weak Passwords

A “brute force” attack occurs when a malicious script continually and persistently tries to guess the right username and password character string that will give them access to your website.

Unless some measure is put into place to block the brute force attack (see further below for a couple of effective suggestions for doing this), the “bot” will just continue to attack your site until it eventually “cracks” the code.

Weak passwords, therefore, are very easy targets for botnets. Make sure that you change your password combination to something that is at least 8 characters long, and that includes upper and lowercase letters, and add a few “special” characters (e.g. ^, #, &, etc).

Practical Tip

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

You can use a password management tool like Roboform to help you generate unguessable passwords(Roboform is a password software you can use to generate really secure passwords)

We have created a simple step-by-step tutorial created especially for non-technical WordPress admin users on how to change your WordPress password here: Changing A Password In WordPress

Security Measure #5 – Secure Your WP Config File

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

wp-config.php

(wp-config.php file)

If hackers break into your site, they will normally search for the 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 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, 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 Installation Files

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

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

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

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

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

Security Measure #8 – Disable The Theme Editor

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

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

WP Theme Editor Menu

(Accessing the WordPress theme editor via the main menu)

The WordPress theme editor allows anyone accessing your site to view and edit your theme files, and cause mayhem on your site.

To prevent unauthorized people from being able to access the WordPress Theme editor, you will need to disable it. This can be done by editing your wp-config.php file.

Security Measure #9 – Protect The WordPress Uploads Directory

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

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

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

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

If any files stored in his folder have vulnerabilities that can be exploited by malicious users, this could seriously threaten the security of your site.

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, 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 assistance if you are unsure about what to do.

Security Measure #10 – Install Security Plugins

There are several security plugins for WordPress available that specifically address common security issues faced by WordPress site owners, such as preventing hackers from accessing your site, protecting your website from malicious exploits, 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 site files and damaging your site is SecureScanPro.

SecureScanPro - security plugin for WordPress

(SecureScanPro – security plugin for WordPress)

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 great security plugin you may want to consider using is BlogDefender.

Blog Defender

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

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 website are …

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

Blog Defender WordPress Security Product SuiteIf you don’t want to buy a security plugin like SecureScanPro or BlogDefender, you can use various free plugins, such as Limit Login Attempts

Limit Login Attempts - WordPress Security Plugin

WordPress is a very secure web platform, but neglecting basic maintenance tasks like updating your WordPress software, plugins and themes, tightening file and data security 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 cannot afford to ignore the importance of securing your websites.

As a final reminder of the importance of website security, below is the advice given by an expert on web security to all WordPress users after the worldwide 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 very important if you run a WordPress site. Hopefully, the information in this article 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 WordPress service provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to receive notifications whenever we publish new tutorials on WordPress security and tutorials about new WordPress security plugins.

***

"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.