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 popular content management system makes WordPress a natural target for malicious attacks by hackers.

In early 2013 a worldwide brute force attack struck WordPress installations across virtually every WP host server in existence around the world.

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

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 use to try and break into a WordPress site is by trying to guess the site’s administration login username and password. To do this, hackers use scripts and tools that automatically tries to guess hundreds of possible logins in minutes.

If you’re not using strong usernames or unguessable passwords, your site could be easily hacked by a malicious script’s persistent attempts to guess your site’s login details.

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)

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

Botnets are typically used to send mass spam emails from the infected computers of compromised user accounts.

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 compromising computer networks all around the world since 2009 called “Zeus” …

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

(ZeuS is a botnet that has been actively infecting computer networks all around the globe since 2009. Image: SecureList.com)

These botnet attacks were well organized and highly distributed. Over 90,000 IP addresses were identified by a number of webhosting 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 large-scale brute force attacks then continued, with over 30,000 WordPress sites and blogs being hacked per day.

Coverage of this brute force attack was reported by all of the major webhosting companies, as well as the leading technology media publications, such as TechNews Daily, Forbes, BBC News, PC Magazine, Tech Crunch, 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 attempted hacking attacks

(WordPress powers millions of websites and blogs worldwide, making it a frequent target for malicious attacks by hackers)

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 online presence.

To understand what makes WordPress a very secure platform for websites, see this article: Is WordPress A Secure Platform For Websites?

Important Info

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

How To Prevent Your WordPress Blog From Being Brute Force Attacked – 10 Security Checks

You may think that the information in your site has no value to hackers, but the reality is that to a hacker, all websites provide an opportunity to benefit or profit at your expense.

If someone can exploit a security weakness, that blog can then be employed to target more valuable web sites.

Additional undesirable impacts of having your site hacked include being blacklisted by Google, having spammy links advertising things like casinos, porn, etc. inserted in your content and page title and descriptions, redirecting visitors to phishing sites or other websites, drive-by downloads (adding malicious scripts on your visitors’ computers), and lots of other nasty things.

The truth is that malicious bots are scouring for weaknesses and trying to hack into your site at this very moment. Whether they can get into your site successfully depends on how difficult or easy you have made it for hackers to keep trying until they either can work out how to get access, or are forced to give up and decide to look for a less secure target.

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

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

Hackertarget - Website Security Scan(Hackertarget – WP Security Scan Source: Hackertarget.com)

You will see that the scan returns a number of results and information about your website …

WP Security Scan

(WP security check results. Screenshot: 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 - WordPress Security Check(Image source: BlogDefender.com)

The ability 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 are all potentially valuable information to hackers, as this informs them about any exploitable security vulnerabilities, especially where the owners haven’t updated their software versions.

If your site or blog is driven by WordPress and you are not preventive steps to bullet-proof your site, 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 attacks are systematically hitting WordPress sites worldwide!

Whenever a website or blog gets hacked, webmasters will find themselves “locked out” of their own site, or notice that their content has been interfered with or even entirely wiped out. Often, sites will become infected with malicious scripts or viruses without the owner even being aware that this has happened.

To avoid the heartache (and significant loss of valuable business data) of discovering that your site has been hacked into, we have listed below ten simple, yet essential and effective security measures that will help to prevent your WordPress site from brute force attacks.

Note

Note: Some of the recommended steps below require some technical understanding of how to modify core WordPress or server files. If you lack these technical 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 – Contact Your Host

Get in touch with your webhosting service provider and ask them exactly what security precautions have been put in place to help prevent your site from being attacked, and what they do to ensure that your site files are being backed up.

Make sure that your web host is regularly backing up your sites and that, if disaster strikes, you can quickly and easily recover your files and data.

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

You should never rely just on your hosting company for site backups. Instead, learn how to manage your WordPress site or get this service done for you and develop a habit of performing a full WordPress site maintenance routine frequently (e.g. weekly, monthly, etc …)

A full 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 plugins, themes and software components are up-to-date,
  • etc …

A proper WordPress site maintenance routine looks like this …

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

Again, we cannot stress enough how vitally important it is to maintain your WP site backed up and up-to-date. WP site maintenance is not hard or time-consuming, but it must be done to ensure the security of your website or blog. If you don’t want to learn how to do WP site maintenance yourself, get someone else 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 are still breathing!

If you don’t want to perform manual backups, there are a number of free and paid WordPress plugins you can use. You can read about a WordPress backup plugin that can fully automate your site backups here: Back Up, Clone & Keep Your WP Web Sites Protected With Backup Creator Plugin For WordPress

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

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

For reasons of website security, never set up a WordPress site with the username admin. This is the first area of potential vulnerability hackers will test. If your site’s username is admin, change it immediately.

We have created a detailed step-by-step tutorial that shows you how to change your username here: How To Change Your WP Admin User Name To Another User Name

Security Measure #4 – Choose A Strong Password

A “brute force” attack occurs when malicious software continually and persistently hits a login or password field with different strings of characters in an attempt to guess the right combination that will unlock 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 continue attacking your site until it eventually works out the combination.

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

Useful Tip

Roboform is a password tool you can use to create different hard-to-guess passwords …

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

We have created a simple tutorial that shows you how to change your password here: How To Change Your Password

Security Measure #5 – Prevent Your wp-config.php File From Being Easily Visible

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

wp-config.php file

(wp-config.php)

If hackers break into your WordPress site, they will typically try to access the 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, you must prevent people from being able to easily get to 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 WP Installation Files

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

These files are not required after installation. If you don’t want to delete these files, just rename them.

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

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

Ensure that all of your application 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 allows site administrators to edit theme and plugin code from the dashboard.

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

WP Theme Editor Menu

(The WordPress theme editor can be accessed via the main menu)

The WordPress theme editor allows anyone accessing your blog’s admin to view and modify your WordPress theme template files, and cause mayhem on your site.

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

Security Measure #9 – Protect Your WordPress Uploads Directory

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

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

(WordPress uploads folder)

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

If any directories in your website have vulnerabilities that can be exploited by hackers, this could seriously threaten the security of 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 a blank file named “index.php”) to your uploads directory, and so on. Again, it’s best to ask for assistance from someone who knows what they are doing if you are not sure about what to do.

Security Measure #10 – Use Security Plugins

There are a number of great WordPress security plugins available that will address common security issues faced by WordPress site owners, such as preventing unauthorized users from gaining access to vital information about your site, protecting your website from malicious exploits, preventing injections of code into files, etc.

Most 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 site files and causing irreparable damage to your site is SecureScanPro.

SecureScanPro - security software solution for WordPress

(SecureScanPro – WordPress total security plugin)

SecureScanPro is easy to install and easy to use, and does a great job of addressing 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 Security Solution(Blog Defender Security Solution For WordPress Websites)

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

BlogDefender scans you website for potential security weaknesses …

Blog DefenderAnd lets you quickly and easily fix these …

Blog DefenderIf you don’t want to purchase a premium security plugin like SecureScanPro or BlogDefender, you can use various free WP plugins, such as Limit Login Attempts

Limit Login Attempts - WordPress Security Plugin

WordPress is a secure platform, but neglecting simple maintenance tasks like making sure that your WP installation, WordPress plugins and WP themes are kept up-to-date, tightening file and data security 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, web security is something you simply cannot ignore.

As a final reminder of the importance of website security, below is the advice given by a web security expert to all WordPress users following the worldwide brute-force attacks on WordPress in 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 of the utmost importance if you run a WordPress site. Hopefully, the information in this article has given you the initial steps you need to take to prevent brute-force attacks on your WordPress site. If you need any further help or assistance with WordPress security, please consult a professional 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 was absolutely amazed at the scope and breadth of these tutorials! The most in-depth training I have ever received on any subject!" - Myke O'Neill, DailyGreenPost.com

***