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 SecurityPowering millions of websites worldwide makes WordPress an easy target for hacking attacks.

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

These attacks were caused by computers infected with malware and programmed to attack other sites, also commonly known as “botnets”.

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

Brute Force Attacks – An Overview

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 achieved with software tools and scripts that automatically tries to guess hundreds of login combinations in minutes.

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

This is called a “brute-force” attack.

What Is A Botnet?

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)

A “Botnet” is a network of private computers that have been compromised and infected with malicious code or scripts, which are then controlled remotely as a group, typically without the computer owners even being aware of this.

Botnets are regularly used to blast out mass spam emails.

Below is a screenshot taken from a site that monitors online security showing the locations of the command centers of a botnet that has been actively infecting computer networks all around the world since 2009 called “Zeus” …

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

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

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

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

WordPress powers millions of websites around the world, making it an obvious target for hackers

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

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

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

To understand why WordPress is a secure platform for websites, read this article: Is WordPress Secure?

Info

It’s important to note that, in the case of the mass brute force attack described above, there was no WordPress vulnerability being exploited (the same script was also targeting sites built using 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)

Protecting Your WordPress Blog From Being Brute Force Attacked – Ten Security Checks

You may think that the information in your website provides little to no value to hackers, but the reality is that every website is valuable to a malicious user.

If hackers can find a way to break in and take over your website or blog, the website can then be employed to attack larger and more highly-valued web sites.

Additional undesirable results of being hacked include being blacklisted by Google, having spammy links advertising things like online meds, porn, etc. in your content and meta data, redirecting visitors to phishing sites, data exfiltration (stealing information or Personal Identifiable Information from your web applications), and lots of other nasty things.

The reality is that software-driven bots are most likely trying to hack into your website or blog right now. Whether they can break into your site successfully depends on how difficult or easy you will make things for them to continue persisting until they either can discover how to get access, or give up and go look for a less protected target.

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

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

Website Security Check(Website Security Scan Screenshot: Hackertarget.com)

You will see that the test returns various results and information about your site setup …

Hackertarget - WordPress Security Scan

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

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

WordPress Security Scan(Screenshot source: Blog Defender)

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 can be useful information to hackers, as this informs them about any vulnerabilities, especially where the owners haven’t updated their files.

If your website runs on WordPress and you are not precautionary steps to bullet-proof your site, 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 worldwide!

When a website or blog gets compromised, site owners will find themselves completely “locked out” of their own site, or notice that their files have been modified 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 that comes with having your web site being 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.

Note

Note: Some of the steps shown below require some technical skills to modify core WordPress and server files. If you are not technical-minded, 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 Host

Contact your hosting provider and ask them exactly what security measures are in place to help prevent your site from brute-force attacks, and what they do to ensure that your WordPress sites get regularly backed up.

Check that your webhosting service provider backs up your sites and that, if disaster strikes, you can quickly and easily get your files back.

Security Measure #2 – Back Up Your WordPress Data And Files And Keep Your Site Regularly Maintained

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

A complete WordPress maintenance routine ensures that:

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

A full WordPress maintenance routine looks like this …

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

Again, we cannot stress enough how vitally important it is to maintain your WordPress installation regularly backed up and up-to-date. WP site maintenance is not hard or time-consuming, but it must be done to ensure the security of your website. If you do not want to learn how to do WP site maintenance yourself, get someone else to do it but make sure it gets done. Backing up your site is the next most important thing you should do after making sure that you are still breathing!

If you don’t want to perform manual backups, there are many plugins you can use. Learn about a WordPress backup plugin that can automate your site backups here: Back Up, Clone And Keep Your WP Websites And Blogs Protected With Backup Creator WordPress Plugin

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

The large scale brute-force attack on WordPress sites was mostly attempting to compromise website administrator panels by exploiting sites with “admin” as their username.

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

We have created a simple tutorial created especially for non-technical WordPress users on how to change your WordPress username here: Changing Your WordPress Username From Admin To A Different User Name

Security Measure #4 – Choose Strong Passwords

A “brute force” attack occurs when a malicious script continually and persistently tries to guess the right combination of password and username characters that will unlock 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 keep attacking your site until it eventually works out the combination.

Weak passwords, therefore, are very easy targets for hacking attacks. Make sure that you change your password to something containing at least eight characters long, with both upper and lowercase letters, combined with “special” characters (e.g. ^, #, @, etc).

Useful Tip

If you have trouble coming up with strong passwords or feel reluctant to set up different passwords for all of your online logins, then use a password management program like Roboform …

You can use a password management software tool like Roboform to help you generate unbreakable passwords(You can use a password management software tool like Roboform to help you generate really secure passwords)

For a detailed tutorial on how to change your login password, go here: What To Do If You Need To Reset Passwords

Security Measure #5 – Prevent Access To The wp-config.php File

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

WordPress WP Config file

(wp-config.php)

If a hacker breaks into your WordPress website, they will typically try to access the wp-config.php file, because this is the file that contains your database information, 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.

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

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

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 CMS, Plugins & Themes To Their Latest Version

Hackers search for vulnerabilities they can exploit in previous WordPress versions, including outdated versions of WordPress plugins and themes.

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

Security Measure #8 – Disable The WordPress Theme Editor

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

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

WP Theme Editor Menu

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

This means that anyone logging into your site can see and edit your WordPress theme files, or cause havoc on your site.

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

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

By default, this folder is visible to online users. All a person needs to do to see all of the contents stored in your site’s “uploads” folder is visit the directory using their browser …

(WordPress uploads directory)

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

If any directories in your website have vulnerabilities that can be exploited by hackers or malicious users, someone can 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 called “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

Several WordPress security plugins are available that will address most security issues WordPress website owners face, such as preventing unauthorized users from gaining access to vital information about your site, protecting your site from malicious exploits, preventing injections of code into files, etc.

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

(SecureScanPro – WP total security software solution)

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

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

Blog Defender Security Solution

Blog Defender Security Solution For WordPress(Blog Defender Security Plugin)

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 website for security holes …

Blog Defender Security Suite For WordPress Web SitesAnd lets you fix these quickly …

Blog DefenderIf you don’t want to purchase a premium 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 software, plugins and WordPress themes are kept up-to-date, tightening file and data protection 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, web security is something you simply cannot afford to ignore.

As a final reminder of the importance of website security, below is the advice given by an expert on web security to all WordPress users following 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, WordPress 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 professional WordPress security specialist, or search for a professional WordPress service provider in our WordPress Services Directory.

Also, please remember to subscribe to WPCompendium.org to be notified when we publish new articles and tutorials on WordPress security and reviews of new security plugins.

***

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

***