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 the world’s most popular content management system which makes it an easy target for malicious attacks by hackers.

In early 2013, WordPress installations around the world were subjected to worldwide brute force attacks.

These attacks were caused by infected computer networks 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)

There are many ways hackers try to break into a WordPress site. One of these is by trying to guess the site’s administration login username and password. This is done with scripts and software that automatically tries to guess hundreds of login permutations in minutes.

If you’re using easy-to-guess usernames and predictable passwords, your site could be an easy target for hackers.

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)

”Botnets” are networks of computers that have been infected with malicious scripts or software, which can then be controlled remotely as a group, typically without the computer owners’ knowledge.

Botnets are typically used to blast out mass spam emails from the infected computers of unsuspecting users.

Below is a screenshot 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 …

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

(The Zeus botnet has been actively infecting computer networks all around the world since 2009. Screenshot image: SecureList.com)

These were well organized and highly distributed botnet attacks on WordPress. Over 90,000 IP addresses were identified by a number of hosting companies in the initial attack alone, when the web was flooded with millions of attempts to force their way into WordPress site admin areas. The large-scale attacks continued after this, with over 30,000 WordPress sites being hacked per day.

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

WordPress is frequently the target of attacks by hackers

(WordPress is frequently the target of worldwide malicious attempts by hackers)

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

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

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

Info

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

Mike Little, the co-founder of WordPress, said this 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)

Protecting Your WordPress Blog From Brute-Force Attacks – Ten Security Measures

Every web site with a security vulnerability provides some type of opportunity to hackers. No website or blog Corporate web sites, personal blogs, government websites … even websites owned by online security and anti-hacking experts can and have been targeted.

If hackers can hack and gain any form of control of your web site, your web site can then be employed as part of a larger network of “bots” to target other highly-valued web sites.

Additional undesirable results of having your site hacked include being blacklisted by search engines, having spammy links advertising things like gambling, porn, etc. inserted into your content and page title and descriptions, redirecting visitors to phishing sites or other websites, drive-by downloads (adding malware on your visitors’ computers), and many other nasty things.

The reality is that software-driven bots are most likely searching for security weaknesses and trying to hack into your site at this very moment. Whether they will be successful or not, depends on how difficult or easy you will make things for hackers to continue persisting until they can either find a way to break in, or 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 website through their WordPress security check …

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

You will see that the test returns various results and details about your website …

Hackertarget - WP Security Scan

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

It should be obvious after using the above tool that if you can freely access all of this information, then hackers can too.

WordPress Security Check(Product image: BlogDefender.com)

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 on your server can all be valuable information to hackers, as this informs them about any security weaknesses, especially in older versions.

If your site or blog is powered by WordPress and you are not taking steps to toughen up your site, it’s practically guaranteed that, at some time in the near future, your site will be hacked, or at least targeted by bots, because these brute force attacks are systematically targeting WordPress installations around the world!

When a website or blog is hacked, webmasters will discover much to their dismay that they have been “locked out” of their own site, or notice that their files have been vandalized or even that their content has been entirely wiped out. Typically, most sites will be infected with malicious software without the owner even being aware of it.

To avoid the heartache and frustration (and potential loss of valuable business data) that comes with having your site being hacked into, below are ten essential and effective security checks that will help to protect your WordPress site from brute-force attacks.

Useful Information

Note: A few of the measures shown below require some technical understanding of how to modify core WordPress and server files. If you have no web skills, or don’t want to mess around with file code, then ask your web host or search for a professional WordPress service provider in our WordPress Services Directory.

***

Security Measure #1 – Contact Your Webhosting Provider

Contact your web host and ask them exactly what measures have been put into place to protect your site from brute-force attacks, and what they are doing to ensure that your site files get regularly backed up.

Check that your webhosting provider backs up your server files and that, if disaster strikes, you can easily get back your files.

Security Measure #2 – Back Up Your WordPress Data And Files And Keep Your Site Frequently Updated

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

A proper WordPress maintenance routine ensures that:

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

A complete WordPress site maintenance routine looks like this …

Maintaining your WP website completely backed up and up-to-date is vitally important for WordPress security.(Maintaining your WP site backed up and updated is vitally important for WordPress security. Image: WPTrainMe.com)

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

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

The large scale brute-force attack on WordPress is mostly an attempt to compromise website administrator panels and gain access to sites by exploiting WP installations with “admin” as the user name.

For reasons of website security, don’t install a WordPress site with the username “admin”. This is the first area of potential vulnerability hackers will test. If your blog’s user name is “admin”, you should change it immediately.

For a tutorial that shows you how to change your WordPress admin username, go here: Changing Your WordPress User Name From Admin To A More Secure User Name

Security Measure #4 – Avoid Weak Passwords

A “brute force” attack occurs when a malicious script persistently tries to guess the right username and password character string that will unlock your website.

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

Weak passwords, therefore, become really easy targets for brute-force attacks. Make sure that you change your password to a string that contains at least 8 characters long, with both upper and lowercase letters, and “special” characters (%^#$@&*).

Tip

If you have trouble coming up with strong passwords or are reluctant to set up different passwords for all your online logins, then use a password tool like Roboform …

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

For a detailed step-by-step tutorial that shows you how to change your login password, go here: What To Do If You Need To Change Your Password

Security Measure #5 – Protect 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 file

(wp-config.php)

If hackers break into your WordPress site, they will normally look for your wp-config.php file, because this file contains important information about your site’s database, 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 from being able to easily access 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 Website Installation Files

Rename or delete 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, then just rename them.

Security Measure #7 – Upgrade Your WordPress Site, Themes And Plugins

Hackers search for vulnerabilities they can exploit in earlier versions of WordPress, including outdated versions of themes and plugins.

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

Security Measure #8 – Disable Your WordPress Theme Editor

WordPress comes with a built-in editor feature that allows site administrators to edit theme and plugin files from the dashboard area.

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

WP Theme Editor Menu

(Accessing the WordPress theme editor via the WordPress main menu)

This means that anyone logging into your site’s admin can view and change your WordPress theme files, or cause mayhem on your site.

To prevent unauthorized people from accessing the 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 WordPress Uploads Directory

The WordPress “uploads” folder contains all the media that gets uploaded to your website.

Normally, this folder is visible to all users online. All someone has to do to view the contents in the “uploads” directory is navigate to your directory using a web browser …

(WordPress uploads folder)

(WordPress uploads folder)

If any directories in your website have weaknesses or vulnerabilities that can be exploited by hackers, someone can 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 a file with nothing in it called “index.php”) to your uploads directory, and so on. Again, it’s best to seek professional help if you are unsure 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 site owners face, 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 does a comprehensive job of scanning, fixing and preventing issues that could lead to hackers accessing your files and causing irreparable damage to your site is SecureScanPro.

SecureScanPro - security software solution for WordPress

(SecureScanPro – WordPress complete security software)

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

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

Blog Defender

Blog Defender(Blog Defender Security Suite)

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

BlogDefender scans you WordPress site for potential security holes …

Blog Defender Security SolutionAnd lets you fix these quickly …

Blog DefenderIf you don’t want to invest in a premium 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 secure web platform, but neglecting essential maintenance tasks like ensuring that your WP core files, WP plugins and themes are kept updated to their latest versions, tightening file and data security and taking other necessary precautions can expose your site to attacks by hackers and bots.

No matter what kind of business you run or plan to run online and how small you think your web presence is, web security is something you cannot ignore.

As one last reminder of the importance of keeping your websites protected, below is the advice given by a website security expert to all WordPress users following the worldwide 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, the information in this article will help 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 WordPress technical provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to receive notifications whenever we publish new information on WordPress security and reviews of new 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

***

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