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 frequently the target of attacks by hackers.

In April 2013 a global brute-force attack began hitting WordPress installations across almost every WP host server in existence around the world.

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

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

Brute Force Attacks – Definition

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. To achieve this, hackers use software tools that can guess hundreds of login permutations in minutes.

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

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

”Botnets” are networks of computers that have been compromised and infected with malicious code or software, which are then controlled remotely as a group, typically without the computer owners even being aware of this.

Botnets are typically used to blast mass spam emails from computers of unsuspecting users.

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 compromising computer networks all around the world since 2009 …

The Zeus botnet has been actively compromising 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. Image: SecureList.com)

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

News of the April 2013 large-scale brute-force attack was widely reported in all of 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 …

Powering millions of websites around the world makes WordPress an obvious target for hacking attacks

(Powering millions of websites worldwide makes WordPress an obvious target for hacking)

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 about the security of your online business.

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

Important

It’s important to note that, in the case of the brute force botnet attack described above, there was 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 with Matt Mullenweg, 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 Blog From Being Brute Force Attacked – Ten Security Checks

You may think that your site is of no interest to hackers, but the reality is that all websites are valuable to a malicious user.

If someone can find a way to break in and gain stealth control of your website, the blog can then be used as a “bot” in a planned cyber attack against more valuable websites.

Additional undesirable results of having your website hacked and your site security compromised include being blacklisted by Google, having stealthy spam links advertising things like online meds, cheap offers on brand names, etc. inserted into your content, malicious redirects to phishing sites and other websites, data exfiltration (stealing customer details or Personal Identifiable Information from your web applications), and lots of other nasty things.

The truth is that brute-force software bots are probably trying to hack into your website at this very moment. Whether they will break into your site successfully or not, will depend on how hard or easy you have made things for hackers or bots to keep persisting until they work out how to get access, or are forced to give up and decide to look for a less secure target.

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

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

Hackertarget - WP Security Check(WP Security Check Image source: https://hackertarget.com/wordpress-security-scan)

You will see that the scan will yield various results and information about your website …

WP Security Scan

(Hackertarget – website security check results. Image source: Hackertarget.com)

It should be obvious after using the above tool that if you can see all of this information, so can hackers.

Website Security Scan(Product image: Blog Defender)

The ability 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 on your server can be potentially useful information to hackers, as this can inform them about any exploitable vulnerabilities, especially in older versions.

If your website is powered by WordPress and you are not taking steps to bolster the security of your site, it’s practically guaranteed that, at some time in the near future, someone will attempt to hack your installation, because these attacks are systematically hitting WordPress sites worldwide!

Whenever a website is broken into, site owners will find themselves completely “locked out” of their own site, or notice that their content has been altered or that everything has been entirely wiped out. Typically, compromised sites will become infected with malicious software or viruses without the owner’s knowledge or awareness.

To avoid the heartache and aggravation (and potential financial loss) that comes with discovering that your website or blog has been hacked into, below are ten simple, yet essential and effective security checks that will help to prevent your WordPress site from brute force attacks.

Warning

Note: Some of the recommended measures below need some technical understanding of how to modify core WordPress and/or server files. If you have no web skills, or don’t want to mess around with file code, then ask your web host or a professional WordPress technical provider for help.

***

Security Measure #1 – Contact Your Hosting Company

Contact your hosting provider and ask them what systems they have put in place to protect your site from being attacked, and what is done to make sure that your server files get regularly backed up.

Make sure that your webhosting provider regularly backs up your server files and that, if disaster strikes, you can easily get back your site.

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

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

A complete WordPress maintenance routine ensures that:

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

A complete WordPress site maintenance routine looks like this …

Maintaining your WordPress site fully backed up and up-to-date is vitally important for WordPress security.(Maintaining your WordPress website fully backed up and updated is vitally important for WordPress security. Image source: WPTrainMe.com)

Again, we cannot stress enough how important it is to maintain your WP website frequently backed up and up-to-date. WordPress site maintenance is not hard to do 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 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 still have a pulse!

If you don’t want to perform manual backups, there are many free and paid WordPress plugins you can use. Learn about a WordPress backup plugin that can fully automate your backup process here: Back Up, Duplicate And Protect Your WordPress Site With Backup Creator Plugin For WP

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

The brute-force attack on WordPress is mostly an attempt to compromise website administrator panels and gain access to the site by exploiting WP installations that used “admin” as the username.

For security reasons, never set up a WordPress site with the username “admin”. This is the first area hackers will test. If your site’s username is admin, then make sure you change it immediately.

We have created a detailed tutorial for admin users that shows you how to change your admin username here: Changing Your WP Username From Admin To Another User Name

Security Measure #4 – Use Strong Passwords

A “brute force” attack occurs when malicious software continually and persistently tries to guess the right username and password character string 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 continue to attack your site until it eventually gets access.

Weak passwords, therefore, make really easy targets for hacking attacks. Make sure that you change your password to something that contains at least 8 or 9 characters long, with both upper and lowercase letters, combined with a few “special” characters (^%$#&@*).

Tip

You can use a password tool like Roboform to help you generate difficult passwords …

You can use a password management tool like Roboform to create hard-to-crack passwords(Roboform is a password management tool that lets you generate secure login passwords)

For a detailed tutorial for non-technical WP admin users on how to change your WordPress password, go here: What To Do If You Need To Reset Passwords

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

The wp-config.php file allows WordPress to communicate with the database to store and retrieve data and is used to define advanced WordPress options.

WordPress WP Config file

(WP Config file)

If hackers break into your WordPress website, they will typically look for the wp-config.php file, because this is the file that contains your WordPress 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 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 – Rename Or Delete Unnecessary Site 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, just rename them.

Security Measure #7 – Keep Your WordPress Blog, Plugins And Themes Up-To-Date

Hackers are always on the lookout for vulnerabilities they can exploit in outdated WordPress versions, including out-of-date versions of WP themes and plugins.

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 installations come with a built-in editor that allows the site administrator to edit plugin and theme code from the dashboard.

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

WordPress Theme Editor Menu

(The WordPress theme editor is accessible via the WordPress admin menu)

The WordPress theme editor allows anyone accessing your blog to see and make changes to all of your WordPress theme template files, or create havoc on your site.

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

Security Measure #9 – Prevent Access To The Site’s Uploads Directory

The “uploads” directory 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 the contents stored in your site’s “uploads” directory is visit your directory using a web browser …

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

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

If any directories in your website have vulnerabilities that can be exploited by malicious users, this can seriously threaten the security of your website.

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

Security Measure #10 – Security Plugins

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

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

SecureScanPro - total security plugin for WordPress

(SecureScanPro – WP security software)

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

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

Blog Defender Security Solution

Blog Defender(Blog Defender WordPress Security Product Suite)

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

BlogDefender scans you WordPress installation for potential security vulnerabilities …

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

Blog DefenderIf 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 web platform, but neglecting essential maintenance tasks like making sure that your WP core files, WP plugins and WP themes are kept updated to their latest versions, tightening file and data protection and taking other necessary precautions can expose your website to malicious by hackers and bots.

Regardless of the type of business you run or plan to run online and how small you think your web presence is, web security is something you cannot ignore.

As a final reminder, below is the advice given by an expert on website security to all WordPress users after the large-scale 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 very important if you run a WordPress site. Hopefully, the above information 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 seek help from a WordPress security specialist, or search for a professional WordPress technical provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to be notified when we publish new tips on WordPress security and reviews of WordPress 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)

***