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.

Get Thrive Leads for WordPress

WP SecurityWhen you are the leading CMS platform in the world and the preferred online publishing platform for millions of businesses and loved by thousands of website developers and website designers, it’s inevitable that at some point in time, WordPress will become an easy target for attacks by hackers wanting to score a “big win”.

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

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)

One of the many ways hackers will attempt to break into WordPress sites is by trying to guess the site admin’s login username and password. This is done using software tools and scripts that can work through hundreds of login possibilities in minutes.

If you’re not using strong usernames or unguessable passwords, your website can be an easy target for hacking attempts.

This is called a “brute-force” 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 infected with malicious code, which are then controlled remotely as a group, typically without the unsuspecting computer owners’ knowledge.

Botnets are typically used to blast mass spam emails.

Below is a screenshot taken from an internet security monitoring site showing the locations of the command centers of a botnet that has been actively compromising computer networks all around the globe 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 ongoing botnet attacks on WordPress are highly distributed and well organized. Over 90,000 IP addresses were identified by several webhosting companies just in the initial attack, when the web was flooded with millions of attempts to force their way into WordPress user admin areas. The mass attack then continued, with over 30,000 WordPress sites and blogs being hacked each day.

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

Powering millions of sites around the world makes WordPress a target for hackers

(WordPress is the world’s most used CMS making it an obvious target for attempted hacking attacks)

Does This Mean We Should Stop Using WordPress?

No. In fact, there are many good 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: How Secure Is WordPress? What Every Business Owner Needs To Know About WordPress

Important

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

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

Protecting Your WordPress Blog From Brute-Force Attacks – Ten Security Checks

Every blog with a security vulnerability presents an opportunity to hackers. If you think that the information in your website is of no interest to hackers, think again. Large, medium and small web sites, personal blogs, government websites … even websites owned by web security and anti-hacking experts can and have been targeted.

If hackers can break in and remotely control your web site, the blog can then be used as a “bot” to attack larger and more highly-valued web sites.

Additional undesirable impacts of having your website hacked include getting blacklisted by Google, having stealthy spam links advertising things like viagra, porn, etc. in your content, 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 truth is that brute-force software bots are very likely trying to hack into your website while you are reading these very words. Whether they will break into your site successfully depends on how hard you can make it for hackers to keep persisting until they work out how to get access, 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 Hackertarget.com and run your website through their WordPress security check …

Hackertarget - WordPress Security Scan(Hackertarget – WP Security Check Source: https://hackertarget.com/wordpress-security-scan)

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

WP Security Check

(WordPress security check results. Product image: Hackertarget.com)

It should be obvious after using the scanning tool that if you are able to see all of this information, so can hackers.

Hackertarget - WP Security Scan(Product image source: 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 on your server can be potentially valuable information to hackers, as this informs them about potentially exploitable vulnerabilities, especially where the owners haven’t updated their software versions.

If your site or blog is powered by WordPress and you’re not precautionary 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 installations worldwide!

Whenever a website or blog is compromised, blog owners can find themselves completely “locked out” of their own site, or notice that their content has been modified or even entirely wiped out. Often, most sites will become infected with malicious scripts or viruses without the owner even being aware that a security breach has taken place.

To avoid the heartache (and potential financial loss) that comes with discovering that your site has been hacked into, we have listed below ten simple, yet essential and effective security checks that will help to prevent your WordPress site from being brute force attacked.

Info

Note: Some of the recommended measures below require some technical skills to modify core WordPress and 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 search for a WordPress technical provider in our WordPress Services Directory.

***

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

Get in touch with your hosting company and ask them exactly what measures are in place to protect your site from brute-force attacks, and what they do to make sure that your WordPress sites get regularly backed up.

Make sure that your web host regularly backs up your server files and that, if anything happens, 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 Up-To-Date

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

A complete WordPress maintenance routine ensures that:

  • All unnecessary files and data 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 full WP maintenance routine looks like this …

Maintaining your WordPress site fully backed up and updated is vitally important for WordPress security.(Maintaining your WP website completely 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 website regularly backed up and up-to-date. WP site 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 don’t want to learn how to do WordPress maintenance yourself, pay a professional 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 back up your files manually, there are a number of plugins you can use. You can read about a WordPress backup plugin that can fully automate your backup process here: Back Up, Duplicate & Protect Your WP Web Sites With Backup Creator Plugin For WordPress

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

the worldwide brute-force attack on WordPress sites was mostly an attempt to compromise website admin panels and gain access to the site by exploiting installations using “admin” as their username.

For website security purposes, never install a WordPress site with the username admin. This is the first thing hackers will test. If your site’s user name is “admin”, you will need to change this immediately.

For a simple step-by-step tutorial for WordPress users that shows you how to change your WordPress admin username, go here: How To Change Your WordPress Admin User Name To A Different User Name

Security Measure #4 – Make Sure Your Password Is Strong

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

Unless you put some measure in place to block the brute force attack (see further below for a couple of effective suggestions for doing this), the “bot” will just continue to attack your site until it eventually works out the combination.

Passwords that are easy to guess, therefore, become really easy targets for botnets. Make sure that you change your password to a string that is at least 8 or 9 characters long, with both upper and lowercase letters, combined with a few “special” characters (e.g. ^, $, *, etc).

Practical Tip

You can use a password software tool like Roboform to create unguessable passwords …

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

We have created a simple tutorial created especially for WordPress admin users that shows you how to change your password here: How To Change WordPress Passwords

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

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

wp-config.php file

(wp-config.php)

If hackers break into your WordPress site, they will typically try to access your 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 someone to change anything in your database, create a user account, upload files and take control of your site.

In order to protect your WordPress site from attacks and even being used as part of a bot net, therefore, you must prevent people accessing 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 – Delete Or Rename Unnecessary WordPress Installation Files

Rename or delete 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 delete these files, then just rename them.

Security Measure #7 – Update Your WordPress Installation, Themes And Plugins To Their Latest Version

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

Make sure to always keep all of your application files, plugins, themes, etc. 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 code inside the dashboard area.

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

WordPress Theme Editor Menu

(Accessing the WordPress theme editor using the main menu)

The WordPress theme editor allows anyone accessing your blog’s admin to view and edit your theme template files, and create havoc on your site.

To prevent 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 – Remove Access To The Site’s Uploads Folder

The “uploads” folder contains all the media that gets uploaded to your website.

By default, this folder is visible to anyone online. All someone has to do to see all of the contents stored in your site’s “uploads” folder is navigate to your directory using their browser …

(WordPress uploads directory)

(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, anyone could upload unauthorized file types or compromise the security of your website.

Protecting your directories will prevent online users 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 ask help from someone who knows what they are doing if you are not sure about what to do.

Security Measure #10 – Security Plugins

Some great WordPress security plugins are available that specifically address most security issues WordPress site owners face, such as preventing hackers from accessing your site, protecting your website from malicious scripts, preventing unauthorized file uploads, etc.

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

SecureScanPro - WordPress complete security software

(SecureScanPro – complete security software for WordPress)

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

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

Blog Defender Security Solution

Blog Defender Security Product Suite For WordPress(Blog Defender)

Blog Defender is a package of WordPress security video tutorials, plugins and tools, plus a WordPress security PDF/DOC file.

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

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

Blog DefenderIf you don’t want to invest in a security plugin like SecureScanPro or BlogDefender, then use various free WordPress plugins, such as Limit Login Attempts

Limit Login Attempts - WordPress Security Plugin

WordPress is a secure platform, but neglecting simple maintenance tasks like ensuring that your WordPress installation, WordPress plugins and WP themes are kept updated to their latest versions, tightening file and data protection and taking other necessary precautions can have disastrous consequences.

Regardless of the type of business you run or plan to run online and how small you think your web presence is, securing your web site is something you cannot ignore.

As a final reminder, below is the advice given by a web security expert to all WordPress users after the worldwide 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 of the utmost importance 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 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 WordPress security plugins.

***

"I love the way your email series "Infinite Web Content Creation Training Series" is documented and presented. It is very absorbing and captivating. The links and tutorials are interesting and educational. This has motivated me to rewrite my content following the concepts I am learning from the email series." - Mani Raju, www.fortuneinewaste.com

***

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