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 SecurityWhen you are the world’s leading content management system and the preferred online publishing platform used by millions of websites and loved by thousands of website developers and web designers, it’s inevitable that at some point in time, WordPress will come under attack by hackers.

In 2013 a large-scale brute-force attack struck WordPress installations across almost every web host in existence around the world.

These attacks were caused by networks of infected computers programmed to attack other sites, also commonly known as “botnets”.

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

What Is A Brute-Force Attack?

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 admin’s login username and password. This is done using software tools that can guess hundreds of possible logins in minutes.

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

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

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

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 ZeuS – a botnet that 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 globe since 2009.

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

These were highly distributed and well organized attacks on WordPress sites. Over 90,000 IP addresses were identified by a number of 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 worldwide brute-force attacks continued after this, with over 30,000 WordPress blogs being hacked every day.

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

WordPress powers millions of websites around the world, which makes it an obvious target for hacking attacks

(Being the world’s most popular content management system makes WordPress a target for hacking attempts)

Does This Mean We Shouldn’t Use WordPress Anymore?

No. In fact, there are lots of very good reasons why you should choose WordPress if you are concerned about the security of your website.

We explain what makes WordPress a very secure platform for websites in this article: Are Open Source Web Platforms Like WordPress Secure? What Every Blog Owner Needs To Know About WordPress

Important Info

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

Mike Little, one of the co-founders of WordPress, made this comment 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 Site From Being Brute-Force Attacked – Ten Security Points

Every website with a security vulnerability offers some value to hackers. An unsecured web site offers malicious users with a resource for stealth attacks, spreading malware and to engage in information theft.

If hackers can discover a weakness in the security system that allows them to control your site, your site can then be used to attack other valuable sites.

Additional undesirable impacts of having your website hacked and your site security compromised include getting blacklisted by search engines, having stealthy spam links advertising things like gambling, discounted fashion, etc. inserted in your content and meta data, malicious redirects to phishing sites, drive-by downloads (adding malicious software on your visitors’ computers), and lots of other nasty things.

The harsh reality is that malicious bots are very likely trying to break into your blog at this very moment. Whether they can be successful will depend on how challenging you have made things for hackers and bots to continue trying until they either can discover how to break in, or decide to look for a more vulnerable target.

How Much Information About Your WordPress 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 - WordPress Security Check(Hackertarget – Website Security Check Screenshot: https://hackertarget.com/wordpress-security-scan)

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

WP Security Scan

(Hackertarget – WP security scan results. Product 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, then so can hackers.

Hackertarget - Website Security Scan(Screenshot image: Blog Defender)

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 in your site can all be useful information to hackers, as this informs them about any potential vulnerabilities, especially where site owners haven’t updated their sites.

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

When a site gets broken into, blog owners can find themselves “locked out” of their own site, or notice that their files have been interfered with or even that their content has been completely wiped out. Often, most sites will become infected with malicious software or viruses without the owner even being aware that a security breach has occurred.

To avoid the heartache and aggravation of having your web site being hacked into, below are ten simple, yet essential and effective security measures that will help to prevent your WordPress site from being brute force attacked.

Note

Note: Some of the recommended measures listed below need some technical understanding of how to modify core WordPress 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 – Contact Your Webhosting Service

Contact your webhosting provider and ask them exactly what systems have been put in place to protect your site from being attacked, and what is done to make sure that your files and data get backed up.

It is important to make sure that your web host is backing up your sites and that, if anything should happen, you can easily get back your site.

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

You should never rely only on your webhosting service provider for site backups. Instead, learn how to manage your WordPress site or get this service done for you and develop a habit of religiously performing a complete site maintenance routine on a regular basis (e.g. daily, weekly, fortnightly, etc …)

A full WordPress maintenance routine ensures that:

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

A full WordPress site maintenance routine looks like this …

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

Again, we cannot stress enough how important maintaining your WordPress web site regularly backed up and updated is. 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 do not want to learn how to do WordPress maintenance yourself, pay a professional to do it but make sure it gets done. Backing up your site is the next most important thing you must do after making sure that your heart is still beating!

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 backup process here: Back Up, Copy And Keep Your WordPress Sites Protected With Backup Creator WordPress Plugin

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

The brute force attack on WordPress sites was mostly attempting to compromise website administrator panels by exploiting installations using “admin” as their user name.

For reasons of website security, avoid setting up WordPress sites with the username admin. This is the first thing hackers will test. If your blog’s user name is admin, change this immediately.

For a tutorial on how to change your login username, go here: How To Change Your Admin User Name In WordPress

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 characters that will give them entry to 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 ways to do this), the “bot” will just persist in attacking your site until it eventually works out the combination.

Passwords that are easy to guess, therefore, make very easy targets for botnets. Make sure that you change your password combination to a string that is at least eight or nine characters long, with both upper and lowercase letters, and add a few “special” characters (^%$#&@*).

Tip

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

You can use a password tool like Roboform to create unbreakable passwords(You can use a password software tool like Roboform to generate really secure passwords)

We have created a step-by-step tutorial that shows you how to change your password here: What To Do If You Need To Change Login Passwords In WordPress

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

WordPress WP Config file

(wp-config.php file)

If a hacker breaks into your WordPress site, they will normally look for the 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.

To protect your WordPress site from being attacked and even being used as part of a bot net, therefore, prevent people finding 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 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 remove these files, then just rename them.

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

Hackers search for vulnerabilities they can exploit in outdated versions of WordPress, including out-of-date versions of WP themes and plugins.

Ensure that all of your software 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 allows the site administrator to edit plugin and theme files inside the dashboard area.

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

WP Theme Editor Menu

(The WordPress theme editor can be accessed using the WP dashboard menu)

The WordPress theme feature lets anyone accessing your site view and edit your theme templates, or create havoc 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 – Prevent Access To The Site’s Uploads Folder

The “uploads” folder contains all the media that gets 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” folder is visit your directory using their browser …

(WordPress uploads directory)

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

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by malicious users, 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 a blank file named “index.php”) to your uploads directory, and so on. Again, it’s best to get professional help if you are not sure about what to do.

Security Measure #10 – Use WordPress Security Plugins

Some great WordPress security plugins are available that will address common security issues WordPress website owners face, such as preventing unauthorized users from accessing your site, protecting your website 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 does a comprehensive job of scanning, fixing and preventing potential issues that could lead to hackers accessing your files and causing damage to your site is SecureScanPro.

SecureScanPro - security software solution for WordPress

(SecureScanPro – complete security software solution for WordPress)

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

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

Blog Defender

Blog Defender WordPress Security Suite(Blog Defender WordPress Security Suite)

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

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

Blog Defender WordPress Security SuiteAnd then shows you how to fix these quickly, easily and inexpensively …

Blog DefenderIf you don’t want to purchase 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 very secure platform, but neglecting essential maintenance tasks like ensuring that your WP core files, plugins and WP themes are kept up-to-date, tightening file and data security and taking other necessary precautions can expose your site to attacks 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, website security is something you cannot afford to ignore.

As a final reminder of the importance of website security, below is the advice given by a security expert to all WordPress users following the large-scale 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, the information in this article has shown you what to do to keep your WordPress site protected from brute force attacks. If you need any further help or assistance with WordPress security, please consult a professional WordPress security specialist, or search for a WordPress technical provider in our WordPress Services Directory.

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

***

"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

***