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 used content management system making it a frequent target for hacker attacks.

In April 2013 a mass brute-force attack struck WordPress installations across virtually every WP host server in existence.

These attacks were caused by botnets (networks of infected computers programmed to attack other vulnerable installations).

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 use to try and break into WordPress sites is by trying to guess the site admin’s login username and password. This is done with scripts and software tools that can work through hundreds of login combinations in minutes.

If you’re using predictable usernames and weak passwords that are easy to guess, your website can be an easy target for hacking attempts.

This is called a “brute-force” login attack.

Botnet – What Is This?

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 code or software, which can then be controlled remotely as a group, often without the computer owners’ knowledge.

Botnets are often used to blast mass spam emails.

The screenshot below was taken from a site that monitors online security showing the locations of the command centers of a botnet that has been actively compromising computer networks all around the world since 2009 called “Zeus” …

The Zeus botnet has been actively compromising computer networks all around the globe since 2009.

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

These were highly distributed and well organized attacks. Over 90,000 IP addresses were identified by a number of webhosting companies in the initial attack alone, when millions of attempts to force their way into WordPress user administration areas occurred. The large-scale attacks continued after this, with over 30,000 WordPress sites and blogs being hacked per day.

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

WordPress powers millions of sites around the world, which makes it a frequent target for attempted hacker attacks

(WordPress often is targeted by hackers, due to its popularity)

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

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

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

Info

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

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

You may think that your site has no significant value to hackers, but the reality is that to a hacker, every website provides an opportunity to profit or benefit at your expense.

If hackers can discover a way to compromise the control of your web site, the website can then be used as a “bot” to attack larger and more valuable websites.

Additional undesirable effects of being hacked include getting blacklisted by search engines, having stealthy spam links promoting things like viagra, cheap offers on brand names, etc. inserted in your content and page title and descriptions, redirecting visitors to phishing sites and other websites, data exfiltration (stealing information or Personal Identifiable Information from your web applications), and lots of other nasties.

The truth is that brute-force software bots are probably trying to hack into your blog at this very moment. Whether they will successfully break in depends on how difficult or easy you have made things for hackers and botnets to continue trying until they can work out how to get in, or decide to look for a less protected target.

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

Do you own a WordPress site? If so, visit a site like Hackertarget.com and run your site through their WordPress security check …

Hackertarget - Website Security Check(Hackertarget – WordPress Security Check Screenshot: Hackertarget.com)

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

WP Security Check

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

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

Hackertarget - WP Security Scan(Image source: BlogDefender.com)

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 can be potentially useful information to hackers, as this informs them about potentially exploitable security vulnerabilities, especially in older versions.

If your site or blog runs on WordPress and you are not proactive steps to toughen up your site, we can practically guarantee that, at some point in time, someone will attempt to hack your site, because these brute-force attacks are systematically targeting WordPress installations worldwide!

Typically, when a website gets compromised, webmasters will discover much to their dismay that they have been “locked out” of their own site, or notice that their content has been vandalized or even entirely wiped out. Often, compromised sites will become infected with malicious scripts or viruses without the owner even being aware that this has occurred.

To avoid the heartache and aggravation of discovering that your website has been hacked into, we have listed below 10 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 measures below need some technical understanding of how to modify core WordPress and 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 search for a professional WordPress technical provider in our WordPress Services Directory.

***

Security Measure #1 – Get In Touch With Your Hosting Company

Get in touch with your webhosting provider and ask them what precautions they offer to help prevent your site from brute-force attacks, and what they do to make sure that your files and data are regularly being backed up.

Check that your hosting provider is backing up your server files and that, if disaster strikes, you can easily get back your files and data.

Security Measure #2 – Perform Complete WordPress Backups And Keep Your Website Or Blog Frequently Up-To-Date

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

A complete 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 WP software, themes and plugins are up-to-date,
  • etc …

A full WP maintenance routine looks like this …

Maintaining your WP web site completely backed up and updated is vitally important for WordPress security.(Maintaining your WP installation completely backed up and updated is vitally important for WordPress security. Screenshot image: WPTrainMe.com)

Again, we cannot stress enough how important maintaining your WordPress installation frequently backed up and up-to-date is. WP maintenance is not hard to do or time-consuming, but it must be done to ensure the security of your website. If you don’t want to learn how to do WordPress maintenance yourself, pay someone to do it but make sure it gets done. Backing up your site is the second most important thing you should do after making sure that you are still breathing!

If you don’t want to perform manual backups, there are a number of plugins you can use. Learn about a WordPress backup plugin that can automate your backup process here: Back Up, Copy And Keep Your WordPress Websites Protected With Backup Creator WP Plugin

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

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

For reasons of website security, don’t set up sites with the username “admin”. This is the first area of potential vulnerability hackers will test. If your blog’s username is “admin”, you will need to change it immediately.

For a simple step-by-step tutorial that shows you how to change your admin username, go here: Changing Your Admin User Name In WordPress To A Different Username

Security Measure #4 – Avoid Weak Passwords

A “brute force” attack occurs when malicious software continually and persistently tries to guess the right password and username character string that will give them entry to your site.

Unless some measure is put into place to stop the brute-force attack from happening (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 gets access.

Passwords that are easy to guess, therefore, are really easy targets for bot attacks. Make sure that you change your password combination to something containing at least 8 or 9 characters long, with upper and lowercase letters, combined with “special” characters (e.g. ^, #, *, etc).

Practical Tip

You can use a password program like Roboform to create secure login passwords …

You can use a password management tool like Roboform to create hard-to-guess passwords(Roboform is a password management software you can use to help you generate different strong login passwords)

For a detailed step-by-step tutorial on how to change your admin password, go here: What To Do If You Need To Reset Passwords

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

(WordPress WP Config file)

If hackers break into your site, they will look for your wp-config.php file, because this is the file that 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 attacks and even being used as part of a bot net, therefore, prevent people 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 – Delete Or Rename Unnecessary Blog Installation Files

Rename or delete your install.php, upgrade.php and readme.html files.

You can remove these files after installation. If you don’t want to remove these files, just rename them.

Security Measure #7 – Update Your WordPress Blog, Plugins And Themes

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

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

Security Measure #8 – Disable The Theme Editor

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

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

WordPress Theme Editor Menu

(The WordPress theme editor can be accessed via the WordPress admin menu)

This means that anyone logging into your blog can see and edit your WordPress theme files, and cause mayhem on your site.

If you want to prevent unauthorized people from being able to access 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 Folder

The “uploads” directory contains all the media that gets uploaded to your WordPress site.

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

(WordPress uploads directory)

(WordPress uploads directory)

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by malicious users, this can threaten the security of your website.

Protecting your directories will prevent unauthorized people from viewing 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 use a professional if you are unsure about what to do.

Security Measure #10 – WordPress Security Plugins

Several WordPress security plugins are available that will address most security issues WordPress site owners face, such as preventing hackers from gaining access to vital information about your site, protecting your files from malicious exploits, preventing injections of code into files, etc.

Many WordPress plugins address some but not all areas of WordPress security. One WordPress plugin that does a comprehensive job of scanning, fixing and preventing issues that could lead to hackers accessing your website files and damaging your site is SecureScanPro.

SecureScanPro - WordPress security plugin

(SecureScanPro – WP security plugin)

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

Blog Defender(Blog Defender Security Suite For WordPress Sites)

This product 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 DefenderAnd then shows you how to easily fix these …

Blog Defender Security Solution For WordPressIf you don’t want to invest in 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 secure web platform, but neglecting simple maintenance tasks like updating your WordPress installation, plugins and themes, tightening file and data security and taking other necessary precautions can have disastrous consequences.

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 afford to ignore.

As one last reminder of the importance of keeping your websites protected, below is the advice given by a security expert to all WordPress users after the mass 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 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 WordPress security specialist, or search for a WordPress technical provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to be notified via email when we publish new information on WordPress security and reviews of new WordPress security plugins.

***

"Learning WordPress has been a huge stumbling block for me. I've been looking for something that covers absolutely everything but doesn't cost an arm and a leg. Thank you so much ... you have just provided me with what I have been looking for! Truly appreciated!" - Tanya

***

Recommended Video Courses For WordPress Users

WordPress SecurityWordPress Security

Learn how to keep your WordPress site or blog secure and protected from malware, hackers and brute-force attacks.

More info: WordPress Security

Recommended Video Courses For WordPress Users

How To Use cPanelHow To Use cPanel

cPanel is a powerful and simple-to-use web hosting management software application that gives website owners the ability to quickly and easily manage their servers and websites using a simple and intuitive dashboard.

This video course will teach you how to use the main features of cPanel to manage your web hosting.

More info: How To Use cPanel

Recommended Video Courses For WordPress Users

How To Set Up WordPress On LocalhostHow To Set Up WordPress On Localhost

Learn how to install, set up, and locally host a fully functioning WordPress site on your computer.

More info: How To Set Up WordPress On Localhost

Recommended Video Courses For WordPress Users

How To Use Amazon S3How To Use Amazon S3

Learn how to set up and use Amazon S3 to upload, store, manage, and protect your site’s images, large media files, downloadable files, stream videos and more.

More info: How To Use Amazon S3

Recommended Video Courses For WordPress Users

How To Use FTPHow To Use FTP

This video course shows you how to use FTP (File Transfer Protocol) to transfer and upload files between your hard drive and your server using a free FTP program called Filezilla.

More info: How To Use FTP

Recommended Video Courses For WordPress Users

Using Password ManagersUsing Password Managers

Password Managers provide an easy and secure way to keep track of all your passwords. This video course shows you how to use two FREE powerful password management tools.

More info: Using Password Managers

Recommended Video Courses For WordPress Users

How To Back Up & Restore WordPress SitesHow To Back Up & Restore WordPress Sites

Learn how to safely and automatically backup your WordPress files and database and how to easily restore your WordPress site if something were to happen.

More info: How To Back Up & Restore WordPress Sites

Author: Martin Aranovitch

Martin Aranovitch is the founder of WPCompendium.org and the author of The Small Business Digital Manager. WPCompendium.org provides hundreds of FREE tutorials that show you how to use WordPress to grow your business online with no coding skills required! Get our FREE "101+ WordPress Tips, Tricks & Hacks For Non-Techies" e-course with loads of useful WordPress tips!

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