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 SecurityWordPress is frequently the target of attacks by hackers.

In April 2013 a global brute force attack hit WordPress installations across virtually every host server in existence.

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

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 use to try and break into WordPress sites is by trying to guess the site admin’s login username and password. This can be done with software tools that can work through hundreds of login permutations in minutes.

If you’re using predictable login details, your site could be an easy target for hackers.

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)

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

Botnets are typically used to send out mass spam emails.

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.

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

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

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

WordPress powers millions of sites worldwide, making it a target for hackers

(WordPress is the world’s most used CMS making it a target for hacking)

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 about the security of your web presence.

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

Important

It’s important to understand that, in the case of April 2013 brute-force botnet attack described above, there was actually no WordPress vulnerability 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, 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)

Protecting Your WordPress Blog From Brute Force Attacks – 10 Security Points

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

If hackers can find a security flaw that allows them to gain access and control of your blog, the blog can then be used to target other valued web sites.

Additional undesirable consequences of having your site hacked include being blacklisted by search engines, having stealthy spam links promoting things like gambling, cheap offers on brand names, etc. in your content, redirecting visitors to phishing sites, data exfiltration (stealing information or Personal Identifiable Information from your web applications), and many other nasties.

The truth is that software-driven bots are most likely trying to hack into your blog right now. Whether they will achieve this or not, will depend on how hard or easy you have made it for them to continue trying until they can discover a way to get access, or are forced to give up and decide to look for a more vulnerable target.

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

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

WP Security Scan(WordPress Security Scan Screenshot source: https://hackertarget.com/wordpress-security-scan)

You will see that the check will display a number of results and information about your website …

WordPress Security Check

(Hackertarget – WP security check results. Screenshot: Hackertarget.com)

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

WP Security Scan(Source: Blog Defender)

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 in your site are all valuable information to hackers, as this informs them about potential security vulnerabilities, especially in older versions.

If your website is powered by WordPress and you are not preventive steps to harden 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 brute-force attacks are systematically hitting WordPress installations worldwide!

Whenever a site is compromised, webmasters will find themselves completely “locked out” of their own site, or notice that their content has been interfered with or that everything has been entirely wiped out. Often, compromised sites will become infected with malicious software or viruses without the owner’s knowledge or awareness.

To help avoid the heartache and aggravation of discovering that your website or blog has been hacked into, below are ten essential and effective security checks that will help to protect your WordPress site from being brute force attacked.

Info

Note: A few of the recommended measures listed below need some technical skills to modify core WordPress or server files. If you are not technical, or don’t want to mess around with code on your site, then ask your web host or a professional WordPress service provider for assistance.

***

Security Measure #1 – Get In Touch With Your Hosting Service Provider

Get in touch with your webhosting service provider and ask them exactly what security precautions have been put into place to protect your site from being attacked, and what is done to make sure that your files and data are regularly being backed up.

Make sure that your web host is regularly backing up your sites and that, if anything should happen, you can easily get back your site.

Security Measure #2 – Perform Complete WordPress Backups And Keep Your Website Regularly Up-To-Date

You should never rely only on your webhosting company for site backups. Instead, learn how to maintain and manage your WordPress site or pay someone to get this done for you and maintain a habit of religiously performing a full site maintenance routine on a regular basis (e.g. daily, weekly, fortnightly, etc …)

A proper WordPress maintenance routine ensures that:

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

A full WordPress site maintenance routine looks like this …

Maintaining your WordPress installation regularly backed up and updated is vitally important for WordPress security.(Maintaining your WP installation frequently backed up and updated is vitally important for WordPress security. Image source: WPTrainMe.com)

Again, we cannot stress enough how vitally important it is to maintain your WordPress website or blog backed up and updated. WP site 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 WP maintenance yourself, pay a professional 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 still have a pulse!

If you don’t want to perform manual backups, there are many plugins you can use. You can read about a WordPress backup plugin that can fully automate your backup process here: Back Up, Clone & Protect Your WordPress Websites With Backup Creator WordPress Plugin

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

The large scale brute-force attack on WordPress is mostly an attempt to compromise site admin panels and gain access to sites by exploiting sites with “admin” as the user name.

For reasons of website security, avoid installing WordPress sites with the username admin. This is the first area hackers will test. If your blog’s username is “admin”, then make sure you change this immediately.

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

Security Measure #4 – Use A Strong Password

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 login combination that will give the hacker entry to your site.

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

Passwords that are easy to guess, therefore, make really easy targets for hacking attacks. Make sure that you change your password combination to something that is at least 8 or 9 characters long, with upper and lowercase letters, combined with a few “special” characters (e.g. %, #, @, etc).

Practical Tip

You can use a password tool like Roboform to generate hard-to-crack passwords …

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

For a tutorial for non-technical WP admin users that shows you how to change your password, go here: How To Change Your Password

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

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

wp-config.php file

(wp-config.php file)

If hackers break into your WordPress website, they will typically look for your wp-config.php file, because this is the file that contains your WordPress database details, 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 being attacked and even being used as part of a bot net, therefore, you must prevent your wp-config.php file from being accessible. 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 Blog Installation Files

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

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

Security Measure #7 – Upgrade Your WordPress CMS, Plugins And Themes

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

Make sure to keep all of your application files, plugins, themes, etc. up-to-date.

Security Measure #8 – Disable The Theme Editor

WordPress comes with a built-in editor feature that lets the site administrator edit plugin and theme files from the dashboard.

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

WP Theme Editor Menu

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

The WordPress theme editor feature allows anyone accessing your site’s admin area to see and edit your WordPress theme files, or create mayhem on your site.

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

Security Measure #9 – Prevent Access To Your WordPress Uploads Directory

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

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

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

(WordPress uploads folder)

If any directories in your website have weaknesses or vulnerabilities that can be exploited by hackers or malicious users, this could threaten the security of your website.

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 file with nothing in it called “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 – WordPress Security Plugins

There are a number of security plugins for WordPress available that will address common security issues WordPress site owners face, such as preventing hackers from gaining access to vital information about your site, protecting your files from brute-force attacks, preventing unauthorized file uploads, etc.

Many WordPress plugins address some but not all areas of WordPress security. One security plugin that does 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 - WordPress security plugin

(SecureScanPro – total security plugin 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 great security plugin you may want to look at using is BlogDefender.

Blog Defender WordPress Security Plugin

Blog Defender WordPress Security Suite(Blog Defender)

This product 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 holes in your WordPress site are …

Blog DefenderAnd then shows you how to fix these quickly …

Blog DefenderIf you don’t want to invest in a premium security plugin like SecureScanPro or BlogDefender, then 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 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 kind of business you run or plan to run online and how small you think your web presence is, securing your sites is something you simply cannot afford to ignore.

As one last reminder, below is the advice given by an expert on web security to all WordPress users following 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 very important if you run a WordPress site. Hopefully, the information in this article has provided you with 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 seek help from a WordPress security specialist, or search for a professional 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 WordPress security plugins and solutions.

***

"These tutorials have so much information and are easy to understand. If you use WordPress or plan to in the future these will help you with everything you need to know." - Valisa (Mesa, Arizona)

***

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