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 SecurityPowering millions of websites around the world makes WordPress a target for hacking attempts.

In April 2013 a global brute-force attack hit WordPress installations on virtually every web host in existence around the world.

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

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

About 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 a WordPress site is by trying to guess the site’s administration login username and password. This is done using scripts and software tools that can guess hundreds of login permutations in minutes.

If you’re using obvious login details, your website can be an easy target for hackers.

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

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

Botnets are often used to blast out mass spam emails.

The screenshot below was taken from an online security monitoring site showing the locations of the command centers of ZeuS – a botnet that has been actively compromising computer networks all around the world since 2009 …

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

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

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

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

Being the world's most used CMS makes WordPress a target for attempted attacks by malicious users

(Powering millions of sites worldwide makes WordPress a target for attempted hacking attacks)

Does This Mean We Shouldn’t Use WordPress Anymore?

No. In fact, there are lots of good reasons why you should choose WordPress if you are concerned at all about the security of your web presence.

We explain why WordPress is a secure platform for websites in this article: Are Open Source Web Platforms Like WordPress Secure?

Info

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

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

How To Prevent Your WordPress Site From Being Brute-Force Attacked – Ten Security Points

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

If a malicious user can discover a way to gain remote access and control of your blog, that web site can then be used as a “bot” to attack other valuable websites.

Additional undesirable impacts of having your website hacked include being blacklisted by Google, having spammy links promoting things like gambling, cheap offers on brand names, etc. inserted into your content and meta data, redirecting visitors to phishing sites and other websites, data exfiltration (stealing customer details or Personal Identifiable Information from your web applications), and lots of other nasty things.

The harsh reality is that software-driven bots are probably trying to hack into your website while you are reading this right now. Whether they will break into your site successfully or not, will depend on how difficult you can make it for them to keep persisting until they can discover a way to get in, or give up and go look for a less protected target.

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

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

Website Security Scan(Hackertarget – WordPress Security Scan Image source: Hackertarget.com)

You will see that the check will yield a number of results and details about your website …

Hackertarget - WordPress Security Scan

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

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

Hackertarget - WP Security Check(Screenshot: BlogDefender site)

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 useful information to hackers, as this informs them about exploitable holes or weaknesses, especially where site owners haven’t updated their software versions.

If your site or blog is powered by WordPress and you are not taking appropriate steps to bolster the security of your site, we can practically guarantee that, at some point in time, someone will attempt to hack your site, because these attacks are systematically targeting WordPress sites worldwide!

When a website or blog is hacked, webmasters will find themselves completely “locked out” of their own site, or notice that their content has been interfered with or that everything has been entirely wiped out. Typically, most sites will be infected with malicious scripts or viruses without the owner’s knowledge or awareness.

To avoid the heartache and frustration (and potential financial loss) that comes with having your website being hacked into, we have listed below ten essential and effective security checks that will help to prevent your WordPress site from being attacked by brute-force hackers.

Useful Info

Note: Some of the recommended measures listed below need some technical understanding of how to modify core WordPress and/or server files. If you are not technical-minded, or don’t want to mess around with file code, then ask your web host or a professional WordPress technical provider for assistance.

***

Security Measure #1 – Contact Your Hosting Company

Contact your webhosting provider and ask them what security precautions have been put into place to protect your site from being attacked, and what is done to ensure that your files and data get regularly backed up.

Make sure that your host regularly backs up your server files and that, if anything goes wrong, you can quickly and easily get your files and data back.

Security Measure #2 – Perform Full WordPress Backups And Keep Your Website Or Blog Frequently Maintained

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

A proper WordPress maintenance routine ensures that:

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

A complete WP site maintenance routine looks like this …

Maintaining your WordPress website or blog backed up and up-to-date is vitally important for WordPress security.(Maintaining your WP installation frequently 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 WP website or blog fully backed up and updated. 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 WordPress site maintenance yourself, get someone else 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 you are still breathing!

If you don’t want to perform manual backups, there are a number of free and paid plugins you can use. Learn about a WordPress backup plugin that can automate your site backups here: Back Up, Clone And Protect Your WordPress Web Sites With Backup Creator WordPress Plugin

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

The brute force botnet attack on WordPress sites was mostly an attempt to compromise site administrator panels by exploiting installations with “admin” as their user name.

For website security reasons, avoid setting up sites with the username “admin”. This is the first area of potential vulnerability hackers will test. If your site’s username is “admin”, then change it immediately.

For a detailed tutorial on how to change your WordPress username, go here: How To Change Your WordPress Username From Admin To A More Secure Username

Security Measure #4 – Change Your Password

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

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

Weak passwords, therefore, are very easy targets for hackers. Make sure that you change your password combination to a string containing at least eight or nine characters long, with upper and lowercase letters, and add a few “special” characters (%^#$@&*).

Useful Tip

Roboform is a password management program you can use to create secure passwords …

You can use a password program like Roboform to generate hard-to-guess passwords(Roboform is a password management tool you can use to create strong login passwords)

We have created a tutorial for WordPress users on how to change your admin password here: What To Do If You Need To Change Your Password

Security Measure #5 – Prevent Access To 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 file)

If hackers break into your site, they will normally search for your wp-config.php file, because this is the file that contains your database details, security keys, etc. Getting access to this information would allow them 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, you must prevent your wp-config.php file from being 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

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

These files can be deleted after installation. If you don’t want to delete these files, just rename them.

Security Measure #7 – Upgrade Your WordPress Files, Themes And Plugins

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

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

Security Measure #8 – Disable Your Theme Editor

WordPress installations come with a built-in editor that lets the site administrator edit plugin and theme files inside the dashboard.

You can access the WordPress Theme Editor by selecting Appearance > Editor from your dashboard menu …

WordPress Theme Editor Menu

(Accessing the WordPress theme editor using the main menu)

This means that anyone logging into your blog’s admin area can view and change your theme files, 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 editing your wp-config.php file.

Security Measure #9 – Prevent Access To Your Site’s Uploads Directory

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

Normally, this folder is visible to all users online. All someone has to do to view all of the contents in your “uploads” directory is navigate to your directory using a web browser …

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

(WordPress uploads folder)

If any directories in your website have weaknesses or vulnerabilities that can be exploited by hackers or malicious users, someone can upload unauthorized file types or compromise the security of your website.

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, adding 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 hire a professional if you are unsure about what to do.

Security Measure #10 – Use WordPress Security Plugins

Some great WordPress security plugins are available that will address most security issues WordPress website owners face, such as preventing hackers from gaining access to vital information about your site, protecting your site from malicious software, 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 issues that could lead to hackers accessing your files and damaging your site is SecureScanPro.

SecureScanPro - WP security plugin

(SecureScanPro – WordPress total security plugin)

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 plugin you may want to look at using is BlogDefender.

Blog Defender Security Plugin For WordPress

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

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

BlogDefender shows you where potential security weaknesses in your website are …

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

Blog Defender Security Solution For WordPress Web SitesIf 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 very secure platform, but neglecting essential maintenance tasks like keeping your WP core files, plugins and WordPress themes updated to their latest versions, tightening file and data security 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, you cannot afford to ignore the importance of securing your sites.

As a final reminder of the importance of website security, below is the advice given by a web security expert to all WordPress users after the large-scale 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 provided you with the initial guidelines and help you need 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 WordPress security specialist, or search for a professional WordPress technical provider in our WordPress Services Directory.

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

***

"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

***