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 world’s most popular CMS platform and the online publishing platform of choice used by millions of websites and loved by thousands of web 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 2013, WordPress installations around the world were subjected to a worldwide brute force attack.

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

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

Brute-Force Attacks – An Overview

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’s administration login username and password. This is achieved using scripts and tools that automatically tries to guess hundreds of possible login combinations in minutes.

If you’re not using strong usernames or unguessable passwords, your website could be easily hacked by the software’s repeated attempts to guess your site’s login details.

This is called a “brute force” attack.

Botnet Definition

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 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 going on.

Botnets are often 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 a botnet that has been actively infecting computer networks all around the world 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 compromising computer networks all around the globe since 2009. Screenshot source: SecureList.com)

These ongoing botnet attacks were well organized and highly distributed. Over 90,000 IP addresses were identified by several hosting companies in the initial attack alone, when the web was flooded with millions of attempts to force their way into WordPress users admin areas. The worldwide brute force attacks continued after this, with over 30,000 WordPress blogs being hacked each day.

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

WordPress powers millions of sites around the world, which makes it an obvious target for hackers

(WordPress is often the target of malicious attacks by hackers)

Does This Mean We Shouldn’t Use WordPress Anymore?

No. In fact, there are many good reasons why you should continue using 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: Is WordPress Secure?

Info

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

Mike Little, one of the co-founders of WordPress with Matt Mullenweg, 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 Being Brute Force Attacked – Ten Security Checks

You may think that your website has nothing to offer to hackers, but the reality is that to a hacker, all websites provide an opportunity to gain some advantage at your expense.

If a hacker can exploit a security flaw that allows them to gain access and control of your site, that website or blog can then be employed to target more highly-valued sites.

Additional undesirable consequences of having your site hacked and your site security compromised include being blacklisted by Google, having stealthy spam links promoting things like online meds, discounted fashion, etc. inserted into your content and page title and descriptions, malicious redirects to phishing sites, drive-by downloads (adding malicious programs on your visitors’ computers), and many other nasties.

The truth is that malicious bots are very likely trying to break into your website or blog at this very moment. Whether they will successfully hack in or not, depends on how hard or easy you have made it for hackers or bots to continue trying until they either can work out how to get access, or are forced to 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 Hackertarget.com and run your website through their WordPress security scan …

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

You will see that the test will return various results and information about your website …

Hackertarget - WP Security Check

(website security scan results. Source: Hackertarget.com)

It should be obvious after using the above tool that if you are able to freely access all of this information about your website, so can hackers.

WP Security Scan(Product image: BlogDefender.com)

Being able to see which 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 can be potentially valuable information to hackers, as this can inform them about potentially exploitable security weaknesses, especially where the owners haven’t updated their files.

If your site or blog is driven by WordPress and you are not taking 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 sites all the world!

Whenever a website is broken into, blog owners can discover much to their dismay that they have been “locked out” of their own site, or notice that their files have been interfered with or even that their content has been entirely wiped out. Typically, sites will become infected with malicious software or viruses without the owner even being aware that this has occurred.

To avoid the heartache and aggravation that comes with discovering that your site has been hacked into, we have listed below ten essential and effective security measures that will help to protect your WordPress site from being brute force attacked.

Note

Note: Some of the recommended measures below require 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 code on your site, then ask your web host or search for a WordPress technical provider in our WordPress Services Directory.

***

Security Measure #1 – Get In Touch With Your Hosting Company

Get in touch with your webhosting provider and ask them what security precautions are in place to protect your site from brute-force attacks, and what is done to ensure that your server files and data get regularly backed up.

It’s important to check that your host is regularly backing up your sites and that, if anything happens, you can easily get your site back.

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

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

A complete WordPress maintenance routine ensures that:

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

A proper WordPress maintenance routine looks like this …

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

Again, we cannot stress enough how vitally important it is to maintain your WordPress installation frequently backed up and up-to-date. WP maintenance is not hard to do 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 site maintenance yourself, pay a professional to do it but make sure it gets done. Backing up your site is the second most important thing you should do after making sure that you still have a pulse!

If you don’t want to perform manual backups, there are many WordPress plugins you can use. Learn about a WordPress backup plugin that can fully automate your site backups here: Backup, Clone And Keep Your WordPress Web Site Protected With Backup Creator Plugin For WordPress

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 and gain access to sites by exploiting installations with “admin” as the username.

For security purposes, avoid installing WordPress sites with the username admin. This is the first area of potential vulnerability hackers will test. If your site’s user name is admin, you need to change this immediately.

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

Security Measure #4 – Your Password

A “brute force” attack occurs when a malicious script persistently hits a username and password field with different character strings in an attempt to guess the right login combination that will give them access to your website.

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 suggestions for doing this), the “bot” will just keep attacking your site until it eventually works out the combination.

Passwords that are easy to guess, therefore, become very easy targets for bot attacks. Make sure that you change your password to a string that contains at least 8 characters long, with both upper and lowercase letters, and add a few “special” characters (%^#$@&*).

Practical Tip

You can use a password management program like Roboform to create hard-to-crack passwords …

Roboform is a password management program that lets you generate really secure passwords(Roboform is a password management tool you can use to generate really secure passwords)

For a detailed step-by-step tutorial for WordPress users that shows you how to change your admin password, go here: Changing The Login 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 options for WordPress.

WP Config file

(WordPress WP Config file)

If a hacker breaks into your website, 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 them 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, 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 – Rename Or Delete Unnecessary Installation Files

Rename or delete your install.php, upgrade.php and readme.html files.

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

Security Measure #7 – Update Your WordPress Installation, Plugins & Themes

Hackers are always on the lookout for vulnerabilities in previous versions of WordPress that can be exploited, 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 The Theme Editor

WordPress installations come with a built-in editor that allows site administrators to edit theme and plugin files from the dashboard.

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

WP Theme Editor Menu

(Accessing the WordPress theme editor via the main menu)

The WordPress theme feature lets anyone accessing your blog’s admin area view and make changes to all of your files, or cause havoc on your site.

If you want to prevent unauthorized people from being able to access your 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 – Protect Your WordPress Uploads Folder

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

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

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

(WordPress uploads directory)

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

Protecting your directories will prevent online users 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 an empty 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 – Install Security Plugins

There are a number of WordPress security plugins available that specifically address most common security issues faced by WordPress site owners, such as preventing hackers from accessing your site, protecting your website from malicious exploits, 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 damaging your site is SecureScanPro.

SecureScanPro - WP complete security software

(SecureScanPro – WP complete security software solution)

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

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

Blog Defender Security Solution

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

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

BlogDefender shows you where the security weaknesses in your web site are …

Blog DefenderAnd lets you fix these quickly, easily and inexpensively …

Blog Defender Security SuiteIf you don’t want to purchase a security plugin like SecureScanPro or BlogDefender, then use various free WP plugins, such as Limit Login Attempts

Limit Login Attempts - WordPress Security Plugin

WordPress is a secure platform, but neglecting essential maintenance tasks like updating your WordPress installation, plugins and WP themes, tightening file and data protection and taking other necessary precautions can have disastrous consequences.

No matter what kind of business you run or plan to run online and how small you think your web presence is, securing your web site is something you simply cannot afford to ignore.

As one last 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, WordPress security is very important if you run a WordPress site. Hopefully, this article has shown you what to do to prevent brute force attacks on your WordPress site. If you need any further help or assistance with WordPress security, please seek help from a professional WordPress security specialist, or search for a professional WordPress service provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to be notified whenever we publish new information on WordPress security and reviews of new WordPress security plugins.

***

"These tutorials have so much information and are easy to understand. If you use WordPress or plan to in the future these will help you with everything you need to know." - Valisa (Mesa, Arizona)

***