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, due to its popularity.

In April 2013, WordPress installations around the world were subjected to a global-scale brute-force attack.

These attacks were caused by networks of infected computers programmed to attack other computers (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 use to try and break into a WordPress site is by trying to guess the site admin’s login username and password. To do this, hackers use scripts and tools that automatically tries to guess hundreds of login combinations in minutes.

If you’re using weak user names and passwords that are easy to guess, your site can be easily hacked by persistent attempts to work out 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)

”Botnets” are networks of computers that have been infected with malicious code, which are then controlled remotely as a group, often without the unsuspecting computer owners’ knowledge.

Botnets are often used to send out mass spam emails.

The screenshot below was 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 globe since 2009 …

ZeuS is 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 globe since 2009. Image: SecureList.com)

These botnet attacks on WordPress were highly distributed and well organized. 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 user admin areas occurred. The brute force attacks continued after this, with over 30,000 WordPress blogs being hacked every day.

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

WordPress often comes under attack by hackers, due to its popularity

(WordPress powers millions of sites around the world, which makes it a target for attempted attacks by malicious users)

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 use WordPress if you are concerned about website security.

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

Info

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

Mike Little, one of the co-founders of WordPress, 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 Brute-Force Attacks – Ten Security Points

Every web site with a vulnerability has some degree of potential value to hackers. A vulnerable site not only offers hackers opportunities to improve their skills and win “respect” amongst their peers, but it can also serve as a valuable platform for launching distributed attacks, spreading malware and engaging in information theft.

If a hacker can discover a weakness in the security, the website can then be employed to target larger and more valued websites.

Additional undesirable impacts of having your website hacked include being blacklisted by Google, having stealthy spam links promoting things like gambling, cheap offers on brand names, etc. inserted into your content, redirecting visitors to phishing sites, data exfiltration (stealing customer details or Personal Identifiable Information from your web applications), and many other nasty things.

The reality is that malicious bots are very likely searching for security weaknesses and trying to break into your website or blog at this very moment. Whether they will get in successfully depends on how challenging you have made things for them to keep persisting until they can discover a way to get access, or are forced to give up and decide to look for an easier target.

How Much Information About Your WordPress 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 check …

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

You will see that the check returns a number of results and details about your website …

WordPress Security Scan

(Hackertarget – website security check results. Screenshot image: Hackertarget.com)

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

Hackertarget - WP Security Scan(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 on your server are all valuable information to hackers, as this informs them about any potential holes or weaknesses, especially where the owners haven’t updated their sites.

If your site or blog is driven by WordPress and you are not precautionary steps to harden your site, it’s practically guaranteed that, at some point in time, your site will be hacked, or at least targeted by bots, because these attacks are systematically hitting WordPress installations all the world!

Typically, when a site gets compromised, webmasters can find themselves completely “locked out” of their own site, or notice that their files have been vandalized or even that their content has been entirely wiped out. Often, most sites will be infected with malicious scripts without the owner even being aware that this has taken place.

To help avoid the heartache and aggravation (and significant loss of valuable business data) of having your website or blog being hacked into, below are ten essential and effective security measures that will help to protect your WordPress site from being brute force attacked.

Warning

Note: A few of the steps below require some technical understanding of how to modify core WordPress or server files. If you are not technical, or don’t want to mess around with code on your site, then ask your web host or search for a WordPress service provider in our WordPress Services Directory.

***

Security Measure #1 – Get In Touch With Your Webhosting Provider

Get in touch with your host and ask them exactly what security measures have been put in place to help prevent your site from botnet attacks, and what they do to make sure that your WordPress sites get regularly backed up.

Check that your hosting service is backing up your server files and that, if anything should happen, you can easily get your files and data back.

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

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

A complete WordPress maintenance routine ensures that:

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

A proper WP site maintenance routine looks like this …

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

Again, we cannot stress enough how important it is to maintain your WP site fully backed up and up-to-date. WP site maintenance is not hard 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 WP site maintenance yourself, get someone else to do it but make sure this gets done. Backing up your site 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 many WordPress plugins you can use. You can read about a WordPress backup plugin that can automate your site backups here: Back Up, Duplicate And Protect Your WordPress Web Sites With Backup Creator Plugin For WP

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

The brute force attack on WordPress is mostly attempting to compromise website administrator panels and gain access to sites by exploiting installations that used “admin” as their username.

For security purposes, don’t set up WordPress sites with the username “admin”. This is the first area of potential vulnerability hackers will test. If your blog’s user name is “admin”, change this immediately.

We have created a simple step-by-step tutorial that shows you how to change your admin username here: How To Change Your WP User Name From Admin To Another User Name

Security Measure #4 – Your Password

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

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

Weak passwords, therefore, are very easy targets for brute force attacks. Make sure that you change your password to a string that is at least 8 characters long, and that includes upper and lowercase letters, and add a few “special” characters (e.g. %, #, @, etc).

Useful Tip

You can use a password management tool like Roboform to create unbreakable passwords …

Roboform is a password management program you can use to create really secure passwords(You can use a password management software tool like Roboform to generate hard-to-crack passwords)

We have created a simple tutorial on how to change your admin password here: How To Reset Your WordPress Password

Security Measure #5 – Protect 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 options for WordPress.

WP Config file

(wp-config.php)

If a hacker breaks into your WordPress site, they will typically search 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 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 – 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, then just rename them.

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

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

Make sure to always keep all of your software files, themes, plugins, etc. up-to-date.

Security Measure #8 – Disable Your WordPress Theme Editor

WordPress comes with a built-in editor that lets site administrators edit plugin and theme files from 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 is accessible via the dashboard menu)

The WordPress theme editor lets anyone accessing your blog’s admin area view and modify your WordPress files, and cause havoc on your site.

To prevent 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 – Protect The WordPress Uploads Directory

The WordPress “uploads” directory stores all the media that gets uploaded to your blog.

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

(WordPress uploads folder)

(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 hackers or malicious users, this could 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 file with nothing in it named “index.php”) to your uploads directory, and so on. Again, it’s best to ask help from someone who knows what they are doing if you are unsure about what to do.

Security Measure #10 – Use Security Plugins

Several WordPress security plugins are available that specifically address many common security issues faced by WordPress site owners, such as preventing unauthorized users from accessing your site, protecting your website 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 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 - complete security software for WordPress

(SecureScanPro – security software for WordPress)

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 For WordPress

Blog Defender(Blog Defender)

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

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

Blog Defender Security PluginAnd lets you quickly fix these …

Blog Defender WordPress Security SuiteIf you don’t want to invest in 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 platform, but neglecting essential maintenance tasks like ensuring that your WordPress core files, plugins and themes are kept up-to-date, tightening file and data protection and taking other necessary precautions can expose your website to malicious by hackers and bots.

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

As a final reminder, below is the advice given by an expert on web security to all WordPress users following 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, website security is of the utmost importance if you run a WordPress site. Hopefully, this information has given you the initial steps you need to take to prevent brute force attacks on your WordPress site. 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 reviews of new security plugins and solutions.

***

"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)

***