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 CMS platform and the preferred online publishing platform used by millions of websites and loved by thousands of web developers and web designers, it’s inevitable that at some point in time, WordPress will come under attack by hackers wanting to score a “big win”.

In early 2013 a worldwide brute-force attack began hitting WordPress installations on almost every WP host server in existence around the world.

These attacks were caused by infected computer networks programmed to attack other vulnerable installations (called “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)

There are many methods hackers use to try and break into a WordPress site. One of these is by trying to guess the site’s administration login username and password. This is achieved with software tools and scripts that can work through hundreds of login permutations in minutes.

If you’re using weak login details, your site could be easily hacked by the script’s persistent attempts to guess your site’s login details.

This is called a “brute force” login attack.

What Are 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)

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

Botnets are normally used used to send out mass spam emails from computers of compromised user accounts.

Below is a screenshot taken from an internet security monitoring site showing the locations of the command centers of ZeuS – a botnet that has been actively compromising computer networks all around the globe since 2009 …

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

(The Zeus botnet has been actively infecting computer networks all around the globe since 2009. Image: SecureList.com)

These botnet attacks were highly distributed and well organized. 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 site admin areas occurred. The mass attack then continued, with over 30,000 WordPress sites and blogs being hacked every day.

Coverage of this mass brute force botnet attack was widely reported in all 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 is the world's most used CMS making it a natural target for hacking attempts

(WordPress is often the target of mass malicious attacks by hackers, due to its popularity)

Does This Mean We Shouldn’t Use WordPress Anymore?

No. In fact, there are lots of great reasons why you should choose WordPress if you are concerned about website security.

To learn what makes WordPress a very secure platform for websites, see this article: Is WordPress Secure?

Info

It’s important to understand that, in the case of the worldwide brute-force attack described above, was no specific vulnerability in WordPress being exploited (the same script was also attacking 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)

How To Protect Your WordPress Website From Being Brute Force Attacked – Ten Security Checks

Every site with a vulnerability has value to hackers. If you think that the information in your website or blog is of little value to hackers, think again. Business websites, personal blogs, government sites … even web sites owned by online security experts can and have been targeted.

If a malicious user can exploit a weakness in the security system, that web site can then be employed as a “bot” to attack more valuable websites.

Additional undesirable effects of having your website hacked and your site security compromised include getting blacklisted by search engines, having spammy links advertising things like gambling, porn, etc. inserted into your content, redirecting visitors to phishing sites, data exfiltration (stealing information or Personal Identifiable Information from your web applications), and lots of other nasties.

The reality is that brute-force software bots are probably trying to break into your website at this very moment. Whether they can successfully hack in or not, will depend on how challenging you have made things for hackers and botnets to continue trying until they can discover a way to get access, or are forced to give up and decide to look for a less secure target.

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

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

Hackertarget - WordPress Security Check(Hackertarget – WordPress Security Check Product image: Hackertarget.com)

You will see that the test will yield various results and details about your WordPress installation …

Website Security Scan

(WP security scan results. Screenshot source: Hackertarget.com)

It should be obvious after using the above tool that if you can see all of this information, hackers can too.

Hackertarget - WordPress Security Scan(Screenshot: BlogDefender.com)

The ability 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 are all valuable information to hackers, as this informs them about any security weaknesses, especially in older versions.

If your website is driven by WordPress and you’re not preventive steps to bolster the security of your site, then we can practically guarantee that, at some point in time, someone will attempt to hack your installation, because these brute-force attacks are systematically targeting WordPress installations all the world!

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

To help avoid the heartache and aggravation (and significant loss of valuable business data) of discovering that your website or blog has been hacked into, below are 10 simple, yet essential and effective security measures that will help to protect your WordPress site from being brute-force attacked.

Important

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

***

Security Measure #1 – Contact Your Webhosting Provider

Get in touch with your hosting provider and ask them what measures have been put in place to protect your site from botnet attacks, and what is done to make sure that your files and data are being backed up.

Check that your hosting provider backs up your sites and that, if anything goes wrong, you can quickly and easily recover your files and data.

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 hosting company for your site backups. Instead, learn how to manage your WordPress site or pay someone to get this done for you and develop a habit of performing a full WordPress site maintenance routine on a regular basis (e.g. weekly, fortnightly, etc …)

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

A proper WordPress maintenance routine looks like this …

Maintaining your WP website or blog backed up and updated is vitally important for WordPress security.(Maintaining your WP installation backed up and updated is vitally important for WordPress security. Source: WPTrainMe.com)

Again, we cannot stress enough how vitally important maintaining your WP installation regularly backed up and up-to-date is. WordPress site maintenance is not hard or time-consuming, but it must be done to ensure the security of your website or blog. If you do not want to learn how to do WordPress site 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 a number of WordPress plugins you can use. Learn about a WordPress backup plugin that can fully automate your site backups here: Backup, Copy And Protect Your WordPress Websites With Backup Creator WP Plugin

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

The large scale brute-force botnet attack on WordPress sites was mostly attempting to compromise site administrator panels and gain access to sites by exploiting installations with “admin” as their account name.

For security purposes, don’t install sites with the username “admin”. This is the first area hackers will test. If your site’s username is admin, change this immediately.

For a simple tutorial on how to change your WordPress admin username, go here: How To Change Your WP Admin User Name To Another User Name

Security Measure #4 – Choose Strong Passwords

A “brute force” attack occurs when malicious software continually hits a login or password field with different strings of characters in an attempt to guess the right login combination that will unlock your site.

Unless some measure is put into place to block the brute force attack from happening (see further below for a couple of simple and effective ways to do this), the “bot” will just continue attacking your site until it eventually gets access.

Weak passwords, therefore, are really easy targets for hacking attacks. Make sure that you change your password combination to something that is at least eight characters long, with upper and lowercase letters, and add a few “special” characters (^%$#&@*).

Useful Tip

Roboform is a password management tool you can use to help you generate different unbreakable passwords …

You can use a password management tool like Roboform to help you generate strong passwords(Roboform is a password software that lets you create secure login passwords)

For a tutorial for non-technical WP admin users on how to change your WordPress password, go here: What To Do If You Need To Change WordPress Passwords

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

The wp-config.php file allows WordPress to communicate with the database to store and retrieve data and is used to define advanced WordPress options.

wp-config.php file

(wp-config.php file)

If hackers break into your website, they will typically look for your wp-config.php file, because this is the file that contains important information about your site’s database, 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.

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 – Delete Or Rename Unnecessary WP Installation Files

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

These files can be deleted after installation. If you don’t want to remove these files, then just rename them.

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

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

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

Security Measure #8 – Disable Your Theme Editor

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

In WordPress, you can access your WordPress Theme Editor by selecting Appearance > Editor from your main menu …

WP Theme Editor Menu

(Accessing the WordPress theme editor using the WordPress admin menu)

This allows anyone accessing your site’s admin area to view and modify all of your WordPress theme templates, and cause havoc on your site.

If you want to prevent unauthorized people from accessing 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 – Secure Your WordPress Uploads Directory

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

By default, this folder is visible to online users. All someone has to do to view all of the contents stored in the “uploads” directory is visit your directory using their web browser …

(WordPress uploads folder)

(WordPress has an uploads directory where media content is stored)

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

Protecting your directories will prevent unauthorized people 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 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 unsure about what to do.

Security Measure #10 – WordPress Security Plugins

There are a number of WordPress security plugins available that specifically address most common security issues WordPress website owners face, such as preventing hackers from gaining access to vital information about your site, protecting your website from malicious software, preventing injections of code into files, etc.

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

SecureScanPro - security software solution for WordPress

(SecureScanPro – complete security software solution for WordPress)

SecureScanPro is easy to install and easy to use, and does a great job of fixing most of the security issues that WordPress users need to address.

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

Blog Defender

Blog Defender(Blog Defender)

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

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

Blog Defender WordPress Security Product SuiteAnd lets you fix these quickly …

Blog Defender Security Plugin For WordPressIf you don’t want to invest in a security plugin like SecureScanPro or BlogDefender, you can use various free plugins, such as Limit Login Attempts

Limit Login Attempts - WordPress Security Plugin

WordPress is a secure platform, but neglecting simple maintenance tasks like keeping your WP software, plugins and themes updated to their latest versions, tightening file and data protection 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, you cannot afford to ignore the importance of web security.

As a final reminder, below is the advice given by an expert on website security 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, WordPress security is of the utmost importance if you run a WordPress site. Hopefully, the above information has provided you with the initial guidelines and help you need to keep your WordPress site protected from brute force attacks. 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 technical provider in our WordPress Services Directory.

Also, don’t forget to subscribe to WPCompendium.org to receive notifications when we publish new tutorials on WordPress security and tutorials about WordPress security plugins and solutions.

***

"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)

***