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 often the target of malicious attacks by hackers.

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

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

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

Brute-Force Attacks – An Overview

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 admin’s login username and password. This is done with software tools that automatically tries to guess hundreds of login possibilities in minutes.

If you’re not using strong usernames or unguessable passwords, your site could be easily hacked by persistent attempts to guess your site’s login details.

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)

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

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

(The Zeus botnet has been actively infecting computer networks all around the world since 2009. Image 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 users administration areas occurred. The attack then continued, with over 30,000 WordPress blogs being hacked per day.

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

WordPress is frequently the target of malicious attempts by hackers

(Being the world’s most used content management system makes WordPress a target for hacking attacks)

Does This Mean We Shouldn’t Use WordPress Anymore?

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 presence.

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

Important

It’s important to note that, in the case of the worldwide brute-force botnet attack described above, there was actually no WordPress vulnerability 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 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 Website From Brute Force Attacks – 10 Security Checks

Every blog with a security vulnerability presents an opportunity to hackers. A compromised site not only presents wannabe hackers opportunities to improve their skills and win “respect” from their peers, but it can also serve as a valuable resource for launching distributed denial of service (DDoS) attacks, distributing malware and information theft.

If hackers can hack into and gain remote access and control of your blog, that website can then be employed as part of a larger network of “bots” to target more valuable sites.

Additional undesirable results of being hacked include being blacklisted by search engines, having spammy links promoting things like online meds, porn, etc. inserted in your content, malicious redirects to phishing sites, data exfiltration (stealing customer details or Personal Identifiable Information from your web applications), and lots of other nasties.

The truth is that hackers are trying to hack into your blog while you are reading this page right now. Whether they can be successful or not, will depend on how hard or easy you can make it for them to keep persisting until they can either work out a way to get access, or are forced to give up and go look for an easier target.

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

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

Hackertarget - WordPress Security Scan(Hackertarget – WP Security Scan Product image: https://hackertarget.com/wordpress-security-scan)

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

Hackertarget - WP Security Scan

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

It should be obvious after using the above tool that if you are able to see all of this information, then so can hackers.

WP Security Scan(Image source: Blog Defender)

Being able 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 valuable information to hackers, as these can inform them about any exploitable vulnerabilities, especially in older versions.

If your website is driven by WordPress and you’re not precautionary steps to bolster the security of your site, it’s practically guaranteed that, at some point in time, someone will attempt to hack your site, because these brute-force attacks are systematically targeting WordPress installations worldwide!

Whenever a website or blog gets broken into, webmasters will find themselves “locked out” of their own site, or notice that their files have been altered or even that their content has been entirely wiped out. Often, compromised sites will become infected with malicious scripts or viruses without the owner even being aware of it.

To avoid the heartache and aggravation (and significant loss of valuable business data) of having your web site being hacked into, below are 10 essential and effective security measures that will help to prevent your WordPress site from being attacked by brute-force botnet hacking attempts.

Info

Note: Some of the recommended measures shown below require some technical understanding of how to modify core WordPress and/or server files. If you are not technical, or don’t want to mess around with code on your site, then ask your web host or a professional WordPress technical provider for assistance.

***

Security Measure #1 – Contact Your Web Host

Contact your hosting service provider and ask them what security systems they have put in place to help prevent your site from being attacked, and what they are doing to make sure that your server files get regularly backed up.

Make sure that your web host is regularly backing up your sites and that, if anything happens, you can easily recover your files.

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

Never rely only on your hosting provider for your site backups. Instead, learn how to manage your WordPress site or get this done for you and develop a habit of performing a full site maintenance routine on a frequent basis (e.g. daily, weekly, monthly, etc …)

A proper WordPress maintenance routine ensures that:

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

A proper WordPress 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 WP website completely backed up and up-to-date is vitally important for WordPress security. Source: WPTrainMe.com)

Again, we cannot stress enough how vitally important it is to maintain your WP website or blog regularly backed up and up-to-date. WP 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 WP site maintenance yourself, pay someone 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 plugins you can use. Learn about a WordPress backup plugin that can automate your site backups here: Backup, Copy And Keep Your WordPress Web Site Protected With Backup Creator Plugin For WP

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

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

For website security reasons, never set up sites with the username “admin”. This is the first thing hackers will test. If your site’s user name is admin, change it immediately.

We have created a simple tutorial that shows you how to change your username here: Changing Your Admin Username In WordPress

Security Measure #4 – Your Password

A “brute force” attack occurs when malicious software continually hits a username and password field with different character strings trying to guess the right combination that will unlock your website.

Unless some measure is put into place to block the brute force attack (see further below for a couple of effective ways to do this), the “bot” will just continue to attack your site until it eventually “cracks” the code.

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

Useful Tip

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

Roboform is a password tool that lets you easily create different secure login passwords(Roboform is a password management program you can use to generate really secure passwords)

We have created a simple tutorial created especially for non-technical WordPress users that shows you how to change your login password here: What To Do If You Need To Change The Login Password

Security Measure #5 – Prevent Access To The 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 WordPress options.

WP Config file

(wp-config.php file)

If a hacker breaks into your website, they will look for the 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, you must prevent people getting to 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 – Rename Or Delete Unnecessary WordPress Installation Files

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

These files can be deleted after installation. If you don’t want to remove these files, then just rename them.

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

Hackers are always on the lookout for vulnerabilities in outdated versions of WordPress that they can exploit, including out-of-date versions of WP themes and plugins.

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

Security Measure #8 – Disable Your WordPress Theme Editor

WordPress comes with a built-in editor that lets administrators edit plugin and theme files inside the dashboard area.

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

WordPress Theme Editor Menu

(The WordPress theme editor is accessible via the admin menu)

The WordPress theme editor allows anyone accessing your blog to see and modify all of your theme files, and cause mayhem on your site.

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 – Prevent Access To Your Site’s Uploads Folder

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

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

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

(WordPress uploads folder)

If any files stored in his folder have vulnerabilities that can be exploited by hackers or malicious users, anyone could upload unauthorized file types or compromise the security of your site.

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, 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 get professional assistance if you are unsure about what to do.

Security Measure #10 – Use Security Plugins

Some great security plugins for WordPress are available that specifically address many common security issues WordPress website owners face, such as preventing hackers from gaining access to vital areas of your site, protecting your site from brute-force attacks, preventing injections of code into files, etc.

Most WordPress plugins address some but not all areas of WordPress security. One WordPress plugin that seems to do a comprehensive job of scanning, fixing and preventing potential issues that could lead to hackers accessing your website files and causing damage to your site is SecureScanPro.

SecureScanPro - WordPress total security software solution

(SecureScanPro – WordPress security software solution)

SecureScanPro is easy to install and easy to use, and takes care of most of the security areas 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 Security Plugin For WordPress(Blog Defender WordPress Security Solution)

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

BlogDefender shows you where the security weaknesses in your website are …

Blog Defender WordPress Security Product SuiteAnd lets you quickly fix these …

Blog DefenderIf 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 secure platform, but neglecting basic maintenance tasks like updating your WordPress installation, WordPress plugins and themes, tightening file and data security and taking other necessary precautions can expose your website to attacks 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, web security is something you simply cannot ignore.

As one last reminder of the importance of keeping your websites protected, below is the advice given by an expert on website security to all WordPress users after the global 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 article has shown you what to do to prevent brute-force attacks on your WordPress site. If you need any further help or assistance with WordPress security, please consult a professional WordPress security specialist, or search for a WordPress technical provider in our WordPress Services Directory.

Also, please subscribe to WPCompendium.org to be notified when we publish new articles on WordPress security and tutorials about WordPress security plugins.

***

"I was absolutely amazed at the scope and breadth of these tutorials! The most in-depth training I have ever received on any subject!" - Myke O'Neill, DailyGreenPost.com

***