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 SecurityWordPress is frequently the target of malicious attacks by hackers, due to its popularity.

In April 2013 a mass brute force attack struck WordPress installations across almost every WP hosting server in existence around the world.

These attacks were caused by computers infected with viruses and programmed to attack other vulnerable computers (called “botnets”).

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

What Is A Brute Force Attack?

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 will attempt to break into a WordPress site is by trying to guess the site admin’s login username and password. This is achieved using scripts and software that can guess hundreds of possible login combinations in minutes.

If you’re using obvious user names and passwords that are easy to guess, your site could be an easy target for hackers.

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 computer owners’ knowledge or awareness.

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

The screenshot below was 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 …

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

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

These were highly distributed and well organized attacks. Over 90,000 IP addresses were identified by several webhosting companies in the initial attack alone, when millions of attempts to force their way into WordPress site admin areas took place. The worldwide brute-force attacks then continued, with over 30,000 WordPress blogs being hacked each day.

Coverage of the April 2013 brute-force attack was widely reported in all of the major webhosting companies, as well as the leading technology media publications, such as Forbes, TechNews Daily, 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 which makes it an obvious target for hacker attacks

(WordPress often comes under attack by hackers)

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

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

We explain why WordPress is a secure web platform in this article: Are Open Source Web Platforms Like WordPress Secure?

Useful Information

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

Mike Little, one of the co-founders 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)

Preventing Your WordPress Site From Being Brute Force Attacked – Ten Security Measures

You may think that your website or blog has nothing to offer to hackers, but the reality is that every website is valuable to a malicious user.

If a malicious user can find a vulnerability in your setup, your blog can then be used as a “bot” to attack other highly-valued websites.

Additional undesirable effects of having your site hacked include being blacklisted by search engines, having stealthy spam links advertising things like online meds, discounted fashion, etc. inserted into your content and meta data, malicious redirects 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 reality is that hackers are probably trying to hack into your blog at this very moment. Whether they can get into your site successfully depends on how difficult or easy you will make things for hackers and botnets to continue persisting until they can find how to break in, or 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 a site like Hackertarget.com and run your website through their WordPress security check …

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

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

WordPress Security Scan

(Hackertarget – website security check results. Screenshot image: Hackertarget.com)

It should be obvious after using this scanning tool that if you are able to access all of this information about your WordPress site, then hackers can too.

WordPress Security Scan(Product image source: BlogDefender.com)

Being able to see what 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 can be useful information to hackers, as this informs them about any potential security weaknesses, especially in older versions.

If your website runs on WordPress and you are not taking steps to bullet-proof your site, we can practically guarantee that, at some point in time, someone will attempt to hack your site, because these attacks are systematically targeting WordPress sites worldwide!

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

To help avoid the heartache (and significant financial loss) of discovering that your web site has been hacked into, we have listed below 10 essential and effective security measures that will help to prevent your WordPress site from being attacked by brute-force botnet hacking attempts.

Important

Note: Some of the recommended steps below require some technical skills to modify core WordPress and/or server files. If you lack these technical skills, or don’t want to mess around with code on your site, then ask your web host or a professional WordPress technical provider for help.

***

Security Measure #1 – Contact Your Host

Contact your hosting service and ask them exactly what measures have been put into place to protect your site from being attacked, and what they do to ensure that your server files get regularly backed up.

Check that your host regularly backs 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 Or Blog Regularly Updated

You should never rely just on your hosting provider for your site backups. Instead, learn how to manage your WordPress site or pay someone to get this service done for you and maintain a habit of performing a full site maintenance routine on a frequent basis (e.g. weekly, fortnightly, etc …)

A full WordPress maintenance routine ensures that:

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

A proper WP maintenance routine looks like this …

Maintaining your WordPress installation completely backed up and updated is vitally important for WordPress security.(Maintaining your WordPress web site regularly backed up and updated is vitally important for WordPress security. Image: WPTrainMe.com)

Again, we cannot stress enough how vitally important maintaining your WordPress web site frequently backed up and up-to-date is. WordPress maintenance is not hard to do 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 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 must do after making sure that you still have a pulse!

If you don’t want to back up your files manually, there are a number of plugins you can use. Learn about a WordPress backup plugin that can fully automate your backup process here: Back Up, Clone & Protect Your WordPress Web Sites With Backup Creator Plugin For WP

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

the worldwide brute-force attack on WordPress is mostly an attempt to compromise website admin panels by exploiting WP installations with “admin” as their username.

For reasons of website security, avoid installing sites with the username “admin”. This is the first area hackers will test. If your site’s user name is admin, then change this immediately.

We have created a detailed tutorial that shows you how to change your username here: Changing Your WP Admin Username

Security Measure #4 – Choose A Strong Password

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

Unless you put some measure in 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 works out the combination.

Weak passwords, therefore, make very easy targets for hacking attacks. Make sure that you change your password to a string that contains at least eight characters long, with upper and lowercase letters, and “special” characters (^%$#&@*).

Useful Tip

Roboform is a password software you can use to help you generate different strong login passwords …

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

For a simple tutorial for WordPress users on how to change your password, go here: What To Do If You Need To Reset Your Password

Security Measure #5 – Prevent Access To Your WP Config File

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

wp-config.php file

(wp-config.php)

If hackers break into your website, they will search for 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, prevent your wp-config.php file from being easily 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 WordPress Installation Files

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

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

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

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

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

Security Measure #8 – Disable Your WordPress Theme Editor

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

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

WP Theme Editor Menu

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

The WordPress theme feature lets anyone accessing your site’s admin see and modify your theme template files, or create havoc on your site.

If you want to prevent unauthorized 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 – Prevent Access To Your Site’s Uploads Directory

The “uploads” directory stores all the media that gets uploaded to your site.

Normally, this folder is visible to anyone online. All a person needs to do to view the contents stored in your “uploads” folder is visit the directory using their browser …

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

(WordPress uploads folder)

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by malicious users, anyone can upload unauthorized file types to your site.

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

Security Measure #10 – Security Plugins

There are several WordPress security plugins available that will address most common security issues faced by WordPress site owners, such as preventing unauthorized users from accessing your site, protecting your site from brute-force attacks, preventing unauthorized file uploads, etc.

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

SecureScanPro - WordPress complete security software solution

(SecureScanPro – total security software solution for WordPress)

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

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

Blog Defender Security Product Suite For WordPress

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

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

BlogDefender scans you web site for potential security holes …

Blog DefenderAnd then shows you how to quickly fix these …

Blog DefenderIf you don’t want to invest in a premium 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 web platform, but neglecting essential maintenance tasks like keeping your WordPress software, WP plugins and WP themes up-to-date, tightening file and data security and taking other necessary precautions can expose your website to attacks 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, you cannot ignore the importance of securing your web sites.

As one last reminder of the importance of keeping your websites protected, below is the advice given by an expert on website security to all WordPress users after the global 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, website security is of the utmost importance if you run a WordPress site. Hopefully, this information will help 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 WordPress technical provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to be notified via email whenever we publish new articles on WordPress security and tutorials about new WordPress security plugins and solutions.

***

"I have used the tutorials to teach all of my clients and it has probably never been so easy for everyone to learn WordPress ... Now I don't need to buy all these very expensive video courses that often don't deliver what they promise." - Stefan Wendt, Internet Marketing Success Group

***

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