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 powers millions of websites worldwide, which makes it a frequent target for hacking attempts.

In 2013 a mass brute-force attack hit WordPress installations across virtually every WP hosting server in existence.

These attacks were caused by networks of infected computers programmed to attack other vulnerable sites, also commonly known as “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)

There are many methods hackers use to try and break into a WordPress site. One of these is by trying to guess the site’s administration login username and password. To achieve this, hackers use scripts and software tools that can work through hundreds of login possibilities in minutes.

If you’re using weak login details, your website could be easily hacked by a malicious software’s persistent attempts to guess your site’s login details.

This is called a “brute force” login attack.

What Is A Botnet?

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/botnet)

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

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

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

The Zeus botnet has been actively compromising computer networks all around the globe since 2009.

(ZeuS is a botnet that has been actively infecting computer networks all around the globe since 2009. Screenshot source: SecureList.com)

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

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

Powering millions of websites and blogs around the world makes WordPress an obvious target for hacker attacks

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

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

No. In fact, there are many great reasons why you should choose WordPress if you are concerned at all about the security of your website.

We explain why WordPress is a secure web platform in this article: Concerned About WordPress Security? What Every Website Owner Needs To Know

Info

It’s important to note that, in the case of the worldwide brute force attack described above, there was no WordPress vulnerability being exploited (the same script was also attacking sites built using platforms like Joomla).

Mike Little, one of the co-founders of WordPress with Matt Mullenweg, 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)

How To Protect Your WordPress Website From Brute-Force Attacks – Ten Security Points

Every website or blog with a security vulnerability presents an opportunity to hackers. An unsecured web site provides hackers with a valuable resource to launch denial of service attacks, spread malware and engage in information theft.

If someone can exploit a way to compromise the control of your blog, that web site can then be employed as a “bot” in a planned cyberattack against larger and more valuable sites.

Additional undesirable impacts of having your website hacked and your site security compromised include being blacklisted by Google, having spammy links advertising things like casinos, discounted fashion, etc. in your content and meta data, redirecting visitors 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 truth is that malicious bots are trying to break into your blog at this very moment. Whether they will do this successfully depends on how hard or easy you have made it for hackers to continue persisting until they discover a way to get in, or give up and go look for a less protected target.

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

Does your website run on WordPress? If so visit Hackertarget.com and run your website through their WordPress security check …

WP Security Check(Website Security Check Product image source: Hackertarget.com)

You will see that the check returns various results and information about your website setup …

Hackertarget - Website Security Scan

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

It should be obvious after using the above tool that if you are able to freely access all of this information, so can hackers.

Website Security Scan(Screenshot image: BlogDefender.com)

The ability 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 on your server can be useful information to hackers, as this informs them about exploitable security vulnerabilities, especially where site owners haven’t updated their files.

If your website is driven by WordPress and you’re not taking appropriate steps to bullet-proof your site, then we can practically guarantee that, at some point, your site will be hacked, or at least targeted by bots, because these brute force attacks are systematically hitting WordPress sites around the world!

When a site is compromised, webmasters can find themselves completely “locked out” of their own site, or notice that their files have been altered or that everything has been entirely wiped out. Often, most sites will become infected with malicious scripts or viruses without the owner’s knowledge or awareness.

To help avoid the heartache (and potential loss of valuable business data) of discovering that your site has been hacked into, below are 10 essential and effective security measures that will help to protect your WordPress site from brute force attacks.

Important

Note: A few of the recommended steps listed below require some technical understanding of how to modify core WordPress and/or server files. If you have no web coding 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 Web Host

Contact your web host and ask them exactly what security systems have been put into place to help prevent your site from being attacked, and what is done to ensure that your server files are regularly being backed up.

Make sure that your webhosting provider is regularly backing up your server files and that, if anything should happen, you can easily get back your site.

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

You should never rely only on your host for your 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 full WordPress site maintenance routine on a frequent basis (e.g. weekly, fortnightly, 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 software, themes and plugins are up-to-date,
  • etc …

A proper WP maintenance routine looks like this …

Maintaining your WordPress website regularly backed up and updated is vitally important for WordPress security.(Maintaining your WordPress website regularly backed up and updated is vitally important for WordPress security. Image source: WPTrainMe.com)

Again, we cannot stress enough how vitally important it is to maintain your WordPress installation fully backed up and updated. WordPress site maintenance is not hard to do 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 WordPress site maintenance yourself, get someone else to do it but make sure it gets done. Backing up your site is the second most important thing you must do after making sure that you are still breathing!

If you don’t want to back up your files manually, there are a number of free and paid WordPress plugins you can use. You can read about a WordPress backup plugin that can fully automate your site backups here: Backup, Copy & Keep Your WordPress Web Sites Protected With Backup Creator Plugin For WP

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

The large scale brute force botnet attack on WordPress is mostly an attempt to compromise site admin panels by exploiting WordPress sites using “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 blog’s username is “admin”, you should change this immediately.

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

Security Measure #4 – Your Password

A “brute force” attack occurs when malicious software persistently hits a username and password field with different strings of characters in an attempt to guess the right combination that will unlock your site.

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

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

Useful Tip

Roboform is a password software you can use to create different unbreakable passwords …

You can use a password program like Roboform to generate  passwords(You can use a password tool like Roboform to generate strong login passwords)

We have created a step-by-step tutorial on how to change your admin password here: Changing Your Password

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

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

WP Config file

(wp-config.php)

If hackers break into your site, they will normally 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 them 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 – Delete Or Rename Unnecessary Installation Files

Delete or rename 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 – Update Your WordPress Installation, Plugins And Themes

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

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

Security Measure #8 – Disable The Theme Editor

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

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

WordPress Theme Editor Menu

(The WordPress theme editor is accessible using the WP admin menu)

This allows anyone accessing your site to view and modify your WordPress files, or cause havoc on your site.

To prevent unauthorized people from accessing your WordPress Theme editor, you will need to disable it. This can be done by editing 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 website.

By default, this folder is visible to online users. All someone has to do to view all of the contents stored in your site’s “uploads” folder is visit the directory using their browser …

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

(WordPress uploads directory)

If any files stored in his folder have vulnerabilities that can be exploited by hackers, this can 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 an empty file called “index.php”) to your uploads directory, and so on. Again, it’s best to consult a professional if you are not sure about what to do.

Security Measure #10 – Security Plugins

There are several security plugins for WordPress available that specifically address common security issues faced by WordPress website owners, such as preventing hackers from accessing vital areas of your site, protecting your site from malicious software, preventing injections of code into files, etc.

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

SecureScanPro - security software for WordPress

(SecureScanPro – WP complete security software solution)

SecureScanPro is easy to install and easy to use, and takes care of 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 Plugin

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

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

BlogDefender scans you WordPress installation for security vulnerabilities …

Blog Defender Security Product Suite For WordPressAnd lets you easily fix these …

Blog DefenderIf you don’t want to invest in 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 simple maintenance tasks like keeping your WP software, WP plugins and WP themes up-to-date, 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 one last reminder, below is the advice given by a website security expert to all WordPress users after the global 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, WordPress security is very important if you run a WordPress site. Hopefully, this information 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 professional WordPress security specialist, or search for a WordPress technical provider in our WordPress Services Directory.

Also, remember subscribe to WPCompendium.org to be notified when we publish new information on WordPress security and tutorials about new WordPress security plugins.

***

"This is AMAZING! I had learnt about how to use WordPress previously, but this covers absolutely everything and more!! Incredible value! Thank you!" - Monique, Warrior Forum

***