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 is the world’s most popular CMS which makes it a frequent target for hacking attacks.

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

These attacks were caused by infected computer networks programmed to attack other vulnerable sites (botnets).

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

What Are 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 done using scripts and software that automatically tries to guess hundreds of login permutations in minutes.

If you’re using predictable usernames and weak passwords that are easy to guess, your site can be an easy target for hackers.

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

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

Botnets are normally used used to send 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 compromising 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. Screenshot source: SecureList.com)

These were highly distributed and well organized attacks. Over 90,000 IP addresses were identified by a number of webhosting companies in the initial attack alone, when the web was flooded with millions of attempts to force their way into WordPress users administration areas. The large-scale brute-force attacks then continued, with over 30,000 WordPress sites and blogs being hacked every day.

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

WordPress powers millions of sites worldwide, which makes it a frequent target for malicious attacks by hackers

(WordPress is the world’s most popular content management system making it a natural target for attacks by hackers)

Does This Mean We Shouldn’t Use WordPress Anymore?

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

To understand what makes WordPress a very secure platform for websites, see this article: Why WordPress Is A Secure Platform For Websites –

Useful Info

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

Mike Little, the co-founder of WordPress with Matt Mullenweg, made the following comment 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 Website From Brute Force Attacks – Ten Security Checks

You may think that the information in your website is of little value to hackers, but the reality is that to a hacker, every website is an opportunity to benefit or profit at your expense.

If a malicious user can hack and remotely take control of your site, that website can then be used to target other valued web sites.

Additional undesirable effects of having your site hacked include being blacklisted by Google, having spammy links advertising things like gambling, discounted fashion, etc. inserted in your content and meta data, malicious redirects to phishing sites or other websites, data exfiltration (stealing information or Personal Identifiable Information from your web applications), and many other nasty things.

The harsh reality is that software-driven bots are most likely trying to hack into your website or blog right now. Whether they can do this successfully or not, will depend on how difficult or easy you have made it for hackers to continue persisting until they either can discover a way to get access, or are forced to give up and decide to look for a less protected target.

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

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

Website Security Scan(Hackertarget – Website Security Check Screenshot: Hackertarget.com)

You will see that the scan returns a number of results and information about your site setup …

Hackertarget - WordPress Security Scan

(website security scan results. Screenshot: 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, so can hackers.

Hackertarget - WordPress Security Scan(Source: BlogDefender.com)

The ability 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 on your server are all valuable information to hackers, as these can inform them about any security vulnerabilities, especially in older versions.

If your site or blog runs on WordPress and you’re not precautionary steps to bolster the security of your site, we can practically guarantee that, at some point in time, your site will be hacked, or at least targeted by bots, because these attacks are systematically hitting WordPress installations worldwide!

Typically, whenever a site gets hacked, site owners will discover much to their dismay that they have been “locked out” of their own site, or notice that their files have been vandalized or even that their content has been entirely wiped out. Typically, sites will become infected with malicious software without the owner’s knowledge or awareness.

To help avoid the heartache and aggravation (and significant loss of valuable business data) of discovering that your site has been hacked into, below are ten essential and effective security measures that will help to prevent your WordPress site from brute-force botnet attacks.

Useful Information

Note: A few of the steps below need some technical understanding of how to modify core WordPress and server files. If you lack these technical skills, or don’t want to mess around with code on your site, then ask your web host or a professional WordPress technical provider for assistance.

***

Security Measure #1 – Contact Your Web Host

Get in touch with your hosting provider and ask them exactly what precautions are in place to help prevent your site from brute force attacks, and what they are doing to make sure that your files and data get backed up.

Make sure that your web host backs up your server files and that, if disaster strikes, you can easily get back your files and data.

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

Never rely only on your hosting provider for your site backups. Instead, learn how to maintain your WordPress site or pay someone to 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, monthly, etc …)

A full WordPress maintenance routine ensures that:

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

A full WP site maintenance routine looks like this …

Maintaining your WP website or blog frequently backed up and up-to-date is vitally important for WordPress security.(Maintaining your WP installation regularly 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 WordPress installation frequently backed up and updated. WP 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 website 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 site manually, 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, Copy And Protect Your WP Web Sites With Backup Creator WordPress Plugin

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

The brute force attack on WordPress sites was mostly attempting to compromise site admin panels by exploiting installations using “admin” as their account name.

For reasons of website security, don’t set up WordPress sites with the username “admin”. This is the first area hackers will test. If your blog’s username is “admin”, change this immediately.

We have created a step-by-step tutorial that shows you how to change your login username here: Changing Your WordPress Username From Admin To Another Username

Security Measure #4 – Choose Strong Passwords

A “brute force” attack occurs when malicious software continually and persistently hits a username and password field with different character strings trying to guess the right login combination 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 effective ways to do this), the “bot” will just continue to attack your site until it eventually works out the combination.

Weak passwords, therefore, make really easy targets for attacks. Make sure that you change your password to a string that is at least eight or nine characters long, with upper and lowercase letters, and “special” characters (^%$#&@*).

Practical Tip

You can use a password management tool like Roboform to create strong login passwords …

You can use a password software tool like Roboform to generate secure login passwords(Roboform is a password tool you can use to create very secure passwords)

For a step-by-step tutorial for admin users that shows you how to change your login password, go here: Changing Passwords

Security Measure #5 – Prevent Access To The wp-config.php File

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

WP Config file

(WP Config file)

If hackers break into your WordPress website, they will normally look for your wp-config.php file, because this file 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 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 Installation Files

Delete or rename the install.php, upgrade.php and readme.html files from your server.

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

Security Measure #7 – Update Your WordPress CMS, Themes And Plugins To Their Latest Version

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

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

Security Measure #8 – Disable Your Theme Editor

WordPress comes with a built-in editor that lets you edit theme and plugin files from the dashboard area.

You can access your WordPress Theme Editor by selecting Appearance > Editor in the admin menu …

WordPress Theme Editor Menu

(The WordPress theme editor is accessible via the WP main menu)

This allows anyone accessing your site to view and modify your files, or create havoc on your site.

If you want to prevent people from accessing the WordPress Theme editor, you will need to disable it. This can be done by editing your wp-config.php file.

Security Measure #9 – Remove Access To The Site’s Uploads Directory

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

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

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

(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 malicious users, someone can upload unauthorized file types or compromise the security of your site.

Protecting your directories will prevent unauthorized people 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 named “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 – Security Plugins

There are some great WordPress security plugins available that will address many common security issues WordPress site owners face, such as preventing hackers from accessing vital areas of your site, protecting your website from botnets, preventing unauthorized file uploads, etc.

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

SecureScanPro - WordPress total security software

(SecureScanPro – WordPress security software)

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

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

Blog Defender Security Plugin For WordPress

Blog Defender Security Plugin For WordPress Sites(Blog Defender Security Plugin For WordPress)

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

BlogDefender scans you WordPress site for security vulnerabilities …

Blog Defender WordPress Security SolutionAnd then shows you how to easily fix these …

Blog Defender Security Solution For WordPressIf you don’t want to invest in a 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 platform, but neglecting basic maintenance tasks like keeping your WP installation, plugins and WP themes up-to-date, tightening file and data protection and taking other necessary precautions can expose your site to malicious by hackers and bots.

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

As one last reminder of the importance of website security, below is the advice given by an expert on website security to all WordPress users following the mass brute force attacks 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 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.

Also, don’t forget to subscribe to WPCompendium.org to receive notifications when we publish new articles and tutorials on WordPress security and reviews of new WordPress security plugins and solutions.

***

"I have used the tutorials to teach all of my clients and it has probably never been so easy for everyone to learn WordPress ... Now I don't need to buy all these very expensive video courses that often don't deliver what they promise." - Stefan Wendt, Internet Marketing Success Group

***