Blog

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 SecurityBeing the world’s most used content management system makes WordPress an easy target for hackers.

In April 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 installations).

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 methods hackers use to try and break into a WordPress site. One of these is by trying to guess the site admin’s login username and password. This can be done with scripts and software tools that automatically tries to guess hundreds of login combinations in minutes.

If you’re using obvious user names and predictable passwords, your website can be an easy target for hacking attempts.

This is called a “brute-force” login attack.

Botnets – What Are They?

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

Botnets are often used to blast out mass spam emails from the infected computers of compromised user accounts.

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

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

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

These were highly distributed and well organized attacks on WordPress sites. Over 90,000 IP addresses were identified by a number of hosting companies in the initial attack alone, when millions of attempts to force their way into WordPress users administration areas occurred. The worldwide attacks continued after this, with over 30,000 WordPress blogs being hacked per day.

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

Being the world's most popular content management system makes WordPress an obvious target for hackers

(WordPress powers millions of websites worldwide, which makes it a target for hacking attempts)

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

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

We explain what makes WordPress a very secure platform for websites in this article: Can You Build A Secure Business Online Using WordPress?

Important

It’s important to note that, in the case of April 2013 brute-force botnet attack described above, there was no WordPress vulnerability being exploited (the same script was also attacking sites built using other CMS 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)

Protecting Your WordPress Site From Brute Force Attacks – Ten Security Measures

Every blog with a security vulnerability presents an opportunity to hackers. No matter what type of business you run or plan to run online and how small you think your web presence is, you simply cannot afford to ignore the importance of website security. Business web sites, personal blogs, government sites … even websites owned by web security experts can and have been targeted.

If hackers can discover a weakness in the security setup, that site can then be employed as a “bot” to attack other valuable sites.

Additional undesirable impacts of having your website hacked include getting blacklisted by search engines, having spammy links advertising things like viagra, 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 many other nasty things.

The truth is that hackers are very likely trying to hack into your blog right now. Whether they can break into your site or not, will depend on how difficult or easy you can make things for them to continue persisting until they discover a way to get access, or give up and decide to look for a less secure target.

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

Does your website run on WordPress? If so visit a site like Hackertarget.com and run your website through their WordPress security scan …

Website Security Check(Website Security Scan Image source: Hackertarget.com)

You will see that the test will yield a number of results and details about your site …

WordPress Security Check

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

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

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

Being able 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 in your site can be valuable information to hackers, as this informs them about any exploitable holes or weaknesses, especially where site owners haven’t updated their sites.

If your site or blog runs on WordPress and you are not taking appropriate steps to harden your site, it’s practically guaranteed that, at some point in time, someone will attempt to hack your website, because these brute force attacks are systematically hitting WordPress installations worldwide!

When a website gets hacked, 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 altered or that everything has been entirely wiped out. Typically, sites will be infected with malicious scripts without the owner even being aware that a security breach has occurred.

To help avoid the heartache and aggravation (and potential loss of valuable business data) that comes with discovering that your web site has been hacked into, we have listed below 10 essential and effective security checks that will help to prevent your WordPress site from being brute force attacked.

Disclaimer

Note: Some of the recommended steps shown below need some technical skills to modify core WordPress and/or server files. If you have no web editing skills, or don’t want to mess around with file code, then ask your web host or a professional WordPress service provider for help.

***

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

Get in touch with your host and ask them exactly what measures have been put into place to protect your site from being attacked, and what is done to make sure that your WordPress sites get regularly backed up.

It’s important to check that your hosting service provider is backing up your server files and that, if anything happens, you can easily recover your site.

Security Measure #2 – Back Up Your WordPress Data And Files And Keep Your Website Frequently Maintained

Never rely on your web host for your site backups. Instead, learn how to maintain your WordPress site or get this service done for you and maintain a habit of religiously performing a complete site maintenance routine on a regular basis (e.g. weekly, monthly, etc …)

A complete WordPress maintenance routine ensures that:

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

A proper WordPress maintenance routine looks like this …

Maintaining your WordPress website completely backed up and updated is vitally important for WordPress security.(Maintaining your WP website regularly backed up and updated is vitally important for WordPress security. Screenshot image: WPTrainMe.com)

Again, we cannot stress enough how vitally important it is to maintain your WordPress web site fully backed up and up-to-date. WP site 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 maintenance yourself, get someone else to do it but make sure this gets done. Backing up your website is the second most important thing you should do after making sure that your heart is still beating!

If you don’t want to perform manual backups, there are many WordPress plugins you can use. You can read about a WordPress backup plugin that can fully automate your site backups here: Backup, Copy And Protect Your WordPress Site With Backup Creator WP Plugin

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

The mass brute-force botnet attack on WordPress is mostly attempting to compromise site admin panels by exploiting WordPress sites using “admin” as the account 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 user name is admin, then make sure you change it immediately.

For a simple step-by-step tutorial for admin users that shows you how to change your admin username, go here: How To Change Your WP User Name From Admin To Another User Name

Security Measure #4 – Use A Strong Password

A “brute force” attack occurs when a malicious script continually tries to guess the right combination of characters in a password and username that will give them access to your website.

Unless you put some measure in place to block the brute force attack (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 “cracks” the code.

Passwords that are easy to guess, therefore, make really easy targets for attacks. Make sure that you change your password combination to a string that contains at least eight characters long, with both upper and lowercase letters, combined with “special” characters (e.g. ^, #, &, etc).

Tip

You can use a password program like Roboform to generate hard-to-guess passwords …

You can use a password management tool like Roboform to create secure login passwords(You can use a password management tool like Roboform to help you generate unbreakable passwords)

We have created a detailed tutorial for non-technical admin users on how to change your admin password here: What To Do If You Need To Reset Passwords

Security Measure #5 – Prevent The wp-config.php File From Being Easily Accessible

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

WP Config file

(WordPress WP Config file)

If a hacker breaks into your WordPress site, they will normally try to access your wp-config.php file, because this file contains your WordPress database information, 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 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 Blog 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, then just rename them.

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

Hackers search for vulnerabilities in older versions of WordPress that they can exploit, including out-of-date versions of WP plugins and themes.

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

Security Measure #8 – Disable Your WordPress Theme Editor

WordPress comes with a built-in editor feature that allows the administrator to edit theme and plugin code from the dashboard.

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

WP Theme Editor Menu

(The WordPress theme editor is accessible using the WordPress dashboard menu)

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

To prevent 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” directory stores all the media files that get 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 in your “uploads” directory is visit your directory using their web browser …

(WordPress uploads directory)

(WordPress uploads folder)

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by hackers or malicious users, this can seriously threaten the security of your website.

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 file with nothing in it called “index.php”) to your uploads directory, and so on. Again, it’s best to seek professional help if you are not sure about what to do.

Security Measure #10 – WordPress Security Plugins

A number of great WordPress security plugins are available that will address most security issues WordPress website owners face, such as preventing unauthorized users from accessing vital areas of your site, protecting your site from botnets, preventing injections of code into files, etc.

Many WordPress plugins address some but not all areas of WordPress security. One plugin that seems to do a comprehensive job of scanning, fixing and preventing issues that could lead to hackers accessing your website files and damaging your site is SecureScanPro.

SecureScanPro - WordPress complete security software solution

(SecureScanPro – complete security software for WordPress)

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

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

Blog Defender Security Plugin

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

Blog Defender is a suite of WordPress security video tutorials, plugins and tools, plus a WordPress security PDF/DOC file.

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

Blog DefenderAnd lets you fix these quickly and easily …

Blog Defender WordPress Security SuiteIf you don’t want to purchase a premium 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 very secure web platform, but neglecting essential maintenance tasks like updating your WordPress installation, WordPress plugins and themes, tightening file and data security and taking other necessary precautions can expose your site to malicious by hackers and bots.

No matter what type of business you run or plan to run online and how small you think your web presence is, web security is something you simply cannot 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 global 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 above information 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 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 via email when we publish new articles and tutorials on WordPress security and reviews of new WordPress security plugins and solutions.

***

"I love the way your email series "Infinite Web Content Creation Training Series" is documented and presented. It is very absorbing and captivating. The links and tutorials are interesting and educational. This has motivated me to rewrite my content following the concepts I am learning from the email series." - Mani Raju, www.fortuneinewaste.com

***