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 leading content management system in the world and the preferred online publishing platform used by millions of businesses and loved by thousands of web developers and website designers, it’s inevitable that at some point in time, WordPress will become a target for attacks 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 botnets (computer networks infected with viruses and programmed to attack other sites with security vulnerabilities).

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 will attempt to break into WordPress sites is by trying to guess the site’s administration login username and password. This is achieved with scripts and software tools that automatically tries to guess hundreds of login permutations in minutes.

If you’re using weak usernames and predictable passwords, your site can be an easy target for hackers.

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

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

Botnets are regularly used to blast mass spam emails from computers of unsuspecting users.

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

These were highly distributed and well organized botnet attacks on WordPress sites. 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 site administration areas took place. The mass attacks continued after this, with over 30,000 WordPress sites and blogs being hacked per day.

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

WordPress powers millions of websites worldwide, making it a natural target for attempted attacks by hackers

(WordPress is often the target of malicious attacks by hackers)

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

No. In fact, there are lots of good reasons why you should continue using WordPress if you are concerned at all about the security of your web presence.

We explain why WordPress is a secure platform for websites in this article: Why WordPress Is A Secure Platform For Websites –

Info

It’s important to understand that, in the case of April 2013 large-scale brute-force botnet attack described above, no specific WordPress vulnerability was being exploited (the same script was also attacking sites built using other applications like Joomla).

Mike Little, one of the co-founders of WordPress, said this 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)

How To Prevent Your WordPress Site From Brute-Force Attacks – 10 Security Checks

Every blog with a vulnerability can present an opportunity to hackers. All websites have some value to hackers. Large, medium and small sites, personal blogs, government sites … even sites owned by online security and anti-hacking experts can and have been targeted.

If someone can discover a web software flaw, your website can then be used to attack other valuable sites.

Additional undesirable effects of having your site hacked and your site security compromised include being blacklisted by search engines, having stealthy spam links advertising things like gambling, porn, etc. inserted in your content and meta data, redirecting visitors to phishing sites or other websites, data exfiltration (stealing customer details or Personal Identifiable Information from your web applications), and many other nasty things.

The harsh reality is that hackers are most likely searching for weaknesses and trying to break into your website right now. Whether they will hack into your site successfully depends on how hard or easy you can make it for hackers and botnets to continue trying until they work out how to break in, or are forced to decide to look for a more vulnerable target.

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

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 Scan(Hackertarget – WordPress Security Scan Screenshot source: Hackertarget.com)

You will see that the test will display various results and information about your site …

Hackertarget - WP Security Scan

(WordPress security scan results. Product image: Hackertarget.com)

It should be obvious after using this tool that if you can see all of this information, so can hackers.

WP Security Scan(Product image: BlogDefender site)

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

If your website runs on WordPress and you are not preventive steps to harden 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 website or blog is broken into, webmasters can find themselves “locked out” of their own site, or notice that their files have been vandalized or even that their content has been entirely wiped out. Typically, compromised sites will become infected with malicious scripts or viruses without the owner’s knowledge or awareness.

To help avoid the heartache and frustration (and potential financial loss) of discovering that your web site has been hacked into, below are 10 essential and effective security measures that will help to prevent your WordPress site from being attacked by brute force botnets.

Note

Note: A few of the recommended measures below need 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 search for a WordPress technical provider in our WordPress Services Directory.

***

Security Measure #1 – Contact Your Webhosting Service Provider

Contact your hosting company and ask them what security systems have been put in place to help prevent your site from botnet attacks, and what they do to ensure that your site files get regularly backed up.

Check that your hosting provider backs up your sites and that, if anything happens, you can quickly and easily recover your site.

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

You should never rely just on your webhosting service for site backups. Instead, learn how to manage your WordPress site or pay someone to get this done for you and develop a habit of performing a full site maintenance routine on a frequent basis (e.g. weekly, monthly, etc …)

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

A proper WP maintenance routine looks like this …

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

Again, we cannot stress enough how important it is to maintain your WP installation frequently backed up and updated. WordPress 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 WordPress 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 should do after making sure that you still have a pulse!

If you don’t want to back up your files manually, there are many WordPress plugins you can use. You can read about a WordPress backup plugin that can fully automate your backup process here: Backup, Duplicate & Keep Your WordPress Sites Protected With Backup Creator WordPress Plugin

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

The large scale brute force botnet attack on WordPress sites was mostly an attempt to compromise website admin panels by exploiting installations with “admin” as their user name.

For security purposes, never install a WordPress site with the username “admin”. This is the first area hackers will test. If your site’s user name is “admin”, then change this immediately.

For a detailed tutorial on how to change your login username, go here: Changing Your Admin Username In WordPress To A More Secure User Name

Security Measure #4 – Avoid Weak Passwords

A “brute force” attack occurs when a malicious script persistently tries to guess the right username and password characters that will give them entry to your website.

Unless you put some measure in place to prevent the brute-force attack from happening (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 “cracks” the code.

Passwords that are easy to guess, therefore, become very easy targets for bot attacks. Make sure that you change your password combination to a string that contains at least eight characters long, with upper and lowercase letters, combined with a few “special” characters (%^#$@&*).

Tip

Roboform is a password program that lets you easily generate different passwords …

Roboform is a password tool that lets you easily generate different strong login passwords(You can use a password software tool like Roboform to help you generate unguessable passwords)

We have created a detailed step-by-step tutorial on how to change your admin password here: Changing WordPress Passwords

Security Measure #5 – Prevent Access To Your wp-config.php 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.

WordPress WP Config file

(wp-config.php file)

If hackers break into your WordPress site, they will typically look for your wp-config.php file, because this file 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 being attacked and even being used as part of a bot net, therefore, you must prevent your wp-config.php file from being easily 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 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, just rename them.

Security Measure #7 – Keep Your WordPress Installation, Themes And Plugins Up-To-Date

Hackers search for vulnerabilities they can exploit in earlier versions of WordPress, including out-of-date versions of WP plugins and themes.

Make sure to keep all of your software 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 code from the dashboard.

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

WP Theme Editor Menu

(Accessing the WordPress theme editor using the WordPress main menu)

The WordPress theme editor allows anyone accessing your blog to view and modify your theme template files, or cause mayhem on your site.

If you want to prevent unauthorized people from accessing 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 – Prevent Access To Your WordPress Uploads Folder

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

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

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

(WordPress has an uploads folder where your media files are stored)

If any directories in your website have weaknesses or vulnerabilities that can be exploited by hackers, this can threaten the security of 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, uploading 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 seek professional help if you are not sure about what to do.

Security Measure #10 – WordPress Security Plugins

There are a number of great WordPress security plugins available that specifically address most common security issues WordPress site owners face, such as preventing hackers from gaining access to vital areas of your site, protecting your site from malicious software, preventing injections of code into files, etc.

Most 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 potential issues that could lead to hackers accessing your files and damaging your site is SecureScanPro.

SecureScanPro - security plugin for WordPress

(SecureScanPro – complete security software solution for WordPress)

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

Another great plugin you may want to consider using is BlogDefender.

Blog Defender Security Solution For WordPress Websites & Blogs

Blog Defender(Blog Defender)

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

BlogDefender scans you WordPress installation for potential security weaknesses …

Blog Defender Security Suite For WordPressAnd lets you quickly fix these …

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

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

As one last reminder of the importance of website security, below is the advice given by a security expert to all WordPress users after the mass brute force attacks by botnets 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 very important if you run a WordPress site. Hopefully, the above 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 professional WordPress security specialist, or search for a professional WordPress technical provider in our WordPress Services Directory.

Also, remember subscribe to WPCompendium.org to receive notifications whenever we publish new articles on WordPress security and tutorials about new 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

***