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 SecurityWhen you are the world’s leading content management system and the preferred online publishing platform used by millions of businesses and loved by thousands of website developers and web designers, it’s inevitable that at some point in time, WordPress will become an easy target for attacks by hackers.

In April 2013, WordPress installations around the world were subjected to a global-scale brute force attack.

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

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

Brute Force Attacks – Definition

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 achieved using scripts and tools that automatically tries to guess hundreds of possible login combinations in minutes.

If you’re using weak usernames and passwords, your website could be easily hacked by persistent attempts to work out your site’s login details.

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)

A “Botnet” is a network of private computers that have been compromised and infected with malicious code, which are then controlled remotely as a group, typically without the unsuspecting computer owners’ knowledge or awareness.

Botnets are typically 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 …

The Zeus botnet has been actively compromising 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. Screenshot: SecureList.com)

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

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

WordPress often is targeted by hackers

(Being the world’s most popular content management system makes WordPress an obvious target for hacking)

Does This Mean We Should Stop Using WordPress?

No. In fact, there are lots of good reasons why you should continue using WordPress if you are concerned at all about website security.

We explain what makes WordPress a very secure platform for websites in this article: Is WordPress Secure?

Important

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

Mike Little, the co-founder of WordPress, made the following comment about the botnet 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 Blog From Being Brute-Force Attacked – 10 Security Checks

Every web site with a security vulnerability has some degree of potential value to hackers. No web site Large, medium and small business web sites, personal blogs, government websites … even web sites owned by online security and anti-hacking experts can and have been targeted.

If someone can exploit a security flaw that allows them to access and take over your web site, that website or blog can then be used to attack more highly-valued web sites.

Additional undesirable effects of having your website hacked include getting blacklisted by search engines, having spammy links advertising things like viagra, porn, etc. in your content and meta data, redirecting visitors to phishing sites, drive-by downloads (adding malicious scripts on your visitors’ computers), and many other nasty things.

The reality is that software-driven bots are very likely trying to break into your web site right now. Whether they will break in successfully will depend on how difficult you have made it for them to keep trying until they can work out how to get in, or are forced to give up and go look for an easier target.

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

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

Hackertarget - WP Security Scan(WP Security Check Screenshot: Hackertarget.com)

You will see that the scan will display a number of results and details about your site setup …

Hackertarget - Website Security Check

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

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

Website Security Scan(Product image: BlogDefender site)

Being able 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 all be useful information to hackers, as these can inform them about any exploitable security weaknesses, especially where site owners haven’t updated their software versions.

If your site or blog is driven by WordPress and you are not preventive steps to bolster the security of your site, then it’s practically guaranteed that, at some time in the near future, your site will be hacked, or at least targeted by bots, because these brute force attacks are systematically hitting WordPress sites around the world!

Typically, when a website gets compromised, 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 altered or that everything has been entirely wiped out. Often, compromised sites will be infected with malicious scripts or viruses without the owner’s knowledge or awareness.

To avoid the heartache and frustration (and potential loss of valuable business data) of having your website or blog being hacked into, we have listed below ten simple, yet essential and effective security checks that will help to prevent your WordPress site from being attacked by brute force botnets.

Useful Information

Note: Some of the recommended measures below require some technical skills to modify core WordPress and/or server files. If you have no web skills, or don’t want to mess around with code on your site, then ask your web host or search for a professional WordPress service provider in our WordPress Services Directory.

***

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

Contact your hosting provider and ask them what security measures have been put into place to protect your site from brute-force attacks, and what they are doing to make sure that your site files get backed up.

Check that your web host is backing up your server files and that, if anything happens, you can quickly and easily get your files back.

Security Measure #2 – Perform Regular WordPress Backups And Keep Your Website Frequently Maintained

You should never rely just 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 WordPress site maintenance routine on a regular basis (e.g. weekly, fortnightly, etc …)

A proper WordPress maintenance routine ensures that:

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

A complete WP maintenance routine looks like this …

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

Again, we cannot stress enough how important it is to maintain your WP website or blog regularly backed up and up-to-date. WordPress maintenance is not hard or time-consuming, but it must be done to ensure the security of your website. If you don’t want to learn how to do WP maintenance yourself, get someone else to do it but make sure this gets done. Backing up your site is the next most important thing you must do after making sure that you still have a pulse!

If you don’t want to perform manual backups, there are a number of WordPress plugins you can use. Learn about a WordPress backup plugin that can automate your backup process here: Backup, Copy & Protect Your WordPress Web Sites With Backup Creator WordPress Plugin

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

The mass brute-force botnet attack on WordPress sites was mostly an attempt to compromise website administrator panels and gain access to the site by exploiting installations with “admin” as the username.

For security purposes, don’t set up sites with the username “admin”. This is the first area hackers will test. If your blog’s username is “admin”, you will should change it immediately.

For a detailed tutorial for non-technical WordPress users on how to change your username, go here: Changing Your Admin Username In WordPress

Security Measure #4 – Use Strong Passwords

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

Unless you put some measure in place to prevent 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 breaks into your admin area.

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

Tip

If you have trouble coming up with strong passwords or you are reluctant to set up different passwords for all your online logins, then use a password tool like Roboform …

You can use a password management program like Roboform to help you generate strong passwords(Roboform is a password management program you can use to generate different secure passwords)

For a simple step-by-step tutorial created especially for non-technical WordPress admin users that shows you how to change your password, go here: How To Change A Password In WordPress

Security Measure #5 – Deny Access To Your wp-config.php File

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

wp-config.php file

(wp-config.php file)

If hackers break into your website, they will look for your wp-config.php file, because this file contains your database information, 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, you must prevent your wp-config.php file from being accessible. 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 Website Installation Files

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

You can remove these files after installation, as they are unnecessary. If you don’t want to remove these files, then just rename them.

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

Hackers are always on the lookout for vulnerabilities in outdated versions of WordPress that can be exploited, including out-of-date versions of WordPress plugins and themes.

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

Security Measure #8 – Disable The WordPress Theme Editor

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

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

WordPress Theme Editor Menu

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

The WordPress theme editor feature allows anyone accessing your site’s admin area to view and edit your theme templates, and cause mayhem on your site.

If you want to prevent people from accessing your WordPress Theme editor, you will need to disable it. This can be done by editing your wp-config.php file.

Security Measure #9 – Remove Access To Your Site’s Uploads Folder

The “uploads” directory contains all the media files that get uploaded to your blog.

Normally, this folder is visible to all users online. All a person needs to do to see the contents in your site’s “uploads” folder is navigate to your directory using their web browser …

(WordPress uploads directory)

(WordPress uploads directory)

If any files stored in his folder have vulnerabilities that can be exploited by hackers or malicious users, someone could upload unauthorized file types or compromise 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, adding 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 get professional assistance if you are not sure about what to do.

Security Measure #10 – Install Security Plugins

There are several security plugins for WordPress available that specifically address common security issues faced by WordPress site owners, such as preventing unauthorized users from accessing vital areas of your site, protecting your files from malicious exploits, preventing unauthorized file uploads, etc.

Many 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 causing damage to your site is SecureScanPro.

SecureScanPro - complete security software solution for WordPress

(SecureScanPro – WordPress total security software)

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 consider using is BlogDefender.

Blog Defender

Blog Defender WordPress Security Solution(Blog Defender)

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

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

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

Blog Defender Security Solution For WordPress Web SitesIf you don’t want to buy a premium security plugin like SecureScanPro or BlogDefender, then use various free plugins, such as Limit Login Attempts

Limit Login Attempts - WordPress Security Plugin

WordPress is a very secure platform, but neglecting simple maintenance tasks like ensuring that your WP core files, plugins and WordPress themes are kept up-to-date, 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, you cannot ignore the importance of securing your websites.

As one last reminder of the importance of keeping your websites protected, below is the advice given by an expert on web security to all WordPress users after the mass 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 information in 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 WordPress service provider in our WordPress Services Directory.

Also, please remember to subscribe to WPCompendium.org to be notified via email whenever we publish new tips on WordPress security and reviews of new WordPress security plugins.

***

"I am beyond impressed with what you have put together. I can tell that you put a ton of hard work into building what you have. You have the absolute best content on WordPress I have ever seen!" - Robert T. Jillie

***

Originally published as How To Protect Your WordPress Site From A Brute-Force Attack.