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 SecurityWordPress is the world’s most popular CMS making it an easy target for hacker attacks.

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

These attacks were caused by botnets (infected computer networks programmed to attack other vulnerable sites).

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 will attempt to break into WordPress sites is by trying to guess the site’s administration login username and password. This can be done using software tools that can guess hundreds of login combinations in minutes.

If you’re using predictable user names and passwords, your site 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.org)

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

Botnets are normally used 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 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.

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

The ongoing botnet attacks on WordPress sites were highly distributed and well organized. Over 90,000 IP addresses were identified by a number of webhosting companies in the initial attack, when the web was flooded with millions of attempts to force their way into WordPress user administration areas. The mass brute force attacks then continued, with over 30,000 WordPress sites being hacked per day.

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

Powering millions of websites worldwide makes WordPress a target for hacking

(WordPress often comes under attack by hackers)

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

No. In fact, there are many very good reasons why you should use WordPress if you are concerned at all about the security of your online business.

We explain what makes WordPress a very secure platform for websites in this article: Are Open Source Web Platforms Like WordPress Secure?

Info

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

Mike Little, the co-founder of WordPress with Matt Mullenweg, 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)

Preventing Your WordPress Website From Brute-Force Attacks – Ten Security Checks

Every website with a vulnerability provides an opportunity to hackers. A compromised website not only offers new hackers opportunities to improve their skills and claim “bragging rights” among their peers, but it can also serve as a platform for launching distributed denial of service (DDoS) attacks, spreading malware and defrauding online users through information theft.

If hackers can exploit a security weakness in your system that lets them take over your web site, the site can then be used as a “bot” to attack other valuable sites.

Additional undesirable results of having your site hacked include being blacklisted by search engines, having spammy links promoting things like gambling, discounted fashion, etc. inserted in your content and meta data, malicious redirects to phishing sites or other websites, drive-by downloads (adding malicious programs on your visitors’ computers), and many other nasties.

The truth is that hackers are looking for weaknesses and trying to hack into your site at this very moment. Whether they can get in successfully depends on how difficult or easy you will make it for hackers or botnets to continue persisting until they either discover how to get access, or are forced to decide to look for a less secure target.

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

If you visit Hackertarget.com and run your site through their WordPress security scan …

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

You will see that the test returns various results and information about your WordPress installation …

Website Security Check

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

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

Website Security Scan(Screenshot image: BlogDefender website)

The ability 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 potentially valuable information to hackers, as this informs them about any potential security weaknesses, especially where site owners haven’t updated their sites.

If your site or blog runs on WordPress and you’re 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 targeting WordPress installations around the world!

Typically, when a website gets broken into, blog owners will discover much to their dismay that they have been “locked out” of their own site, or notice that their files have been altered or even that their content has been completely wiped out. Often, most compromised sites will be infected with malicious software without the owner’s knowledge or awareness.

To help avoid the heartache that comes with discovering that your site has been hacked into, we have listed below ten simple, yet essential and effective security measures that will help to prevent your WordPress site from being attacked by brute-force hackers.

Disclaimer

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

***

Security Measure #1 – Contact Your Host

Get in touch with your hosting provider and ask them what security systems have been put into place to help prevent your site from being attacked, and what is done to ensure that your site files get regularly backed up.

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

Security Measure #2 – Perform Complete WordPress Backups And Keep Your Site Frequently Updated

Never rely on your host for your site backups. Instead, learn how to maintain your WordPress site or pay someone to get this service done for you and develop a habit of performing a full WordPress site maintenance routine frequently (e.g. weekly, fortnightly, etc …)

A complete WordPress maintenance routine ensures that:

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

A complete WP site maintenance routine looks like this …

Maintaining your WP website or blog backed up and up-to-date is vitally important for WordPress security.(Maintaining your WordPress installation 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 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. If you do not want to learn how to do WP 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. Learn about a WordPress backup plugin that can automate your backup process here: Back Up, Copy And Protect Your WordPress Web Sites With Backup Creator WP Plugin

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

the worldwide brute force attack on WordPress sites was mostly an attempt to compromise website admin panels and gain access to the site by exploiting installations using “admin” as the username.

For website security reasons, never install WordPress sites with the username “admin”. This is the first area hackers will test. If your blog’s user name is “admin”, you need to change it immediately.

We have created a tutorial for admin users that shows you how to change your WordPress username here: Changing Your WordPress Username From Admin To Another Username

Security Measure #4 – Avoid Weak Passwords

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

Unless some measure is put into place to stop 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, become really easy targets for hacking attacks. Make sure that you change your password to a string containing at least 8 characters long, and that includes upper and lowercase letters, combined with a few “special” characters (e.g. ^, $, @, etc).

Practical Tip

Roboform is a password management program you can use to create very secure passwords …

Roboform is a password program you can use to help you generate different secure passwords(Roboform is a password management tool that lets you generate different passwords)

For a step-by-step tutorial on how to change your WordPress admin password, go here: Changing Your Password

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

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.php file

(WordPress WP Config file)

If a hacker breaks into your site, they will 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 someone 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 your wp-config.php file from being accessible. 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 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. If you don’t want to remove these files, just rename them.

Security Measure #7 – Keep Your WordPress Blog, Themes & Plugins Up-To-Date

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

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

Security Measure #8 – Disable Your Theme Editor

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

You can access your WordPress Theme Editor by selecting Appearance > Editor from the dashboard menu …

WP Theme Editor Menu

(The WordPress theme editor is accessible using the WP main menu)

The WordPress theme feature lets anyone accessing your blog’s admin view and change your theme templates, and create havoc on your site.

If you want 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 – Remove Access To Your Site’s Uploads Folder

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

Normally, this folder is visible to all users online. All a person needs to do to view the contents stored in your site’s “uploads” directory is visit the directory using a web browser …

(WordPress uploads directory)

(WordPress has an uploads directory where media content is stored)

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

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 an empty file 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 not sure about what to do.

Security Measure #10 – Install WordPress Security Plugins

There are several WordPress security plugins available that will address common security issues WordPress website owners face, such as preventing unauthorized users from gaining access to vital information about your site, protecting your files from malicious exploits, preventing unauthorized file uploads, 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 potential issues that could lead to hackers accessing your site files and causing damage to your site is SecureScanPro.

SecureScanPro - WP complete security software

(SecureScanPro – total security software for WordPress)

SecureScanPro is easy to install and easy to use, and does a great job of fixing most of the security issues that WordPress users need to address.

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

Blog Defender Security Suite

Blog Defender Security Product Suite(Blog Defender)

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

BlogDefender scans you web site for potential security vulnerabilities …

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

Blog Defender Security Solution For WordPress BlogsIf you don’t want to purchase 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 secure web platform, but neglecting simple maintenance tasks like keeping your WordPress core files, WP plugins and themes up-to-date, tightening file and data security 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 website is something you cannot ignore.

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 large-scale brute force attacks by botnets on WordPress in 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 very important if you run a WordPress site. Hopefully, this article has provided you with the initial guidelines and direction you need to 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 professional WordPress service provider in our WordPress Services Directory.

Also, please remember to subscribe to WPCompendium.org to receive notifications via email when we publish new information on WordPress security and reviews of WordPress security plugins and solutions.

***

"This is AMAZING! I had learnt about how to use WordPress previously, but this covers absolutely everything and more!! Incredible value! Thank you!" - Monique, Warrior Forum

***