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 global popularity.

In April 2013 a global brute-force attack began hitting WordPress installations on virtually every WP host server in existence.

These attacks were caused by infected computer networks programmed to attack other installations (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 WordPress sites is by trying to guess the site’s administration login username and password. To attempt this, hackers use scripts and software that can guess hundreds of login permutations in minutes.

If you’re using easy-to-guess user names and passwords, your website can be easily hacked by the malicious software’s repeated attempts to work out your site’s login details.

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 computers that have been compromised and infected with malicious scripts or software code, which are then controlled remotely as a group, often without the computer owners’ knowledge.

Botnets are normally used used to send out 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 infecting computer networks all around the globe since 2009 …

The Zeus botnet has been actively infecting computer networks all around the world since 2009.

(The Zeus botnet has been actively compromising computer networks all around the world since 2009. Image source: SecureList.com)

These were well organized and highly distributed attacks. Over 90,000 IP addresses were identified by a number of webhosting companies just in the initial attack, when millions of attempts to force their way into WordPress site administration areas occurred. The mass brute-force attacks then continued, with over 30,000 WordPress sites and blogs being hacked each day.

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

WordPress is the world's most used CMS making it a target for hacking

(Powering millions of sites around the world makes WordPress an obvious target for attempted attacks by hackers)

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

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

To learn what makes WordPress a very secure platform for websites, read this article: Why WordPress Is A Secure Platform For Websites –

Important Info

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

Mike Little, one of the co-founders of WordPress, said this about the botnet 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 Website From Brute-Force Attacks – Ten Security Measures

Every site with a vulnerability provides some value opportunity to hackers. No website Large, medium and small sites, personal blogs, government web sites … even web sites owned by online security and anti-hacking experts can and have been targeted.

If a hacker can find a software security flaw, the website or blog can then be employed as part of a larger network of “bots” to target larger and more valued websites.

Additional undesirable consequences of being hacked include being blacklisted by Google, having spammy links advertising things like casinos, discounted fashion, etc. inserted into your content and meta data, malicious redirects to phishing sites, data exfiltration (stealing information or Personal Identifiable Information from your web applications), and lots of other nasties.

The harsh reality is that malicious bots are most likely trying to break into your website at this very moment. Whether they will hack in successfully depends on how hard you will make it for hackers or bots to continue trying until they find how to break in, or are forced to 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 a site like Hackertarget.com and run your site through their WordPress security scan …

Hackertarget - Website Security Scan(WordPress Security Scan Source: https://hackertarget.com/wordpress-security-scan)

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

Hackertarget - WP Security Check

(Hackertarget – WP security scan results. Source: Hackertarget.com)

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

Hackertarget - WordPress Security Check(Image source: 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 in your site can be potentially valuable information to hackers, as this informs them about any potential security weaknesses, especially where the owners haven’t updated their files.

If your site or blog is powered by WordPress and you’re not proactive 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 brute force attacks are systematically hitting WordPress sites worldwide!

Whenever a website is compromised, website owners can find themselves completely “locked out” of their own site, or notice that their files have been modified or even that their content has been entirely wiped out. Typically, compromised sites will be infected with malicious software without the owner’s knowledge or awareness.

To help avoid the heartache and aggravation (and significant loss of valuable business data) that comes with discovering that your site has been hacked into, we have listed below 10 simple, yet essential and effective security checks that will help to prevent your WordPress site from being brute-force attacked.

Note

Note: Some of the measures 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 file code, then ask your web host or a professional WordPress technical provider for assistance.

***

Security Measure #1 – Get In Touch With Your Host

Contact your web host and ask them what systems they offer to protect your site from being attacked, and what they do to make sure that your server files get regularly backed up.

Make sure that your hosting service provider is regularly backing up your server files and that, if disaster strikes, you can easily get your files and data back.

Security Measure #2 – Perform Full WordPress Backups And Keep Your Website Regularly Updated

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

A full WordPress maintenance routine ensures that:

  • All unnecessary data and files are deleted,
  • 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 web site backed up and up-to-date is vitally important for WordPress security.(Maintaining your WordPress site completely backed up and updated is vitally important for WordPress security. Source: WPTrainMe.com)

Again, we cannot stress enough how important it is to maintain your WP website fully backed up and up-to-date. WordPress 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 WordPress 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 should do after making sure that you are still breathing!

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

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

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

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

For a simple step-by-step tutorial that shows you how to change your admin username, go here: How To Change Your WP Username From Admin To A More Secure Username

Security Measure #4 – Use A Strong Password

A “brute force” attack occurs when a malicious script continually and persistently hits a login or password field with different strings of characters in an attempt to guess the right login combination that will give them entry to your site.

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

Passwords that are easy to guess, therefore, make very easy targets for hackers. Make sure that you change your password to something that is at least eight characters long, and that includes upper and lowercase letters, and “special” characters (%^#$@&*).

Useful Tip

You can use a password management program like Roboform to help you generate passwords …

You can use a password tool like Roboform to create hard-to-crack passwords(You can use a password management program like Roboform to generate hard-to-crack passwords)

We have created a step-by-step tutorial for non-technical admin users on how to change your admin password here: How To Change Your Password

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 options for WordPress.

wp-config.php file

(wp-config.php)

If a hacker breaks into your WordPress website, they will normally look for your wp-config.php file, because this is the file that contains important information about your site’s database, 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 your install.php, upgrade.php and readme.html files.

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 Files, Themes And Plugins To Their Latest Version

Hackers look for vulnerabilities in previous versions of WordPress that they can exploit, including outdated versions of WP themes and plugins.

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

Security Measure #8 – Disable Your Theme Editor

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

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

WP Theme Editor Menu

(The WordPress theme editor is accessible using the WordPress main menu)

The WordPress theme editor allows anyone accessing your site to view and edit your theme template files, and create havoc on your site.

If you want to prevent 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 “uploads” directory contains all the media that gets uploaded to your WordPress site.

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

(WordPress uploads directory)

(WordPress uploads directory)

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by hackers, someone could upload unauthorized file types to your site.

Protecting your directories will prevent online users from viewing 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 an empty file called “index.php”) to your uploads directory, and so on. Again, it’s best to use a professional if you are unsure about what to do.

Security Measure #10 – Security Plugins

There are some great WordPress security plugins available that specifically address many common security issues faced by WordPress site owners, such as preventing hackers from gaining access to vital information about your site, protecting your files from botnets, preventing injections of code into files, etc.

Most 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 website files and causing damage to your site is SecureScanPro.

SecureScanPro - complete security software for WordPress

(SecureScanPro – total security software solution for WordPress)

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

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

Blog Defender

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

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

BlogDefender shows you where the security weaknesses in your website are …

Blog Defender Security Solution For WordPress BlogsAnd then shows you how to easily fix these …

Blog DefenderIf 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 secure web platform, but neglecting simple maintenance tasks like ensuring that your WP software, plugins and WordPress themes are kept up-to-date, tightening file and data protection and taking other necessary precautions can have disastrous consequences.

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 simply cannot ignore.

As one last reminder, below is the advice given by a website security expert to all WordPress users following 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, this article will help 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.

We also recommend subscribing to WPCompendium.org to receive notifications whenever we publish new tips on WordPress security and tutorials about WordPress security plugins and solutions.

***

"This is an awesome training series. I have a pretty good understanding of WordPress already, but this is helping me to move somewhere from intermediate to advanced user!" - Kim Lednum

***