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

In early 2013 a large-scale brute-force attack struck WordPress installations across virtually every WP host server in existence.

These attacks were caused by computers infected with malware and programmed to attack other installations (called “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)

There are many ways hackers try to break into WordPress sites. One of these is by trying to guess the site admin’s login username and password. This can be achieved with scripts and tools that can guess hundreds of possible logins in minutes.

If you’re not using strong usernames or unguessable passwords, your website could be easily hacked by persistent attempts to guess your site’s login details.

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

”Botnets” are networks of computers that have been infected with malicious code or scripts, which can then be controlled remotely as a group, typically without the unsuspecting computer owners even being aware that this is happening.

Botnets are typically used to send mass spam emails from the infected computers of unsuspecting users.

Below is a screenshot taken from an internet security monitoring site showing the locations of the command centers of ZeuS – a botnet that has been actively infecting computer networks all around the globe since 2009 …

ZeuS is a botnet that has been actively infecting computer networks all around the world since 2009.

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

These were well organized and highly distributed botnet attacks on WordPress sites. Over 90,000 IP addresses were identified by several hosting companies in the initial attack alone, when millions of attempts to force their way into WordPress site administration areas occurred. The worldwide attacks then continued, with over 30,000 WordPress sites and blogs being hacked per day.

Coverage of the April 2013 mass brute force botnet attack was widely reported in all the major webhosting companiesand leading technology publications, such as TechNews Daily, Forbes, PC Magazine, BBC News, Tech Crunch, and even on the official US Department of Homeland Security website …

WordPress powers millions of sites around the world, which makes it a target for hacking

(Powering millions of sites worldwide makes WordPress a target for hackers)

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

No. In fact, there are many great reasons why you should continue using WordPress if you are concerned at all about the security of your online presence.

We explain what makes WordPress a very secure web platform in this article: Is WordPress Secure?

Important

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

Preventing Your WordPress Site From Being Brute Force Attacked – 10 Security Points

You may think that your website has nothing to offer to hackers, but the reality is that all websites have value to a malicious user.

If a malicious user can exploit a security vulnerability in your system and gain any form of control of your site, your site can then be used as a “bot” to attack larger and more highly-valued websites.

Additional undesirable effects of being hacked include getting blacklisted by search engines, having stealthy spam links promoting things like viagra, porn, etc. in your content and page title and descriptions, redirecting visitors to phishing sites or other websites, drive-by downloads (adding malicious software on your visitors’ computers), and lots of other nasty things.

The harsh reality is that malicious bots are probably scouring for weaknesses and trying to hack into your blog while you are reading this article at this very moment. Whether they can break into your site depends on how difficult or easy you can make things for hackers and bots to keep trying until they work out how to break in, or decide to look for a more vulnerable target.

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

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

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

You will see that the check returns a number of results and information about your site setup …

WordPress Security Scan

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

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

Hackertarget - WP Security Check(Screenshot image: 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 can all be useful information to hackers, as this can inform them about any potential security weaknesses, especially where site owners haven’t updated their software versions.

If your website runs on WordPress and you’re not proactive 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 targeting WordPress sites around the world!

Typically, whenever a website or blog is broken into, site owners can find themselves “locked out” of their own site, or notice that their files have been vandalized or that everything has been entirely wiped out. Typically, compromised sites will be infected with malicious scripts or viruses without the owner even being aware that a breach has taken place.

To avoid the heartache and frustration (and potential loss of valuable business data) that comes with discovering that your web site has been hacked into, we have listed below 10 essential and effective security measures that will help to protect your WordPress site from being brute force attacked.

Important

Note: Some of the measures listed below need some technical skills to modify core WordPress and server files. If you are not technical, or don’t want to mess around with file code, then ask your web host or search for a WordPress service provider in our WordPress Services Directory.

***

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

Get in touch with your web host and ask them exactly what precautions are in place to help prevent your site from brute-force attacks, and what is done to make sure that your server files and data are being regularly backed up.

It’s important to make sure that your hosting service regularly backs up your server files and that, if disaster strikes, you can easily recover your site.

Security Measure #2 – Perform Full WordPress Backups And Keep Your Site Frequently Updated

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

A full WordPress maintenance routine ensures that:

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

A proper WP maintenance routine looks like this …

Maintaining your WordPress website backed up and updated is vitally important for WordPress security.(Maintaining your WordPress website or blog regularly backed up and up-to-date is vitally important for WordPress security. Screenshot image: WPTrainMe.com)

Again, we cannot stress enough how vitally important maintaining your WordPress web site completely backed up and updated is. 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 WordPress maintenance yourself, get someone else to do it but make sure this gets done. Backing up your website is the next most important thing you should do after making sure that you still have a pulse!

If you don’t want to back up your site manually, there are many free and paid WordPress plugins you can use. You can read about a WordPress backup plugin that can fully automate your site backups here: Back Up, Duplicate & Protect Your WP Sites With Backup Creator WordPress Plugin

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

The mass brute force attack on WordPress is mostly attempting to compromise site admin panels and gain access to the site by exploiting sites that used “admin” as the account name.

For reasons of website security, avoid setting up a WordPress site with the username admin. This is the first thing hackers will test. If your site’s username is admin, then change this immediately.

We have created a step-by-step tutorial that shows you how to change your username here: Changing Your Admin Username In WordPress To Another User Name

Security Measure #4 – Make Sure Your Password Is Strong

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

Unless some measure is put into place to block the brute force attack from happening (see further below for a couple of simple and effective ways to do this), the “bot” will just persist in attacking your site until it eventually gets access.

Passwords that are easy to guess, therefore, make very easy targets for bot attacks. Make sure that you change your password to something containing at least 8 or 9 characters long, with both upper and lowercase letters, and “special” characters (%^#$@&*).

Tip

Roboform is a password management tool you can use to generate different secure login passwords …

Roboform is a password tool that lets you create different secure passwords(You can use a password management tool like Roboform to help you generate strong passwords)

For a step-by-step tutorial for admin users that shows you how to change your login password, go here: Changing Your Login Password

Security Measure #5 – Prevent The wp-config.php File From Being Easily Accessible

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

WP Config file

(wp-config.php file)

If a hacker breaks into your WordPress website, they will normally look for the wp-config.php file, because this file contains your WordPress database information, 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 attacks and even being used as part of a bot net, therefore, you must prevent people finding 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 – Rename Or Delete Unnecessary Installation Files

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

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

Security Measure #7 – Upgrade Your WordPress Site, Themes & Plugins To Their Latest Version

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

Ensure that all of your WordPress application files, plugins, themes, etc. are always up to date.

Security Measure #8 – Disable The WordPress Theme Editor

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

You can access the WordPress Theme Editor by selecting Appearance > Editor in your dashboard menu …

WordPress Theme Editor Menu

(Accessing the WordPress theme editor via the WP admin menu)

The WordPress theme editor lets anyone accessing your site’s admin view and edit your WordPress theme files, and create mayhem on your site.

To prevent unauthorized people from accessing the 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 – Secure Your Site’s Uploads Folder

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

Normally, this folder is visible to anyone online. All someone has to do to view the contents stored in your “uploads” folder is visit your directory using their browser …

(WordPress uploads folder)

(WordPress has an uploads directory where your media files are stored)

If any directories in your website have weaknesses or vulnerabilities that can be exploited by hackers, someone could upload unauthorized file types or compromise the security of 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, 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 seek professional help if you are not sure about what to do.

Security Measure #10 – WordPress Security Plugins

A number of great WordPress security plugins are available that will address many common security issues faced by WordPress site owners, such as preventing hackers from accessing vital areas of your site, protecting your site from botnets, preventing unauthorized file uploads, 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 issues that could lead to hackers accessing your files and causing irreparable damage to your site is SecureScanPro.

SecureScanPro - complete security software solution for WordPress

(SecureScanPro – complete security software solution for WordPress)

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

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

Blog Defender Security Suite For WordPress

Blog Defender WordPress Security Product Suite(Blog Defender Security Product Suite For WordPress)

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

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

Blog Defender Security Solution For WordPressAnd lets you fix these quickly …

Blog Defender Security SuiteIf you don’t want to purchase a security plugin like SecureScanPro or BlogDefender, you can use various free WordPress plugins, such as Limit Login Attempts

Limit Login Attempts - WordPress Security Plugin

WordPress is a very secure web platform, but neglecting essential maintenance tasks like ensuring that your WP software, WP plugins and themes are kept up-to-date, tightening file and data protection and taking other necessary precautions can have disastrous consequences.

No matter what type of business you run or plan to run online and how small you think your web presence is, website security is something you cannot ignore.

As one last reminder, below is the advice given by a website security expert to all WordPress users following the mass 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 will help 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 WordPress technical provider in our WordPress Services Directory.

Also, do yourself a favor and subscribe to WPCompendium.org to receive notifications via email whenever we publish new tips on WordPress security and tutorials about WordPress security plugins.

***

"Learning WordPress has been a huge stumbling block for me. I've been looking for something that covers absolutely everything but doesn't cost an arm and a leg. Thank you so much ... you have just provided me with what I have been looking for! Truly appreciated!" - Tanya

***