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 powers millions of websites and blogs around the world, making it an obvious target for hacking attacks.

In 2013 a global brute force attack struck WordPress installations across virtually every host server in existence.

These attacks were caused by botnets (computers infected with viruses and programmed to attack other sites).

How To Protect Your WordPress Site From A Brute-Force Attack

About 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 methods hackers use to try and break into a WordPress site. One of these is by trying to guess the site’s administration login username and password. To attempt this, hackers use scripts and tools that automatically tries to guess hundreds of login combinations in minutes.

If you’re using predictable login details, your site could be easily hacked by the script’s persistent attempts to work out your site’s login details.

This is called a “brute-force” login 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)

”Botnets” are networks of private computers that have been infected with malicious code, which are then controlled remotely as a group, typically without the computer owners even being aware of this.

Botnets are regularly used to send out mass spam emails.

Below is a screenshot 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 compromising computer networks all around the globe since 2009.

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

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

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

WordPress is the world's most used content management system which makes it an obvious target for hacking attempts

(WordPress powers millions of sites worldwide, making it a frequent target for hacking)

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 continue using WordPress if you are concerned about the security of your online presence.

To learn why WordPress is a secure web platform, read this article: Is WordPress Secure?

Important Info

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

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

You may think that the information in your website offers no value to hackers, but the reality is that to a hacker, every website is an opportunity to benefit or profit at your expense.

If a hacker can discover a software weakness in your security, your web site can then be used as a “bot” to attack larger and more valuable websites.

Additional undesirable consequences of being hacked and your site security compromised include getting blacklisted by search engines, having spammy links promoting things like gambling, porn, etc. inserted into your content, malicious redirects to phishing sites and other websites, drive-by downloads (adding malicious programs on your visitors’ computers), and lots of other nasty things.

The reality is that malicious bots are very likely trying to break into your web site at this very moment. Whether they will hack in or not, will depend on how difficult you will make things for hackers to keep persisting until they work out how to get access, or give up and decide to look for an easier target.

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

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

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

You will see that the test returns a number of results and information about your site …

Hackertarget - WP Security Check

(website security scan results. Image source: Hackertarget.com)

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

WordPress Security Check(Screenshot image: Blog Defender)

The ability 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 potentially useful information to hackers, as this can inform them about any exploitable security vulnerabilities, especially where site owners haven’t updated their files.

If your site or blog runs on WordPress and you’re not preventive steps to toughen up your site, then 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 all the world!

When a website gets broken into, webmasters can find themselves “locked out” of their own site, or notice that their files have been vandalized or that everything has been entirely wiped out. Typically, most compromised sites will become infected with malicious scripts without the owner even being aware that a breach has taken place.

To avoid the heartache and frustration (and potential financial loss) of having your web site being hacked into, we have listed below ten essential and effective security measures that will help to protect your WordPress site from brute force attacks.

Useful Info

Note: A few of the recommended measures below require some technical understanding of how to modify core WordPress or 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 a professional WordPress service provider for help.

***

Security Measure #1 – Get In Touch With Your Host

Get in touch with your host and ask them exactly what security precautions are in place to help prevent your site from brute force attacks, and what they are doing to make sure that your WordPress sites are being regularly backed up.

It is important to check that your webhosting service provider regularly backs up your server files and that, if anything happens, you can easily recover your files and data.

Security Measure #2 – Back Up Your WordPress Data And Files And Keep Your Website Or Blog Frequently Maintained

You should never rely only on your hosting provider for site backups. Instead, learn how to maintain your WordPress site or pay someone to get this done for you and maintain a habit of religiously performing a full WordPress site maintenance routine frequently (e.g. weekly, fortnightly, etc …)

A proper WordPress maintenance routine ensures that:

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

A full WP site maintenance routine looks like this …

Maintaining your WP website fully backed up and updated is vitally important for WordPress security.(Maintaining your WordPress installation regularly backed up and updated is vitally important for WordPress security. Screenshot: WPTrainMe.com)

Again, we cannot stress enough how vitally important it is to maintain your WP installation completely backed up and updated. WordPress site maintenance is not hard to do 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 maintenance yourself, pay a professional to do it but make sure it gets done. Backing up your website is the next most important thing you must do after making sure that you are still breathing!

If you don’t want to back up your data manually, there are a number of plugins you can use. Learn about a WordPress backup plugin that can fully automate your site backups here: Backup, Copy And Keep Your WordPress Websites Protected With Backup Creator Plugin For WP

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

The mass brute-force attack on WordPress sites was mostly attempting to compromise website admin panels and gain access to the site by exploiting installations that used “admin” as the account name.

For reasons of website security, avoid setting up WordPress sites with the username admin. This is the first area of potential vulnerability hackers will test. If your site’s user name is “admin”, then change this immediately.

For a detailed tutorial that shows you how to change your login username, go here: How To Change Your WP Admin Username To A More Secure Username

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 combination that will unlock your website.

Unless some measure is put into place to prevent the brute force attack from happening (see further below for a couple of simple and effective ways to do this), the “bot” will just persist in attacking your site until it eventually works out the combination.

Weak passwords, therefore, become really easy targets for botnets. Make sure that you change your password to something containing at least eight or nine characters long, and that includes upper and lowercase letters, combined with a few “special” characters (e.g. ^, #, &, etc).

Useful Tip

Roboform is a password tool that lets you easily create very secure passwords …

You can use a password management tool like Roboform to help you generate hard-to-crack passwords(You can use a password management program like Roboform to help you generate strong passwords)

We have created a step-by-step tutorial for non-technical WP admin users on how to change your login password here: What To Do If You Need To Reset Passwords In WordPress

Security Measure #5 – Prevent Your wp-config.php File From Being Easily Found

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

(wp-config.php file)

If hackers break into your site, they will normally search for the wp-config.php file, because this is the file that contains your database information, security keys, etc. Getting access to this information would allow them 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 your wp-config.php file from being easily accessed. 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 WordPress Installation Files

Delete or rename the install.php, upgrade.php and readme.html files from your server.

These files are not required after installation and can be removed. If you don’t want to delete these files, just rename them.

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

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

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

Security Measure #8 – Disable Your Theme Editor

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

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 via the WordPress admin menu)

The WordPress theme feature lets anyone accessing your site’s admin view and edit your files, or create mayhem on your site.

If you want to prevent unauthorized people from being able to access 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 – Protect Your Site’s Uploads Directory

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

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

(WordPress uploads folder)

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

If any directories in your website have weaknesses or vulnerabilities that can be exploited by hackers, anyone 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, adding 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 get professional assistance if you are unsure about what to do.

Security Measure #10 – Install Security Plugins

A number of great security plugins for WordPress are available that will address common security issues faced by WordPress website owners, such as preventing hackers from accessing your site, protecting your files from botnets, 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 irreparable damage to your site is SecureScanPro.

SecureScanPro - security software for WordPress

(SecureScanPro – WordPress security software)

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

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

Blog Defender Security Product Suite

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

Blog Defender is a package of WordPress security video tutorials, WordPress plugins and tools, plus WordPress security documentation in PDF and DOC formats.

BlogDefender scans you web site for security vulnerabilities …

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

Blog Defender WordPress Security PluginIf you don’t want to buy a premium 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 very secure platform, but neglecting essential maintenance tasks like updating your WordPress installation, plugins and WP themes, 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 an expert on web security to all WordPress users after the worldwide 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 of the utmost importance if you run a WordPress site. Hopefully, the information in 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 technical provider in our WordPress Services Directory.

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

***

"I am beyond impressed with what you have put together. I can tell that you put a ton of hard work into building what you have. You have the absolute best content on WordPress I have ever seen!" - Robert T. Jillie

***