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 powers millions of websites and blogs around the world, making it an easy target for malicious attacks by hackers.

In April 2013 a worldwide brute-force attack hit WordPress installations on almost every host server in existence.

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

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 ways hackers try to break into WordPress sites. One of these is by trying to guess the site admin’s login username and password. This is done with scripts and tools that can work through hundreds of possible logins in minutes.

If you’re using weak user names and predictable passwords, your site could be an easy target for hacking attempts.

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.org)

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

Botnets are often used to send mass spam emails.

Below is a screenshot 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 world since 2009 …

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

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

These were well organized and highly distributed attacks. Over 90,000 IP addresses were identified by a number of webhosting companies in the initial attack alone, when millions of attempts to force their way into WordPress site admin areas took place. The worldwide brute-force attacks continued after this, with over 30,000 WordPress sites being hacked per day.

Coverage of this large-scale 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 US Department of Homeland Security website …

WordPress powers millions of websites and blogs worldwide, making it a target for hacking attempts

(Being the world’s most popular CMS makes WordPress an obvious target for attempted hacking attacks)

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

No. In fact, there are many good reasons why you should choose WordPress if you are concerned about website security.

To learn what makes WordPress a very secure platform for websites, read this article: Can You Build A Secure Business Online Using WordPress? What Every Website Owner Needs To Know

Important Info

It’s important to note that, in the case of April 2013 mass brute-force botnet attack described above, was no specific vulnerability in WordPress being exploited (the same script was also attacking sites built using 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 Site From Brute Force Attacks – Ten Security Measures

Every website with a security vulnerability can can provide an opportunity to hackers. All websites have some value to hackers. Corporate websites, personal blogs, government websites … even web sites owned by online security experts can and have been targeted.

If hackers can exploit a software weakness in your security and remotely control your web site, that website can then be used to attack other valuable sites.

Additional undesirable consequences of having your website hacked and your site security compromised include being blacklisted by Google, having spammy links promoting things like online meds, cheap offers on brand names, etc. inserted into your content and meta data, malicious redirects to phishing sites, data exfiltration (stealing customer details or Personal Identifiable Information from your web applications), and lots of other nasties.

The truth is that software-driven bots are very likely scouring for weaknesses and trying to break into your blog right now. Whether they will hack in or not, depends on how hard or easy you can make it for hackers to keep persisting until they discover a way to get access, or give up and decide to look for an easier target.

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

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

Hackertarget - WP Security Scan(WordPress Security Check Product image source: Hackertarget.com)

You will see that the check returns various results and details about your website …

Hackertarget - WP Security Check

(WP security scan results. Product image source: Hackertarget.com)

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

Website Security Scan(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 can be useful information to hackers, as this informs them about potentially exploitable vulnerabilities, especially where the owners haven’t updated their software versions.

If your site or blog is powered by WordPress and you’re not preventive steps to toughen up your site, then we can practically guarantee that, at some time in the near future, someone will attempt to hack your website, because these brute-force attacks are systematically hitting WordPress installations around the world!

Whenever a website or blog is 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 modified or even that their content has been entirely wiped out. Typically, most compromised sites will be infected with malicious scripts without the owner’s knowledge or awareness.

To avoid the heartache and aggravation of having your site being hacked into, below are ten simple, yet essential and effective security checks that will help to protect your WordPress site from being brute force attacked.

Note

Note: A few of the steps below require some technical understanding of how to modify core WordPress and server files. If you are not technical-minded, 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 webhosting service provider and ask them what systems have been put in place to protect your site from being attacked, and what they are doing to make sure that your site files are regularly being backed up.

Make sure that your web host regularly backs up your server files and that, if anything happens, you can quickly and easily recover your files.

Security Measure #2 – Back Up Your WordPress Data And Files And Keep Your Website Frequently Up-To-Date

Never rely only on your webhosting provider for site backups. Instead, learn how to manage your WordPress site or get this done for you and develop a habit of performing a complete WordPress site maintenance routine on a regular basis (e.g. daily, weekly, fortnightly, etc …)

A full WordPress maintenance routine ensures that:

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

A complete WordPress maintenance routine looks like this …

Maintaining your WP installation regularly backed up and updated is vitally important for WordPress security.(Maintaining your WordPress installation fully backed up and updated is vitally important for WordPress security. Image source: WPTrainMe.com)

Again, we cannot stress enough how important maintaining your WP site completely backed up and up-to-date is. WordPress site maintenance is not hard 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 WP maintenance yourself, pay someone 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 WordPress plugins you can use. Learn about a WordPress backup plugin that can fully automate your backup process here: Backup, Duplicate & Keep Your WP Websites And Blogs Protected With Backup Creator Plugin For WP

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

The large scale brute force attack on WordPress sites was mostly an attempt to compromise website administrator panels by exploiting WordPress sites with “admin” as their username.

For reasons of website security, never install sites with the username admin. This is the first area hackers will test. If your site’s username is admin, then make sure you change it immediately.

For a detailed step-by-step tutorial that shows you how to change your admin username, go here: Changing Your WordPress Admin Username To Another Username

Security Measure #4 – Choose Strong Passwords

A “brute force” attack occurs when malicious software continually and persistently tries to guess the right username and password character string that will give the hacker entry to your site.

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 keep attacking your site until it eventually “cracks” the code.

Weak passwords, therefore, make very easy targets for attacks. Make sure that you change your password combination to a string containing at least eight characters long, with both upper and lowercase letters, combined with a few “special” characters (e.g. %, #, @, etc).

Tip

Roboform is a password management software that lets you easily create really secure passwords …

Roboform is a password management tool that lets you generate strong passwords(Roboform is a password program that lets you easily generate secure login passwords)

For a tutorial on how to change your WordPress password, go here: Changing Your WordPress Password

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

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

WP Config file

(wp-config.php file)

If hackers break into your website, they will typically look for the wp-config.php file, because this is the file that contains your database information, 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 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

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

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

Security Measure #7 – Keep Your WordPress Installation, Plugins And Themes Up-To-Date

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

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

Security Measure #8 – Disable Your Theme Editor

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

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

WordPress Theme Editor Menu

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

This allows anyone accessing your site to view and edit your theme files, or create mayhem on your site.

To prevent unauthorized 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 – Protect The Site’s Uploads Folder

The WordPress “uploads” directory stores all the media files that get uploaded to your website.

By default, this folder is visible to online users. All a person needs to do to view all of the contents stored in the “uploads” directory is visit your directory using their web browser …

(WordPress uploads folder)

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

If any directories in your website have weaknesses or vulnerabilities that can be exploited by hackers, someone could upload unauthorized file types to 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, adding 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 ask for assistance from someone with experience if you are not sure about what to do.

Security Measure #10 – Use WordPress Security Plugins

There are a number of great security plugins for WordPress available that will address common security issues faced by WordPress website 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 WordPress plugin that does a comprehensive job of scanning, fixing and preventing issues that could lead to hackers accessing your files and causing irreparable damage to your site is SecureScanPro.

SecureScanPro - WordPress complete security software

(SecureScanPro – security software solution for WordPress)

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

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

Blog Defender

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

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 WordPress Security SolutionAnd then shows you how to fix these quickly …

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

No matter what kind of business you run or plan to run online and how small you think your web presence is, you cannot ignore the importance of website security.

As a final reminder, below is the advice given by an expert on web security to all WordPress users following the global 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 of the utmost importance if you run a WordPress site. Hopefully, the information in this article will help 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 via email when we publish new articles and tutorials on WordPress security and reviews of new WordPress security plugins and solutions.

***

"Learning WordPress has been a huge stumbling block for me. I've been looking for something that covers absolutely everything but doesn't cost an arm and a leg. Thank you so much ... you have just provided me with what I have been looking for! Truly appreciated!" - Tanya

***