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 SecurityWhen you are the leading CMS platform in the world and the preferred online publishing platform used by millions of businesses and loved by thousands of website developers and website designers, it’s inevitable that at some point in time, WordPress will come under attack from hackers wanting to score a “big win”.

In April 2013 a global brute force attack hit WordPress installations on almost every web host in existence.

These attacks were caused by botnets (computers infected with viruses and programmed to attack other vulnerable sites).

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)

There are many ways hackers try to break into a WordPress site. One of these is by trying to guess the site’s administration login username and password. To achieve this, hackers use software programs that can guess hundreds of login permutations in minutes.

If you’re using easy-to-guess user names and predictable passwords, your website could be an easy target for hacking attempts.

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

”Botnets” are networks of private 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 that this is taking place.

Botnets are regularly used to send out mass spam emails from computers of unsuspecting users.

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 globe since 2009 called “Zeus” …

ZeuS is a botnet that 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. Image: SecureList.com)

These were highly distributed and well organized botnet attacks on WordPress. 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 site administration areas occurred. The worldwide brute force attacks then continued, with over 30,000 WordPress sites and blogs being hacked per day.

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

Being the world's most used content management system makes WordPress a target for attempted hacker attacks

(Powering millions of sites around the world makes WordPress a target for hacking attacks)

Does This Mean We Shouldn’t Use WordPress Anymore?

No. In fact, there are many very good reasons why you should choose 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: Can You Build A Secure Business Online Using WordPress?

Important Info

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

Mike Little, the co-founder 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 Website From Brute-Force Attacks – 10 Security Checks

You may think that the information in your site provides little to no value to hackers, but the reality is that every website is valuable to a malicious user.

If a hacker can discover a software vulnerability in your security that allows them to control your blog, your website can then be used as a “bot” to attack other valuable sites.

Additional undesirable impacts of having your site hacked include getting blacklisted by Google, having stealthy spam links advertising things like gambling, porn, etc. inserted into your content, malicious redirects to phishing sites, data exfiltration (stealing customer details or Personal Identifiable Information from your web applications), and many other nasties.

The reality is that malicious bots are most likely looking for weaknesses and trying to hack into your website at this very moment. Whether they can hack into your site successfully will depend on how difficult you can make things for hackers or bots to keep persisting until they work out how to break in, or give up and go look for a less protected target.

How Much Information About Your WordPress 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 …

WP Security Scan(Hackertarget – Website Security Check Product image: Hackertarget.com)

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

WordPress Security Scan

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

It should be obvious after using this tool that if you can see all of this information, hackers can too.

Hackertarget - WP Security Check(Product image source: BlogDefender site)

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 in your site can be useful information to hackers, as these can inform them about any vulnerabilities, especially where site owners haven’t updated their files.

If your site or blog is powered by WordPress and you’re not taking appropriate steps to bullet-proof your site, it’s practically guaranteed that, at some point, your site will be hacked, or at least targeted by bots, because these brute-force attacks are systematically hitting WordPress installations around the world!

When a website or blog is 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 modified or that everything has been entirely wiped out. Typically, most compromised sites will be infected with malicious scripts without the owner even being aware that a security breach has happened.

To avoid the heartache and aggravation (and potential loss of valuable business data) of having your website or blog being hacked into, below are ten essential and effective security measures that will help to prevent your WordPress site from being attacked by brute-force hackers.

Note

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

***

Security Measure #1 – Get In Touch With Your Host

Get in touch with your hosting company and ask them what precautions they have put in place to help prevent your site from botnet attacks, and what is done to ensure that your files and data get regularly backed up.

It’s important to check that your host regularly backs up your sites and that, if disaster strikes, you can quickly and easily recover your files and data.

Security Measure #2 – Perform Full WordPress Backups And Keep Your Website Regularly Up-To-Date

Never rely on your host for site backups. Instead, learn how to maintain your WordPress site or pay someone to get this done for you and maintain a habit of performing a full WordPress site maintenance routine frequently (e.g. weekly, monthly, etc …)

A proper WordPress maintenance routine ensures that:

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

A complete WP site maintenance routine looks like this …

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

Again, we cannot stress enough how vitally important maintaining your WordPress website or blog regularly backed up and updated is. WordPress 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 WP maintenance yourself, pay someone to do it but make sure this gets done. Backing up your website is the next most important thing you must do after making sure that you are still breathing!

If you don’t want to perform manual backups, there are many free and paid WordPress plugins you can use. Learn about a WordPress backup plugin that can fully automate your backup process here: Back Up, Duplicate & Protect Your WP Website With Backup Creator WordPress Plugin

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

The mass brute force botnet attack on WordPress is mostly an attempt to compromise site administrator panels and gain access to the site by exploiting sites with “admin” as their user name.

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

We have created a detailed tutorial for admin users that shows you how to change your username here: Changing Your WordPress Username From Admin To A Different User Name

Security Measure #4 – Avoid Weak Passwords

A “brute force” attack occurs when malicious software continually hits a login or password field with different strings of characters in an attempt to guess the right combination that will unlock your website.

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

Weak passwords, therefore, make really easy targets for hacking attacks. Make sure that you change your password combination to a string containing at least 8 characters long, and that includes upper and lowercase letters, and add a few “special” characters (%^#$@&*).

Tip

Roboform is a password management tool you can use to create different hard-to-guess passwords …

You can use a password management software tool like Roboform to help you generate hard-to-crack passwords(You can use a password management program like Roboform to create hard-to-crack passwords)

For a detailed step-by-step tutorial that shows you how to change your login password, go here: What To Do If You Need To Change Your Password In WordPress

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

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)

If a hacker breaks into your WordPress site, they will normally search for the 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.

To protect your WordPress site from attacks and even being used as part of a bot net, therefore, you must prevent your wp-config.php file from being easily accessed. 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 can be deleted after installation. If you don’t want to remove these files, then just rename them.

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

Hackers look for vulnerabilities in outdated versions of WordPress that can be exploited, including outdated versions of WordPress plugins and themes.

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

Security Measure #8 – Disable The Theme Editor

WordPress installations come with a built-in editor feature that allows you to edit plugin and theme code inside the dashboard.

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

WP Theme Editor Menu

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

This means that anyone logging into your site can view and change your theme template files, or cause mayhem on your site.

If you want 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 – Remove Access To Your WordPress Uploads Folder

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

By default, this folder is visible to all users online. All someone has to do to view all of the contents stored in your site’s “uploads” directory is visit your directory using a web browser …

(WordPress has an uploads directory where all of your media files are stored)

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

If any files stored in his folder have vulnerabilities that can be exploited by hackers or malicious users, someone can upload unauthorized file types or compromise the security of your site.

Protecting your directories will prevent unauthorized people 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 an empty file named “index.php”) to your uploads directory, and so on. Again, it’s best to hire a professional if you are unsure about what to do.

Security Measure #10 – Use Security Plugins

There are a number of great security plugins for WordPress available that specifically address most security issues WordPress site owners face, such as preventing unauthorized users from gaining access to vital information about your site, protecting your files from malicious scripts, preventing injections of code into files, etc.

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

SecureScanPro - WP complete security software solution

(SecureScanPro – WP total security plugin)

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

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

Blog Defender Security Solution For WordPress

Blog Defender(Blog Defender Security Plugin)

This product is a package of WordPress security video tutorials, plugins and tools, plus a WordPress security PDF/DOC file.

BlogDefender shows you where potential security holes in your WordPress installation are …

Blog Defender Security Product SuiteAnd then shows you how to fix these quickly …

Blog Defender Security SuiteIf you don’t want to invest in a premium 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 secure platform, but neglecting essential maintenance tasks like making sure that your WordPress software, plugins and WP themes are kept updated to their latest versions, tightening file and data security 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, you cannot afford to ignore the importance of securing your sites.

As a final reminder, below is the advice given by a website security expert to all WordPress users following the worldwide brute force attacks 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 very important if you run a WordPress site. Hopefully, the above article has provided you with the initial guidelines and direction you need to prevent brute force attacks on your WordPress site. If you need any further help or assistance with WordPress security, please consult a WordPress security specialist, or search for a professional WordPress technical provider in our WordPress Services Directory.

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

***