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 most popular content management system in the world and the preferred online publishing platform 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 become a prime target for attacks 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 sites).

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

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 ways hackers try to break into a WordPress site. One of these is by trying to guess the site’s administration login username and password. To achieve this, hackers use scripts and software that can work through hundreds of login permutations in minutes.

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

This is called a “brute-force” login 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)

”Botnets” are networks of private computers that have been infected with malicious code or scripts, which are then controlled remotely as a group, typically without the unsuspecting computer owners’ knowledge or awareness.

Botnets are regularly used to send out mass spam emails from the infected computers of unsuspecting users.

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

ZeuS is a botnet that 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. Image source: SecureList.com)

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

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

Being the world's most popular CMS makes WordPress a target for hacker attacks

(Powering millions of websites and blogs around the world makes WordPress an obvious target for hacking)

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

No. In fact, there are many good reasons why you should use WordPress if you are concerned at all about the security of your online business.

We explain why WordPress is a secure platform for websites in this article: Are Open Source Platforms Like WordPress Secure? What Every Blog Owner Needs To Know About WordPress Security

Important

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

Mike Little, the co-founder of WordPress with Matt Mullenweg, made the following 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 Brute Force Attacks – Ten Security Checks

Every site with a security vulnerability offers some value to hackers. An unsecured web site not only provides new hackers opportunities to improve their skills and win “respect” amongst their peers, but it can also be a valuable resource for launching DDoS attacks, spreading malware and information theft.

If a hacker can discover a flaw in your security that allows them to take over and control your website or blog, that website or blog can then be employed as part of a larger network of “bots” to target larger and more highly-valued sites.

Additional undesirable results of being hacked and your site security compromised include getting blacklisted by search engines, having stealthy spam links advertising things like gambling, porn, etc. in your content, malicious redirects to phishing sites, drive-by downloads (adding malware on your visitors’ computers), and many other nasty things.

The harsh reality is that hackers are most likely trying to break into your website as you are reading this article at this very moment. Whether they can break into your site successfully depends on how hard you have made things for hackers and botnets to keep persisting until they find how to get in, or are forced to give up and decide to look for a less secure target.

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

If you visit a site like Hackertarget.com and run your website through their WordPress security check …

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

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

Hackertarget - Website Security Scan

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

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

Hackertarget - Website Security Check(Screenshot source: Blog Defender)

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 can all be valuable information to hackers, as this informs them about any security vulnerabilities, especially where site owners haven’t updated their software versions.

If your website is powered by WordPress and you are not taking appropriate steps to toughen up your site, then it’s practically guaranteed that, at some point in time, someone will attempt to hack your site, because these brute-force attacks are systematically targeting WordPress sites around the world!

Whenever a website is broken into, webmasters will find themselves “locked out” of their own site, or notice that their files have been altered or even that their content has been entirely wiped out. Often, compromised sites will be infected with malicious software or viruses without the owner’s knowledge or awareness.

To help avoid the heartache (and potential loss of valuable business data) of discovering that your website or blog has been hacked into, we have listed below 10 essential and effective security measures that will help to prevent your WordPress site from brute force botnet attacks.

Warning

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

***

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

Contact your web host and ask them exactly what measures have been put into place to help prevent your site from being attacked, and what is done to make sure that your files and data are being regularly backed up.

It’s important to check that your hosting service provider backs 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 Site Regularly Up-To-Date

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

A complete WordPress maintenance routine ensures that:

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

A complete WP site maintenance routine looks like this …

Maintaining your WordPress site backed up and up-to-date is vitally important for WordPress security.(Maintaining your WP website completely backed up and up-to-date is vitally important for WordPress security. Screenshot source: WPTrainMe.com)

Again, we cannot stress enough how important maintaining your WordPress site frequently backed up and updated is. 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 WordPress maintenance yourself, get someone else to do it but make sure it gets done. Backing up your website is the second most important thing you must do after making sure that you are still breathing!

If you don’t want to back up your files manually, there are many plugins you can use. You can read about a WordPress backup plugin that can fully automate your site backups here: Back Up, Duplicate And Keep Your WP Website Protected With Backup Creator WordPress Plugin

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

The brute force botnet attack on WordPress is mostly attempting to compromise site administrator panels and gain access to sites by exploiting WP installations with “admin” as their username.

For security reasons, don’t install sites with the username “admin”. This is the first area of potential vulnerability hackers will test. If your site’s user name is “admin”, change it immediately.

For a step-by-step tutorial created especially for WP admin users on how to change your WordPress username, go here: How To Change Your Admin Username In WordPress To A More Secure Username

Security Measure #4 – Your Password

A “brute force” attack occurs when malicious software persistently tries to guess the right combination of password and username characters that will give them entry to your website.

Unless you put some measure in place to prevent the brute-force attack (see further below for a couple of effective ways to do this), the “bot” will just persist in attacking your site until it eventually gets access.

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

Tip

Roboform is a password tool that lets you create different secure passwords …

You can use a password management software tool like Roboform to help you generate hard-to-crack passwords(Roboform is a password management tool you can use to generate different strong login passwords)

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

Security Measure #5 – Secure Your wp-config.php File

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

wp-config.php

(wp-config.php)

If a hacker breaks into your site, they will look for the wp-config.php file, because this is the file that contains your WordPress 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 people getting 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 WordPress Installation Files

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

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

Security Measure #7 – Upgrade Your WordPress Blog, Plugins & Themes To Their Latest Version

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

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

Security Measure #8 – Disable The WordPress Theme Editor

WordPress installations come with a built-in editor that allows you to edit plugin and theme files inside the dashboard area.

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

WP Theme Editor Menu

(Accessing the WordPress theme editor via the main menu)

The WordPress theme editor allows anyone accessing your blog’s admin area to view and make changes to your WP theme template files, and create mayhem on your site.

To prevent unauthorized people from being able to access the 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 – Remove Access To Your WordPress Uploads Folder

The WordPress “uploads” directory stores 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” directory is navigate to your directory using a web browser …

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

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

If any directories in your website have vulnerabilities that can be exploited by malicious users, anyone could upload unauthorized file types to your site.

Protecting your directories will prevent online users 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 named “index.php”) to your uploads directory, and so on. Again, it’s best to use a professional if you are unsure about what to do.

Security Measure #10 – WordPress Security Plugins

There are a number of security plugins for WordPress available that specifically address common security issues faced by WordPress site owners, such as preventing unauthorized users from gaining access to vital areas of your site, protecting your files 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 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 - WordPress total security software solution

(SecureScanPro – WordPress security software solution)

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

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

Blog Defender

Blog Defender WordPress Security Product Suite(Blog Defender)

Blog Defender 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 holes in your website are …

Blog Defender WordPress Security SolutionAnd lets you easily fix these …

Blog DefenderIf you don’t want to purchase a 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 web platform, but neglecting basic maintenance tasks like ensuring that your WP core files, WP plugins and themes are kept up-to-date, tightening file and data security and taking other necessary precautions can have disastrous consequences.

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 securing your websites.

As one last reminder of the importance of website security, below is the advice given by a security expert to all WordPress users after the large-scale 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 consult a WordPress security specialist, or search for a WordPress service provider in our WordPress Services Directory.

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

***

"If you're new to WordPress, this can stand on its own as a training course and will stay with you as you progress from beginner to advanced and even guru status." - Bruce (Columbus, Ohio)

***