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 SecurityWhen you are the world’s leading CMS platform and the online publishing platform of choice used by millions of businesses and loved by thousands of website developers and website designers, it’s inevitable that at some point in time, WordPress will become a prime target for attacks by hackers.

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

These attacks were caused by botnets (computer networks infected with malware and programmed to attack other computers with security vulnerabilities).

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)

There are many methods hackers use to try and break into WordPress sites. One of these is by trying to guess the site admin’s login username and password. This can be achieved using software programs that can guess hundreds of login possibilities in minutes.

If you’re using easy-to-guess login details, your site can be an easy target for hackers.

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)

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

Botnets are normally used used to send out mass spam emails from the infected computers of compromised user accounts.

The screenshot below was 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 world 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. Image source: SecureList.com)

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

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

Being the world's most popular content management system makes WordPress an obvious target for attempted hacker attacks

(Powering millions of websites around the world makes WordPress a target for hacking)

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 choose 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: WordPress Security What Every Blog Owner Needs To Know

Useful Info

It’s important to note that, in the case of the mass brute-force botnet attack described above, no specific WordPress vulnerability was being exploited (the same script was also targeting sites built using other 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 Blog From Brute-Force Attacks – 10 Security Checks

Every website or blog with a vulnerability offers some value to hackers. A vulnerable website or blog presents hackers with a platform for DDoS attacks, spreading malware and to engage in information theft.

If a malicious user can discover a software security flaw that allows them to gain remote access of your web site, your web site can then be employed to target other highly-valued web sites.

Additional undesirable effects of having your website hacked and your site security compromised include getting blacklisted by search engines, having spammy links promoting things like gambling, porn, etc. inserted in your content and meta data, redirecting visitors to phishing sites, drive-by downloads (adding malicious scripts on your visitors’ computers), and many other nasties.

The harsh reality is that brute-force software bots are most likely looking for security weaknesses and trying to break into your website right now. Whether they will get into your site depends on how difficult or easy you have made it for hackers or botnets to continue trying until they either can find a way to get in, or decide to look for a less secure 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 …

WP Security Check(Hackertarget – WP Security Check Image source: Hackertarget.com)

You will see that the scan will yield a number of results and information about your website …

Hackertarget - Website Security Scan

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

It should be obvious after using the scanning tool that if you can see all of this information about your WordPress site, so can hackers.

WP Security Check(Source: BlogDefender.com)

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 can be valuable information to hackers, as this informs them about any exploitable holes or weaknesses, especially where the owners haven’t updated their files.

If your site or blog is powered by WordPress and you are not proactive steps to bolster the security of your site, we can practically guarantee that, at some point in time, someone will attempt to hack your website, because these brute force attacks are systematically hitting WordPress installations all the world!

Whenever a site is compromised, webmasters can discover much to their dismay that they have been “locked out” of their own site, or notice that their files have been modified or even that their content has been completely wiped out. Typically, compromised sites will become infected with malicious scripts without the owner even being aware of it.

To help avoid the heartache and aggravation (and significant financial loss) of discovering that your website has been hacked into, we have listed below ten essential and effective security checks that will help to prevent your WordPress site from being brute-force attacked.

Note

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

***

Security Measure #1 – Get In Touch With Your Webhosting Service

Get in touch with your web host and ask them what security systems have been put into place to help prevent your site from being attacked, and what is done to make sure that your WordPress sites get backed up.

Check that your hosting service provider regularly backs up your sites and that, if disaster strikes, you can easily get your files back.

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

You should never rely just on your webhosting provider for your site backups. Instead, learn how to manage your WordPress site or get this service done for you and maintain a habit of religiously performing a complete site maintenance routine frequently (e.g. daily, weekly, monthly, etc …)

A full WordPress maintenance routine ensures that:

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

A proper WordPress maintenance routine looks like this …

Maintaining your WordPress site frequently backed up and up-to-date is vitally important for WordPress security.(Maintaining your WP site regularly backed up and up-to-date is vitally important for WordPress security. Image source: WPTrainMe.com)

Again, we cannot stress enough how vitally important maintaining your WordPress website or blog completely 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 do not want to learn how to do WordPress maintenance yourself, pay a professional to do it but make sure it gets done. Backing up your site is the second 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 backup process here: Backup, Clone And Protect Your WP Sites With Backup Creator Plugin For WP

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

The mass brute-force attack on WordPress sites was mostly an attempt to compromise website administrator panels by exploiting WP installations with “admin” as their username.

For reasons of website security, avoid installing a WordPress site with the username admin. This is the first area of potential vulnerability hackers will test. If your blog’s username is admin, then change it immediately.

For a simple tutorial on how to change your username, go here: Changing Your WP Admin User Name To A More Secure Username

Security Measure #4 – Make Sure Your Password Is Strong

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

Unless some measure is put into place to prevent the brute-force attack (see further below for a couple of simple and effective suggestions for doing this), the “bot” will just continue to attack your site until it eventually gets access.

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

Tip

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

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

We have created a simple tutorial created especially for WP admin users on how to change your admin password here: What To Do If You Need To Change Your Password

Security Measure #5 – Prevent Access To Your wp-config.php File

The wp-config.php file contains information about your website’s database and is used to define advanced options for WordPress.

wp-config.php

(wp-config.php)

If hackers break into your website, they will normally 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 a hacker 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 being attacked and even being used as part of a bot net, therefore, you must prevent people from being able to easily view 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 Installation Files

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

You can remove these files after installation, as they are unnecessary. If you don’t want to remove these files, then just rename them.

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

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

Make sure to keep your files, plugins, themes, etc. up-to-date.

Security Measure #8 – Disable The Theme Editor

WordPress installations come with a built-in editor feature that lets the administrator edit plugin and theme files from the dashboard area.

In WordPress, you can access your WordPress Theme Editor by selecting Appearance > Editor in your dashboard menu …

WP Theme Editor Menu

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

The WordPress theme editor lets anyone accessing your site view and modify your theme template files, and cause havoc on your site.

To prevent unauthorized people from accessing 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 Your Site’s Uploads Folder

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

By default, this folder is visible to online users. All a person needs to do to see all of the contents in the “uploads” directory is visit the directory using their browser …

(WordPress uploads folder)

(WordPress has an uploads directory where all of your media files are stored)

If any directories in your website have vulnerabilities that can be exploited by hackers or malicious users, this could become a serious threat to the security of your website.

Protecting your directories will prevent unauthorized people from accessing 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 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 – WordPress Security Plugins

Some great WordPress security plugins are available that specifically address most security issues WordPress site owners face, such as preventing unauthorized users from gaining access to vital information about 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 plugin that seems to do a comprehensive job of scanning, fixing and preventing issues that could lead to hackers accessing your website files and causing irreparable damage to your site is SecureScanPro.

SecureScanPro - WordPress total security software solution

(SecureScanPro – WP complete security software)

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

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

Blog Defender Security Solution

Blog Defender Security Product Suite For WordPress(Blog Defender)

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

BlogDefender shows you where potential security weaknesses in your WordPress site are …

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

Blog Defender Security Product SuiteIf you don’t want to invest in a security plugin like SecureScanPro or BlogDefender, then use various free WordPress plugins, such as Limit Login Attempts

Limit Login Attempts - WordPress Security Plugin

WordPress is a very secure web platform, but neglecting basic maintenance tasks like updating your WordPress software, WP plugins and WP themes, tightening file and data protection and taking other necessary precautions can have disastrous consequences.

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

As one last reminder of the importance of website security, below is the advice given by an expert on website security to all WordPress users after the large-scale brute-force attacks 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 information has provided you with the initial steps you need to take to keep your WordPress site protected from brute-force attacks. If you need any further help or assistance with WordPress security, please seek help from a professional WordPress security specialist, or search for a WordPress service provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to receive notifications via email when we publish new articles and tutorials on WordPress security and tutorials about new security plugins.

***

"I have used the tutorials to teach all of my clients and it has probably never been so easy for everyone to learn WordPress ... Now I don't need to buy all these very expensive video courses that often don't deliver what they promise." - Stefan Wendt, Internet Marketing Success Group

***

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