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 is frequently the target of malicious attempts by hackers, due to its global popularity.

In early 2013 a global brute-force attack struck WordPress installations across almost every host server in existence around the world.

These attacks were caused by botnets (computer networks infected with viruses and programmed to attack other computers with security vulnerabilities).

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)

There are many methods hackers use to try and break into WordPress sites. One of these is by trying to guess the site admin’s login username and password. This is done with software programs that automatically tries to guess hundreds of login permutations in minutes.

If you’re not using strong usernames or unguessable passwords, your website could be easily hacked by persistent attempts to work out your site’s login details.

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

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

Botnets are normally used used to blast out 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 globe since 2009 …

ZeuS is a botnet that has been actively infecting computer networks all around the globe since 2009.

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

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

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

Powering millions of websites around the world makes WordPress a target for hackers

(WordPress is the world’s most used content management system making it a frequent target for attempted hacker attacks)

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

We explain what makes WordPress a very secure web platform in this article: How Secure Is WordPress?

Info

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

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

Preventing Your WordPress Blog From Brute-Force Attacks – 10 Security Measures

You may think that the information in your website provides no value to hackers, but the reality is that all websites have value to a malicious user.

If hackers can exploit a weakness in your security, your website can then be used to attack more valuable sites.

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

The harsh reality is that malicious bots are trying to break into your blog while you are reading this article at this very moment. Whether they will hack in or not, will depend on how difficult you have made it for them to continue trying until they find a way to get in, or give up and go look for a less secure target.

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

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

Hackertarget - Website Security Check(WordPress Security Check Product image: https://hackertarget.com/wordpress-security-scan)

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

WP Security Check

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

It should be obvious after using this tool that if you are able to see all of this information, then so can hackers.

Hackertarget - WP Security Scan(Screenshot image: 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 all be valuable information to hackers, as this informs them about any potential holes or weaknesses, especially where the owners haven’t updated their files.

If your website is powered by WordPress and you are not preventive steps to bullet-proof your site, it’s practically guaranteed that, at some point, someone will attempt to hack your installation, because these attacks are systematically hitting WordPress sites around the world!

When a site is hacked, blog owners 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 that their content has been entirely wiped out. Often, sites will become infected with malicious software or viruses without the owner’s knowledge or awareness.

To avoid the heartache and frustration of discovering that your web site has been hacked into, below are ten essential and effective security checks that will help to prevent your WordPress site from being attacked by brute force botnets.

Warning

Note: A few of the steps below require some technical skills to modify core WordPress and server files. If you are not technical-minded, or don’t want to mess around with code on your site, then ask your web host or a professional WordPress technical provider for help.

***

Security Measure #1 – Contact Your Host

Contact your host and ask them exactly what measures they have put in place to help prevent your site from botnet attacks, and what is done to make sure that your WordPress sites get backed up.

Check that your host regularly backs up your server files and that, if disaster strikes, you can quickly and easily get your site back.

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

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

A full WordPress maintenance routine ensures that:

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

A complete WP site maintenance routine looks like this …

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

Again, we cannot stress enough how important maintaining your WordPress web site frequently backed up and updated is. WP maintenance is not hard or time-consuming, but it must be done to ensure the security of your website. If you don’t want to learn how to do WordPress site 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 WordPress plugins you can use. Learn about a WordPress backup plugin that can automate your site backups here: Back Up, Clone And Protect Your WordPress Websites With Backup Creator Plugin For WordPress

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

the worldwide brute-force attack on WordPress is mostly attempting to compromise site administrator panels and gain access to sites by exploiting WP sites that used “admin” as their user name.

For reasons of website security, don’t install a WordPress site with the username “admin”. This is the first thing hackers will test. If your site’s username is “admin”, you will need to change this immediately.

For a simple step-by-step tutorial created especially for non-technical admin users on how to change your admin username, go here: Changing Your WordPress Admin User Name To A Different Username

Security Measure #4 – Choose A Strong Password

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

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 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 very easy targets for brute-force attacks. Make sure that you change your password to something that is at least 8 or 9 characters long, and that includes upper and lowercase letters, combined with a few “special” characters (^%$#&@*).

Tip

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

Roboform is a password management tool that lets you easily generate secure login passwords(You can use a password management software tool like Roboform to help you generate very secure passwords)

We have created a detailed tutorial that shows you how to change your login password here: How To Change Passwords

Security Measure #5 – Prevent Your wp-config.php File From Being Easily Found

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.

wp-config.php

(wp-config.php file)

If hackers break into your WordPress site, they will typically look for your wp-config.php file, because this file contains important information about your site’s database, 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.

To protect your WordPress site from being attacked and even being used as part of a bot net, therefore, you must prevent people finding 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 the install.php, upgrade.php and readme.html files from your server.

These files are not required after installation and can be removed. If you don’t want to remove these files, then just rename them.

Security Measure #7 – Update Your WordPress Site, Themes And Plugins

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

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

Security Measure #8 – Disable Your WordPress Theme Editor

WordPress installations come with a built-in editor that lets the administrator edit theme and plugin files 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

(The WordPress theme editor is accessible via the WordPress dashboard menu)

The WordPress theme editor feature allows anyone accessing your site’s admin area to see and edit your theme templates, or create havoc on your site.

To prevent unauthorized people from accessing 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 – Prevent Access To The WordPress Uploads Folder

The “uploads” directory contains all the media files that get uploaded to your blog.

Normally, this folder is visible to anyone online. All someone has to do to view the contents stored in your site’s “uploads” folder is visit your 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, anyone 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 blank file called “index.php”) to your uploads directory, and so on. Again, it’s best to ask help from someone who knows what they are doing if you are not sure about what to do.

Security Measure #10 – WordPress Security Plugins

A number of security plugins for WordPress are available that specifically address most common security issues WordPress site owners face, such as preventing hackers from gaining access to vital areas of your site, protecting your files from brute-force attacks, preventing injections of code into files, etc.

Many 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 issues that could lead to hackers accessing your site files and causing damage to your site is SecureScanPro.

SecureScanPro - security software for WordPress

(SecureScanPro – security plugin for WordPress)

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

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

Blog Defender Security Suite For WordPress Sites

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

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

BlogDefender scans you WordPress installation for potential security weaknesses …

Blog DefenderAnd then shows you how to quickly and easily fix these …

Blog Defender Security Product Suite For WordPress SitesIf you don’t want to buy a premium 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 secure web platform, but neglecting basic maintenance tasks like keeping your WordPress core files, plugins and themes updated to their latest versions, 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, website security is something you simply cannot ignore.

As one last reminder, below is the advice given by a web security expert to all WordPress users following the global 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 of the utmost importance 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 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 whenever we publish new articles on WordPress security and tutorials about new security plugins.

***

"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

***