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 malicious attacks by hackers.

In early 2013 a worldwide brute force attack began hitting WordPress installations across virtually every host server in existence around the world.

These attacks were caused by networks of infected computers programmed to attack other vulnerable installations (botnets).

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

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 use to try and break into WordPress sites is by trying to guess the site admin’s login username and password. This is done using scripts and software that can work through hundreds of possible logins in minutes.

If you’re using predictable usernames and weak passwords that are easy to guess, your site can be easily hacked by persistent attempts to guess your site’s login details.

This is called a “brute-force” attack.

Botnet Definition

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.org)

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

Botnets are normally used used to send mass spam emails.

The screenshot below was taken from an internet security monitoring site showing the locations of the command centers of a botnet that has been actively compromising computer networks all around the world since 2009 called “Zeus” …

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

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

These were highly distributed and well organized attacks. Over 90,000 IP addresses were identified by several webhosting companies in the initial attack alone, when millions of attempts to force their way into WordPress users administration areas took place. The worldwide brute-force attacks continued after this, with over 30,000 WordPress blogs being hacked each day.

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

WordPress is the world's most popular content management system which makes it a target for hacking attacks

(WordPress often is targeted 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.

To learn what makes WordPress a very secure web platform, see this article: Is WordPress A Secure Platform For Websites?

Important Info

It’s important to note that, in the case of the large-scale brute-force botnet attack described above, was no specific vulnerability in WordPress being exploited (the same script was also targeting sites built using platforms like Joomla).

Mike Little, the co-founder 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)

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

Every website with a vulnerability offers some value to hackers. An unsecured web site presents hackers with a valuable resource for denial of service attacks, spreading malware and to engage in information theft.

If hackers can find a vulnerability in your security setup, that site can then be used to target larger and more highly-valued web sites.

Additional undesirable results of having your site hacked include getting blacklisted by Google, having stealthy spam links advertising things like gambling, discounted fashion, etc. inserted into your content and page title and descriptions, malicious redirects to phishing sites, data exfiltration (stealing information or Personal Identifiable Information from your web applications), and many other nasty things.

The harsh reality is that malicious bots are scouring for exploits and trying to break into your blog at this very moment. Whether they can hack in will depend on how hard or easy you have made things for them to keep trying until they can either discover a way to get access, or are forced to give up and decide to look for a less secure target.

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

Does your website run on WordPress? If so visit a site like Hackertarget.com and run your site through their WordPress security scan …

Website Security Scan(WordPress Security Scan Product image source: Hackertarget.com)

You will see that the scan returns various results and details about your site …

Hackertarget - WordPress Security Check

(Hackertarget – WordPress security scan results. Image source: Hackertarget.com)

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

Hackertarget - WP Security Scan(Screenshot: BlogDefender website)

Being able 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 in your site can all be useful information to hackers, as these can inform them about potentially exploitable vulnerabilities, especially where site owners haven’t updated their files.

If your site or blog is powered by WordPress and you are not precautionary steps to harden your site, then it’s practically guaranteed that, at some point in time, someone will attempt to hack your site, because these attacks are systematically hitting WordPress sites all the world!

When a website or blog gets compromised, website owners will find themselves “locked out” of their own site, or notice that their content has been vandalized or that everything has been entirely wiped out. Often, most sites will be infected with malicious scripts or viruses without the owner’s knowledge or awareness.

To avoid the heartache (and significant financial loss) that comes with discovering that your site has been hacked into, below are ten simple, yet essential and effective security measures that will help to protect your WordPress site from being brute force attacked.

Important

Note: Some of the recommended measures shown below need some technical understanding of how to modify core WordPress and/or server files. If you are not technical-minded, or don’t want to mess around with code on your site, then ask your web host or a professional WordPress technical provider for assistance.

***

Security Measure #1 – Contact Your Hosting Company

Get in touch with your hosting service and ask them what precautions have been put into place to help prevent your site from being attacked, and what is done to make sure that your server files and data get backed up.

Make sure that your webhosting provider is backing up your sites and that, if anything happens, you can quickly and easily get your files back.

Security Measure #2 – Back Up Your WordPress Data And Files And Keep Your Site Regularly Up-To-Date

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

A proper WordPress maintenance routine ensures that:

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

A proper WP 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 or blog fully backed up and up-to-date is vitally important for WordPress security. Source: WPTrainMe.com)

Again, we cannot stress enough how important it is to maintain your WordPress web site regularly backed up and updated. WP site maintenance is not hard or time-consuming, but it must be done to ensure the security of your website. If you don’t want to learn how to do WP site maintenance yourself, pay a professional 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 perform manual backups, there are a number of WordPress plugins you can use. Learn about a WordPress backup plugin that can automate your site backups here: Backup, Clone & Protect Your WP Website With Backup Creator WP Plugin

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

The brute force attack on WordPress sites was mostly an attempt to compromise website administrator panels by exploiting sites with “admin” as the user name.

For reasons of website security, avoid installing sites with the username admin. This is the first area hackers will test. If your site’s username is admin, change it immediately.

For a tutorial created especially for WordPress users on how to change your admin username, go here: Changing Your WP Admin User Name To A Different User Name

Security Measure #4 – Use Strong Passwords

A “brute force” attack occurs when malicious software continually and 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 simple and effective ways to do this), the “bot” will just continue to attack your site until it eventually gets access.

Weak passwords, therefore, are very easy targets for botnets. Make sure that you change your password combination to something containing at least 8 characters long, with both upper and lowercase letters, and add a few “special” characters (^%$#&@*).

Practical Tip

Roboform is a password tool you can use to create different difficult passwords …

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

For a simple step-by-step tutorial created especially for non-technical WordPress admin users on how to change your login password, go here: How To Change Your Password

Security Measure #5 – Secure 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.

WP Config file

(WordPress WP Config file)

If hackers break into your 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 them to change anything in your database, create a user account, upload files and take control of your site.

To protect your WordPress site from being attacked and even being used as part of a bot net, therefore, prevent people getting to 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 WP Installation Files

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

You can remove these files after installation, as they are unnecessary. If you don’t want to delete these files, then just rename them.

Security Measure #7 – Upgrade Your WordPress Blog, Plugins & Themes

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

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

Security Measure #8 – Disable Your WordPress Theme Editor

WordPress comes with a built-in editor that lets the site administrator edit plugin and theme code inside the dashboard.

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

WP Theme Editor Menu

(Accessing the WordPress theme editor via the main menu)

This allows anyone accessing your blog’s admin area to view and modify your theme files, or cause mayhem on your site.

If you want to prevent unauthorized people from accessing 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 – Secure Your WordPress Uploads Directory

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

By default, this folder is visible to anyone online. All someone has to do to see the contents in the “uploads” folder is visit your directory using a web browser …

(WordPress uploads folder)

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

If any directories in your website have vulnerabilities that can be exploited by hackers or malicious users, this can become a serious threat to the security of your site.

Protecting your directories will prevent unauthorized people from viewing 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 named “index.php”) to your uploads directory, and so on. Again, it’s best to ask for assistance from someone who knows what they are doing if you are not sure about what to do.

Security Measure #10 – Install Security Plugins

There are several WordPress security plugins available that will address most security issues WordPress website owners face, such as preventing unauthorized users from accessing your site, protecting your files from malicious scripts, preventing injections of code into files, etc.

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

SecureScanPro - security software for WordPress

(SecureScanPro – WP complete security plugin)

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 look at using is BlogDefender.

Blog Defender Security Plugin For WordPress

Blog Defender(Blog Defender Security Plugin For WordPress)

Blog Defender is a suite 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 installation are …

Blog DefenderAnd then shows you how to fix these quickly and easily …

Blog DefenderIf you don’t want to buy a 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 simple maintenance tasks like updating your WordPress installation, plugins and WP themes, tightening file and data protection and taking other necessary precautions can have disastrous consequences.

Regardless of the kind of business you run or plan to run online and how small you think your web presence is, you cannot ignore the importance of securing your website.

As a final reminder of the importance of website security, below is the advice given by a web 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, WordPress security is very important if you run a WordPress site. Hopefully, the above 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 service provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to be notified via email whenever we publish new tutorials on WordPress security and reviews of WordPress security plugins.

***

"I love the way your email series "Infinite Web Content Creation Training Series" is documented and presented. It is very absorbing and captivating. The links and tutorials are interesting and educational. This has motivated me to rewrite my content following the concepts I am learning from the email series." - Mani Raju, www.fortuneinewaste.com

***

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