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 world’s leading content management system and the online publishing platform of choice for 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 by hackers wanting to score a “big win”.

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

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

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)

One of the many ways hackers will attempt to break into WordPress sites is by trying to guess the site’s administration login username and password. This is done using scripts and software tools that automatically tries to guess hundreds of possible logins in minutes.

If you’re using weak user names and passwords that are easy to guess, your website 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)

A “Botnet” is a network of private computers that have been infected with malicious code or software, which can then be controlled remotely as a group, often without the unsuspecting computer owners even being aware that this is happening.

Botnets are regularly used to blast 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 compromising computer networks all around the globe since 2009 called “Zeus” …

The Zeus botnet 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. Screenshot: SecureList.com)

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

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

Being the world's most popular content management system makes WordPress a target for malicious attacks by hackers

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

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

We explain why WordPress is a secure web platform in this article: Is WordPress A Secure Platform For Websites?

Useful Information

It’s important to note that, in the case of April 2013 brute force attack described above, no specific WordPress vulnerability was being exploited (the same script was also targeting sites built using other web applications like Joomla).

Mike Little, the co-founder of WordPress, made this 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)

Preventing Your WordPress Website From Being Brute-Force Attacked – 10 Security Checks

Every website or blog with a vulnerability offers some value to hackers. No blog is completely immune from being hacked. Business sites, personal blogs, government websites … even sites owned by web security experts can and have been targeted.

If hackers can find a way to gain complete control of your web site, that blog can then be used to attack other highly-valued web sites.

Additional undesirable impacts of having your website hacked and your site security compromised include being blacklisted by search engines, having spammy links advertising things like online meds, cheap offers on brand names, etc. inserted in your content and page title and descriptions, malicious redirects to phishing sites or other websites, data exfiltration (stealing information or Personal Identifiable Information from your web applications), and lots of other nasty things.

The reality is that malicious bots are trying to break into your blog while you are reading this page. Whether they can successfully hack in will depend on how challenging you can make things for hackers to continue persisting until they either can discover how to get in, or are forced to decide to look for a less secure target.

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

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

Website Security Check(Hackertarget – WP Security Check Source: https://hackertarget.com/wordpress-security-scan)

You will see that the check returns a number of results and details about your WordPress installation …

Website Security Scan

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

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

WordPress Security Scan(Screenshot source: Blog Defender)

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

If your website runs on WordPress and you are not taking steps to bolster the security of your site, we can practically guarantee that, at some point in time, your site will be hacked, or at least targeted by bots, because these brute force attacks are systematically targeting WordPress sites worldwide!

When a website gets broken into, blog owners can discover much to their dismay that they have been “locked out” of their own site, or notice that their files have been vandalized or even that their content has been entirely wiped out. Typically, most sites will be infected with malicious software or viruses without the owner even being aware that this has occurred.

To help avoid the heartache that comes with discovering that your site has been hacked into, below are ten essential and effective security checks that will help to protect your WordPress site from brute force botnet attacks.

Info

Note: A few of the recommended steps below need some technical skills to modify core WordPress and server files. If you lack these technical skills, 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 Host

Get in touch with your web host and ask them what systems have been put in place to help prevent your site from brute force attacks, and what they are doing to ensure that your site files are being backed up.

Make sure that your webhosting provider is backing up your sites and that, if anything should happen, you can quickly and easily recover your files.

Security Measure #2 – Perform Full WordPress Backups And Keep Your Site Frequently Up-To-Date

Never rely on your host for site backups. Instead, learn how to maintain and manage your WordPress site or get this done for you and develop a habit of performing a complete site maintenance routine frequently (e.g. daily, weekly, monthly, etc …)

A full WordPress maintenance routine ensures that:

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

A full WordPress site maintenance routine looks like this …

Maintaining your WP website or blog completely backed up and up-to-date is vitally important for WordPress security.(Maintaining your WP website fully backed up and up-to-date is vitally important for WordPress security. Source: WPTrainMe.com)

Again, we cannot stress enough how vitally important maintaining your WP site frequently 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 or blog. If you don’t 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 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 perform manual backups, there are a number of free and paid plugins you can use. You can read about a WordPress backup plugin that can automate your backup process here: Backup, Duplicate & Keep Your WordPress Websites And Blogs Protected With Backup Creator WP Plugin

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

The mass brute force botnet attack on WordPress is mostly attempting to compromise site administrator panels and gain access to sites by exploiting sites with “admin” as the username.

For security reasons, avoid setting up sites with the username admin. This is the first area of potential vulnerability hackers will test. If your site’s username is “admin”, you need to change this immediately.

For a simple tutorial on how to change your admin username, go here: Changing Your WordPress Admin Username To A More Secure Username

Security Measure #4 – Avoid Weak Passwords

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

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

Weak passwords, therefore, become very easy targets for botnets. Make sure that you change your password to something that is at least eight characters long, with upper and lowercase letters, and “special” characters (e.g. %, $, @, etc).

Practical Tip

Roboform is a password tool that lets you create strong passwords …

Roboform is a password program you can use to generate secure passwords(You can use a password management program like Roboform to help you generate hard-to-crack passwords)

We have created a tutorial created especially for admin users that shows you how to change your password here: What To Do If You Need To Reset WordPress Passwords

Security Measure #5 – Deny Access To Your WP Config File

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

(wp-config.php file)

If hackers break into your WordPress website, they will typically search for your 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.

In order to protect your WordPress site from attacks and even being used as part of a bot net, therefore, prevent your wp-config.php file from being easily 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 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 – Keep Your WordPress Installation, Plugins & Themes Up-To-Date

Hackers look for vulnerabilities in outdated versions of WordPress that can be exploited, including out-of-date versions of plugins and themes.

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

Security Measure #8 – Disable The WordPress Theme Editor

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

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

WP Theme Editor Menu

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

The WordPress theme feature lets anyone accessing your blog’s admin view and edit all of your WordPress theme files, or cause mayhem on your site.

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

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

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

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

(WordPress uploads folder)

(WordPress uploads directory)

If any directories in your website have vulnerabilities that can be exploited by malicious users, someone can upload unauthorized file types or compromise 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 get professional assistance if you are unsure about what to do.

Security Measure #10 – Security Plugins

There are a number of great security plugins for WordPress available that will address most common security issues WordPress site owners face, such as preventing unauthorized users from accessing vital areas of your site, protecting your website from brute-force attacks, preventing injections of code into files, etc.

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

SecureScanPro - WordPress security software solution

(SecureScanPro – complete security software for WordPress)

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

Blog Defender Security Product Suite For WordPress(Blog Defender)

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

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

Blog DefenderAnd lets you fix these quickly …

Blog Defender Security Suite For WordPress Websites & BlogsIf you don’t want to invest in a 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 updating your WordPress installation, plugins and themes, 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, you simply cannot afford to ignore the importance of website security.

As one last 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, the above information has provided you with the initial guidelines and direction you need 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 professional WordPress security specialist, or search for a professional WordPress service provider in our WordPress Services Directory.

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

***

"I was absolutely amazed at the scope and breadth of these tutorials! The most in-depth training I have ever received on any subject!" - Myke O'Neill, DailyGreenPost.com

***

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