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 SecurityWhen you are the leading CMS platform in the world 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 become an obvious target for attacks from hackers.

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

These attacks were caused by infected computer networks programmed to attack other vulnerable sites (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 ways hackers try to break into a WordPress site. One of these is by trying to guess the site’s administration login username and password. This is achieved using scripts and software tools that automatically tries to guess hundreds of possible logins in minutes.

If you’re using predictable usernames and passwords, your website could be easily hacked by repeated attempts to work out your site’s login details.

This is called a “brute-force” 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)

A “Botnet” is a network of computers that have been compromised and infected with malicious code, which are then controlled remotely as a group, often without the computer owners’ knowledge or awareness.

Botnets are typically used to blast mass spam emails from the infected computers of compromised user accounts.

The screenshot below was 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 compromising computer networks all around the world since 2009.

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

The 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, when millions of attempts to force their way into WordPress users admin areas took place. The brute-force attacks then continued, with over 30,000 WordPress sites being hacked per day.

Coverage of this worldwide 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 is often the target of malicious attacks by hackers

(Being the world’s most popular CMS makes WordPress an obvious target for malicious attempts by hackers)

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

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

To understand why WordPress is a secure web platform, read this article: Are Open Source Web Platforms Like WordPress Secure?

Info

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

Preventing Your WordPress Website From Brute Force Attacks – Ten 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 benefit at your expense.

If a malicious user can access and gain control of your blog, your website or blog can then be employed to target other highly-valued websites.

Additional undesirable consequences of being hacked and your site security compromised include being blacklisted by Google, having spammy links advertising things like viagra, cheap offers on brand names, etc. inserted into your content and page title and descriptions, redirecting visitors to phishing sites, data exfiltration (stealing information or Personal Identifiable Information from your web applications), and many other nasty things.

The truth is that software-driven bots are probably trying to hack into your website at this very moment. Whether they can achieve this or not, depends on how difficult you will make it for hackers or botnets to keep trying until they can either discover how to get in, or are forced to decide to look for a less secure target.

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

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

Hackertarget - Website Security Check(Hackertarget – WP Security Check Image source: Hackertarget.com)

You will see that the test will return a number of results and information about your website …

Hackertarget - WP Security Check

(WordPress security check results. Screenshot: Hackertarget.com)

It should be obvious after using the scanning tool that if you can freely access all of this information, then so can hackers.

WordPress Security Check(Screenshot image: BlogDefender.com)

Being able to see which 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 are all useful information to hackers, as this informs them about potentially exploitable holes or weaknesses, especially in older versions.

If your site or blog is powered by WordPress and you’re not taking steps to bolster the security of your site, we can practically guarantee 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 sites worldwide!

Typically, whenever a website gets compromised, webmasters will discover much to their dismay that they have been “locked out” of their own site, or notice that their files have been modified or even that their content 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 potential loss of valuable business data) that comes with discovering that your site has been hacked into, we have listed below ten essential and effective security checks that will help to protect your WordPress site from being attacked by brute force hackers.

Note

Note: Some of the measures listed below require 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 a professional WordPress technical provider for assistance.

***

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

Get in touch with your hosting provider and ask them what security measures have been put in place to protect your site from botnet attacks, and what they do to ensure that your server files get regularly backed up.

Make sure that your hosting company is backing 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 Website Regularly Maintained

You should never rely on your web host for site backups. Instead, learn how to maintain your WordPress site or pay someone to get this service done for you and develop a habit of religiously performing a complete WordPress site maintenance routine on a frequent basis (e.g. daily, weekly, monthly, etc …)

A full WordPress maintenance routine ensures that:

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

A complete WordPress site maintenance routine looks like this …

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

Again, we cannot stress enough how vitally important maintaining your WP site backed up and updated is. WordPress maintenance is not hard to do 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 someone 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 many WordPress plugins you can use. You can read about a WordPress backup plugin that can fully automate your backup process here: Backup, Duplicate And Protect Your WP Sites 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 attempting to compromise website admin panels by exploiting installations that used “admin” as their username.

For security reasons, avoid installing sites with the username admin. This is the first area hackers will test. If your blog’s username is admin, you will should change this immediately.

For a detailed tutorial created especially for non-technical WordPress admin users that shows you how to change your username, go here: Changing Your Admin Username In WordPress To Another Username

Security Measure #4 – Avoid Weak Passwords

A “brute force” attack occurs when malicious software continually and persistently tries to guess the right combination of password and username characters that will unlock your site.

Unless some measure is put into place to stop the brute force attack (see further below for a couple of effective suggestions for doing this), the “bot” will just keep attacking your site until it eventually “cracks” the code.

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

Tip

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

Roboform is a password management program that lets you create different secure passwords(Roboform is a password software you can use to generate really secure passwords)

For a simple tutorial created especially for non-technical WordPress admin users on how to change your login password, go here: How To Reset Your Login Password

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

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

wp-config.php

(wp-config.php file)

If hackers break into your WordPress site, they will typically look for the wp-config.php file, because this file 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.

To protect your WordPress site from being attacked and even being used as part of a bot net, therefore, you must prevent people viewing 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 Installation Files

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

These files are not required after installation and can be deleted. If you don’t want to delete these files, just rename them.

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

Hackers are always on the lookout for vulnerabilities in older versions of WordPress that can be exploited, including outdated versions of plugins and themes.

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

Security Measure #8 – Disable The WordPress Theme Editor

WordPress installations come with a built-in editor feature that lets the administrator edit plugin and theme code from the dashboard.

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

WP Theme Editor Menu

(Accessing the WordPress theme editor using the WP dashboard menu)

This allows anyone accessing your blog’s admin to view and edit your WordPress theme files, or cause mayhem on your site.

If you want 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 – Protect The WordPress Uploads Directory

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

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

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

(WordPress uploads directory)

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

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

Security Measure #10 – WordPress Security Plugins

A number of security plugins for WordPress are available that specifically address many common security issues WordPress website owners face, such as preventing hackers from accessing your site, protecting your files from malicious exploits, preventing injections of code into files, etc.

Many 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 potential issues that could lead to hackers accessing your files and causing damage to your site is SecureScanPro.

SecureScanPro - WP security software

(SecureScanPro – WordPress total security software)

SecureScanPro is easy to install and easy to use, and fixes 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 WordPress Security Solution

Blog Defender Security Suite For WordPress(Blog Defender Security Solution For WordPress Websites & Blogs)

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

BlogDefender shows you where potential security weaknesses in your website are …

Blog Defender WordPress Security SolutionAnd then shows you how to quickly fix these …

Blog Defender Security SuiteIf you don’t want to buy 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 platform, but neglecting essential maintenance tasks like ensuring that your WP core files, WordPress plugins and WP themes are kept updated to their latest versions, 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, you simply cannot ignore the importance of web security.

As a final reminder of the importance of keeping your websites protected, below is the advice given by an expert on web security to all WordPress users following the worldwide brute-force attacks by botnets 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, WordPress security is of the utmost importance if you run a WordPress site. Hopefully, this article has given you 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 WordPress security specialist, or search for a 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 new 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)

***

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