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

In April 2013 a mass brute-force attack hit WordPress installations across almost every web host in existence.

These attacks were caused by networks of infected computers programmed to attack other sites (called “botnets”).

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

What Are 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 a WordPress site is by trying to guess the site’s administration login username and password. This is achieved using scripts and tools that automatically tries to guess hundreds of possible login combinations in minutes.

If you’re using obvious usernames and passwords that are easy to guess, your site can be easily hacked by persistent attempts to guess your site’s login details.

This is called a “brute-force” login attack.

Botnet – What Is This?

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 can then be controlled remotely as a group, typically without the computer owners’ knowledge.

Botnets are normally used used to blast 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 infecting computer networks all around the world 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 infecting computer networks all around the globe since 2009. Image source: SecureList.com)

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

News of this large-scale brute force attack was widely reported in all the major webhosting companies, as well as the leading technology publications, such as TechNews Daily, Forbes, 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 popular content management system making it a natural target for hacking attacks

(Being the world’s most popular content management system makes WordPress an obvious target for hackers)

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

We explain what makes WordPress a very 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 targeting sites built using other web platforms like Joomla).

Mike Little, the co-founder of WordPress, 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 Being Brute-Force Attacked – Ten Security Points

You may think that the information in your site is of no interest to hackers, but the reality is that to a hacker, all websites provide an opportunity to gain some benefit at your expense.

If someone can access and gain remote control of your website or blog, the website can then be used as a “bot” to attack larger and more valued websites.

Additional undesirable effects of having your website hacked and your site security compromised include getting blacklisted by search engines, having spammy links promoting things like online meds, discounted fashion, etc. inserted into your content and page title and descriptions, redirecting visitors to phishing sites, data exfiltration (stealing customer details or Personal Identifiable Information from your web applications), and lots of other nasty things.

The reality is that software-driven bots are most likely scouring for weaknesses and trying to break into your blog as you are reading this page right now. Whether they can be successful will depend on how difficult or easy you have made things for hackers and botnets to continue persisting until they work out how to get in, or decide to look for a less protected target.

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

Do you own a WordPress site? If so, visit Hackertarget.com and run your site through their WordPress security check …

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

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

WP Security Check

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

It should be obvious after using the above tool that if you can access all of this information about your WordPress website, so can hackers.

WP Security Check(Product image: BlogDefender.com)

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 can be useful information to hackers, as these can inform them about any potential vulnerabilities, especially in older versions.

If your site or blog is driven by WordPress and you are not taking appropriate steps to toughen up your site, then it’s practically guaranteed that, at some time in the near future, someone will attempt to hack your website, because these brute-force attacks are systematically hitting WordPress sites all the world!

When a website or blog is broken into, webmasters will find themselves completely “locked out” of their own site, or notice that their files have been altered or even entirely wiped out. Typically, most compromised sites will be infected with malicious software without the owner even being aware that this has occurred.

To help avoid the heartache (and significant financial loss) that comes with having your website or blog being hacked into, below are ten essential and effective security measures that will help to protect your WordPress site from being attacked by brute force botnet hacking attempts.

Disclaimer

Note: A few of the recommended measures below need some technical understanding of how to modify core WordPress 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 search for a professional WordPress service provider in our WordPress Services Directory.

***

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

Get in touch with your webhosting provider and ask them exactly what measures have been put into place to help prevent your site from being attacked, and what they are doing to ensure that your WordPress sites get backed up.

It is important to make sure that your webhosting provider backs up your sites and that, if anything happens, you can quickly and easily get back your files.

Security Measure #2 – Back Up Your WordPress Data And Files And Keep Your Website Frequently Updated

You should never rely only on your webhosting service for site backups. Instead, learn how to maintain and manage your WordPress site or get this done for you and maintain a habit of performing a complete WordPress site maintenance routine on a frequent basis (e.g. 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 WordPress software, plugins and themes are up-to-date,
  • etc …

A complete WP maintenance routine looks like this …

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

Again, we cannot stress enough how important maintaining your WordPress web site frequently backed up and up-to-date is. WP 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 this 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 perform manual backups, there are a number of free and paid WordPress plugins you can use. Learn about a WordPress backup plugin that can automate your site backups here: Back Up, Duplicate And Keep Your WordPress Websites Protected With Backup Creator Plugin For WP

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

the worldwide brute force botnet attack on WordPress sites was mostly attempting to compromise website admin panels by exploiting WP installations using “admin” as their username.

For security purposes, avoid installing a WordPress site with the username “admin”. This is the first area of potential vulnerability hackers will test. If your site’s user name is “admin”, change this immediately.

For a simple tutorial created especially for non-technical admin users on how to change your login username, go here: How To Change Your WordPress User Name From Admin To A Different Username

Security Measure #4 – Use Strong Passwords

A “brute force” attack occurs when a malicious script persistently hits a login or password field with different character strings in an attempt to guess the right combination 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 simple and effective suggestions for doing this), the “bot” will just keep attacking your site until it eventually gets access.

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

Useful Tip

You can use a password program like Roboform to create secure login passwords …

You can use a password software tool like Roboform to help you generate secure login passwords(Roboform is a password program that lets you easily generate really secure passwords)

For a tutorial for non-technical WP admin users that shows you how to change your admin password, go here: What To Do If You Need To Change Your Login Password

Security Measure #5 – Secure Your WP Config File

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

wp-config.php file

(wp-config.php)

If a hacker breaks into your site, they will typically try to access your wp-config.php file, because this file contains your database information, 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 people from being able to easily access 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 WP Installation Files

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

These files are completely unnecessary after installation and can be deleted. If you don’t want to remove these files, just rename them.

Security Measure #7 – Update Your WordPress Installation, Themes & Plugins

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

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

Security Measure #8 – Disable The WordPress Theme Editor

WordPress comes with a built-in editor that lets the administrator edit theme and plugin files inside the dashboard area.

You can access your WordPress Theme Editor by selecting Appearance > Editor from the main menu …

WordPress Theme Editor Menu

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

This means that anyone logging into your site’s admin can see and make changes to all of your WordPress theme templates, and cause mayhem on your site.

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 Folder

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

Normally, this folder is visible to online users. All someone has to do to see all of the contents stored in your “uploads” folder is navigate to your directory using a web browser …

(WordPress uploads directory)

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

If any directories in your website have vulnerabilities that can be exploited by malicious users, this could become a serious threat to the security of 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 an empty file named “index.php”) to your uploads directory, and so on. Again, it’s best to ask for assistance from someone who knows what they are doing if you are not sure about what to do.

Security Measure #10 – Security Plugins

There are some great security plugins for WordPress available that specifically address common security issues faced by WordPress site owners, such as preventing unauthorized users from accessing your site, protecting your files from malicious exploits, preventing injections of code into files, etc.

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

SecureScanPro - WP complete security software solution

(SecureScanPro – total security plugin for WordPress)

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

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

Blog Defender WordPress Security Plugin

Blog Defender Security Solution For WordPress Websites & Blogs(Blog Defender Security Plugin For WordPress Sites)

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

BlogDefender shows you where potential security weaknesses in your web site are …

Blog Defender Security Solution For WordPressAnd then shows you how to fix these quickly and easily …

Blog Defender Security Solution For WordPressIf you don’t want to buy a premium security plugin like SecureScanPro or BlogDefender, then use various free plugins, such as Limit Login Attempts

Limit Login Attempts - WordPress Security Plugin

WordPress is a very secure platform, but neglecting simple maintenance tasks like keeping your WordPress software, WordPress plugins and WordPress themes updated to their latest versions, 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 simply cannot afford to ignore the importance of web security.

As a final reminder of the importance of keeping your websites protected, below is the advice given by a web security expert to all WordPress users after the global brute force attacks by botnets 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 above information has given you the initial steps you need to take to keep your WordPress site protected from brute force attacks. If you need any further help or assistance with WordPress security, please consult a WordPress security specialist, or search for a professional WordPress service provider in our WordPress Services Directory.

Also, don’t forget to subscribe to WPCompendium.org to be notified whenever we publish new tutorials on WordPress security and tutorials about WordPress security plugins and solutions.

***

"Wow! I never knew there's so much to learn about WordPress! I bought one of the WordPress for Dummies three years ago, such authors need to be on this course!" - Rich Law, Create A Blog Now

***