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 web developers and website designers, it’s inevitable that at some point in time, WordPress will come under attack by hackers wanting to score a “big win”.

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

These attacks were caused by infected computer networks programmed to attack other sites (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 WordPress sites is by trying to guess the site admin’s login username and password. This is done using scripts and software tools that can work through hundreds of login permutations in minutes.

If you’re using weak login details, your website can be an easy target for hacking attempts.

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)

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

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

Below is a screenshot taken from an online security monitoring site showing the locations of the command centers of a botnet that has been actively compromising computer networks all around the globe since 2009 called “Zeus” …

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

These were well organized and highly distributed botnet 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 site administration areas occurred. The mass attacks then continued, with over 30,000 WordPress sites and blogs being hacked every day.

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

WordPress is often the target of attacks by hackers, due to its global popularity

(WordPress is the world’s most used CMS making it a natural target for hacking attacks)

Does This Mean We Should Stop Using WordPress?

No. In fact, there are many good reasons why you should choose WordPress if you are concerned about the security of your web presence.

We explain what makes WordPress a very secure web platform in this article: Is WordPress Secure?

Important Info

It’s important to note that, in the case of the mass brute-force botnet attack described above, there was actually 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 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 Website From Brute Force Attacks – 10 Security Measures

You may think that your website is of little value to hackers, but the reality is that to a hacker, all websites provide an opportunity to gain some benefit at your expense.

If someone can discover a software vulnerability in your security and gain control of your blog, your website or blog can then be used to attack other highly-valued web sites.

Additional undesirable impacts of having your site hacked and your site security compromised include getting blacklisted by search engines, having stealthy spam links advertising things like casinos, discounted fashion, etc. inserted in your content and page title and descriptions, redirecting visitors to phishing sites, drive-by downloads (adding malware on your visitors’ computers), and lots of other nasties.

The harsh reality is that hackers are most likely trying to hack into your website or blog while you are reading this article at this very moment. Whether they can hack in successfully or not, will depend on how hard you have made things for hackers and bots to continue trying until they can either find how to get access, or are forced to give up and decide to look for an easier target.

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

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

WP Security Scan(WP Security Check Product image: Hackertarget.com)

You will see that the check returns various results and information about your website …

Hackertarget - WordPress Security Check

(WordPress security scan results. Source: Hackertarget.com)

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

Hackertarget - WP Security Check(Product image: Blog Defender)

The ability to see which 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 all be useful information to hackers, as this informs them about potentially exploitable security weaknesses, especially in older versions.

If your website runs on WordPress and you’re not preventive steps to bullet-proof your site, then it’s practically guaranteed that, at some point, someone will attempt to hack your installation, because these attacks are systematically targeting WordPress installations around the world!

Whenever a site is hacked, blog owners 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 completely wiped out. Typically, most sites will be infected with malicious software or viruses without the owner’s knowledge or awareness.

To avoid the heartache and aggravation of discovering that your web site has been hacked into, below are 10 simple, yet essential and effective security measures that will help to protect your WordPress site from being attacked by brute-force botnet hacking attempts.

Warning

Note: Some of the steps shown below need some technical understanding of how to modify core WordPress and 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 service provider for help.

***

Security Measure #1 – Contact Your Hosting Service Provider

Get in touch with your webhosting provider and ask them exactly what security systems are in place to protect your site from being attacked, and what is done to ensure that your WordPress sites are being backed up.

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

Security Measure #2 – Perform Full WordPress Backups And Keep Your Website Frequently Maintained

You should 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 done for you and maintain a habit of religiously performing a complete site maintenance routine on a regular basis (e.g. weekly, monthly, etc …)

A full WordPress maintenance routine ensures that:

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

A full WP site maintenance routine looks like this …

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

Again, we cannot stress enough how important maintaining your WordPress web site fully backed up and up-to-date is. 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 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 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 back up your site manually, there are many free and paid plugins you can use. Learn about a WordPress backup plugin that can fully automate your backup process here: Back Up, Duplicate & Keep Your WP Sites Protected With Backup Creator Plugin For WP

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

the worldwide brute-force attack on WordPress is mostly attempting to compromise website administrator panels by exploiting WordPress installations that used “admin” as the user name.

For reasons of website security, avoid setting up a WordPress site with the username “admin”. This is the first thing hackers will test. If your blog’s username is admin, then change this immediately.

For a tutorial on how to change your username, go here: Changing Your WordPress Admin Username

Security Measure #4 – Use A Strong Password

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

Unless some measure is put into place to prevent the brute-force attack (see further below for a couple of effective suggestions for doing this), the “bot” will just persist in 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 containing at least eight or nine characters long, with upper and lowercase letters, combined with a few “special” characters (e.g. ^, $, *, etc).

Useful Tip

Roboform is a password software that lets you generate really secure passwords …

You can use a password program like Roboform to create difficult passwords(Roboform is a password management program you can use to help you generate really secure passwords)

We have created a simple tutorial that shows you how to change your password here: Changing Your Password

Security Measure #5 – Prevent The wp-config.php File From Being Easily Accessed

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

(wp-config.php file)

If a hacker breaks into your site, they will typically try to access your wp-config.php file, because this file contains your 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.

To protect your WordPress site from being attacked and even being used as part of a bot net, therefore, you must prevent people from accessing 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 Blog 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 – Update Your WordPress Files, Plugins And Themes To Their Latest Version

Hackers search for vulnerabilities in older versions of WordPress that can be exploited, including out-of-date versions of WP plugins and themes.

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

Security Measure #8 – Disable The WordPress Theme Editor

WordPress installations come with a built-in editor feature that allows you to edit theme and plugin code inside the dashboard.

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

WP Theme Editor Menu

(Accessing the WordPress theme editor using the admin menu)

The WordPress theme feature lets anyone accessing your blog’s admin view and modify your 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 editing your wp-config.php file.

Security Measure #9 – Secure Your WordPress Uploads Folder

The WordPress “uploads” directory stores all the media files that get uploaded to your website.

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

(WordPress uploads directory)

(WordPress uploads folder)

If any directories in your website have vulnerabilities that can be exploited by hackers or malicious users, this can seriously threaten the security of your site.

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, adding 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 seek professional help if you are not sure about what to do.

Security Measure #10 – Use Security Plugins

There are some great security plugins for WordPress available that specifically address many common security issues faced by WordPress website owners, such as preventing unauthorized users from accessing vital areas of your site, protecting your site from botnets, preventing injections of code into files, etc.

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

SecureScanPro - WordPress security plugin

(SecureScanPro – WP complete security software solution)

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 Websites

Blog Defender Security Suite For WordPress(Blog Defender WordPress Security Plugin)

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

BlogDefender scans you website for potential security weaknesses …

Blog Defender Security Product Suite For WordPress SitesAnd lets you fix these quickly …

Blog DefenderIf you don’t want to invest in a security plugin like SecureScanPro or BlogDefender, you can use various free WP plugins, such as Limit Login Attempts

Limit Login Attempts - WordPress Security Plugin

WordPress is a very secure web platform, but neglecting simple maintenance tasks like keeping your WordPress core files, plugins and themes 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 type of business you run or plan to run online and how small you think your web presence is, you simply cannot ignore the importance of website security.

As one last reminder, below is the advice given by an expert on web security to all WordPress users after 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, WordPress 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 service provider in our WordPress Services Directory.

Also, remember subscribe to WPCompendium.org to be notified via email when we publish new tips on WordPress security and reviews of new security plugins.

***

"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

***