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 often comes under attack by hackers, due to its global popularity.

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 sites 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 ways hackers try to break into a WordPress site. One of these is by trying to guess the site’s administration login username and password. This is done using scripts and software that can guess hundreds of possible logins in minutes.

If you’re not using strong usernames or unguessable passwords, your site could be an easy target for hackers.

This is called a “brute force” login attack.

What Are Botnets

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 private computers that have been infected with malicious scripts or code, which are then controlled remotely as a group, typically without the unsuspecting computer owners even being aware that this is happening.

Botnets are typically used to blast mass spam emails.

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

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 image: SecureList.com)

These botnet attacks were highly distributed and well organized. 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 took place. The worldwide attacks continued after this, with over 30,000 WordPress blogs being hacked each day.

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

WordPress often is targeted by hackers

(WordPress powers millions of websites worldwide, which makes it an obvious target for malicious attacks by hackers)

Does This Mean We Should Stop Using WordPress?

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

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

Important

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

Mike Little, the co-founder 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)

Preventing Your WordPress Blog From Brute Force Attacks – Ten Security Points

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

If a malicious user can find a security vulnerability that lets them gain control of your website, that site can then be used to attack larger and more valuable websites.

Additional undesirable effects of being hacked include getting blacklisted by Google, having spammy links promoting things like casinos, cheap offers on brand names, etc. inserted into your content and page title and descriptions, redirecting visitors to phishing sites, drive-by downloads (adding malicious scripts on your visitors’ computers), and lots of other nasties.

The reality is that malicious bots are most likely looking for security exploits and trying to break into your web site while you are reading this page at this very moment. Whether they will break in successfully depends on how challenging you can make it for hackers to continue persisting until they either can find a way to break in, or are forced to give up and decide to look for an easier target.

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

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

WordPress Security Scan(Website Security Scan Screenshot: https://hackertarget.com/wordpress-security-scan)

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

Hackertarget - Website Security Scan

(website security check results. Source: Hackertarget.com)

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

Hackertarget - Website Security Scan(Screenshot source: BlogDefender.com)

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 can be useful information to hackers, as this informs them about any potential holes or weaknesses, especially in older versions.

If your website runs on WordPress and you are not taking steps to toughen up your site, then it’s practically guaranteed that, at some time in the near future, someone will attempt to hack your site, because these brute force attacks are systematically hitting WordPress sites all the world!

Typically, when a site is compromised, webmasters can 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, sites will become infected with malicious scripts or viruses without the owner even being aware that this has taken place.

To help avoid the heartache and frustration (and significant loss of valuable business data) of having your site being hacked into, below are ten simple, yet essential and effective security checks that will help to prevent your WordPress site from brute force botnet attacks.

Important

Note: A few of the recommended steps below require some technical understanding of how to modify core WordPress or server files. If you lack these technical skills, or don’t want to mess around with code on your site, then ask your web host or search for a WordPress service provider in our WordPress Services Directory.

***

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

Contact your hosting service provider and ask them what security systems have been put in place to protect your site from being attacked, and what they do to make sure that your server files and data get backed up.

Make sure that your webhosting provider is backing up your server files and that, if disaster strikes, you can quickly and easily recover your files and data.

Security Measure #2 – Perform Regular WordPress Backups And Keep Your Site Frequently Maintained

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

A complete WordPress maintenance routine ensures that:

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

A proper WP maintenance routine looks like this …

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

Again, we cannot stress enough how vitally important maintaining your WordPress site regularly backed up and up-to-date is. WordPress maintenance is not hard 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 WP site maintenance yourself, get someone else 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 your heart is still beating!

If you don’t want to perform manual backups, there are many free and paid WordPress plugins you can use. Learn about a WordPress backup plugin that can fully automate your site backups here: Back Up, Duplicate & Protect Your WordPress Web Sites With Backup Creator Plugin For WordPress

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

The brute force attack on WordPress sites was mostly an attempt to compromise site administrator panels by exploiting WP installations using “admin” as their account name.

For reasons of website security, never set up a WordPress site with the username admin. This is the first area of potential vulnerability hackers will test. If your blog’s user name is “admin”, you should change this immediately.

We have created a step-by-step tutorial that shows you how to change your login username here: How To Change Your Admin User Name In WordPress

Security Measure #4 – Use Strong Passwords

A “brute force” attack occurs when a malicious script persistently tries to guess the right password and username character string that will unlock your website.

Unless you put some measure in place to block the brute-force attack from happening (see further below for a couple of simple and effective ways to do this), the “bot” will just continue attacking your site until it eventually breaks into your admin area.

Weak passwords, therefore, are really easy targets for brute force attacks. Make sure that you change your password to something containing at least eight or nine characters long, with upper and lowercase letters, and “special” characters (%^#$@&*).

Practical Tip

You can use a password software tool like Roboform to help you generate very secure passwords …

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

We have created a detailed tutorial created especially for non-technical WordPress admin users that shows you how to change your WordPress admin password here: How To Reset Your 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 options for WordPress.

WordPress WP Config file

(wp-config.php file)

If hackers break into your website, they will search 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.

To protect your WordPress site from attacks and even being used as part of a bot net, therefore, you must prevent your wp-config.php file from being accessible. 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 the install.php, upgrade.php and readme.html files from your server.

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 Installation, Plugins And Themes Up-To-Date

Hackers look for vulnerabilities in previous versions of WordPress that can be exploited, including outdated versions of WordPress themes and plugins.

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

Security Measure #8 – Disable The WordPress Theme Editor

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

In WordPress, you can access the WordPress Theme Editor by selecting Appearance > Editor from the admin menu …

WordPress Theme Editor Menu

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

This allows anyone accessing your site’s admin to view and edit your WordPress files, or cause mayhem on your site.

If you want to prevent people from being able to access your WordPress Theme editor, you will need to disable it. This can be done by editing your wp-config.php file.

Security Measure #9 – Prevent Access To Your Site’s Uploads Folder

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

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

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

(WordPress uploads directory)

If any directories in your website have vulnerabilities that can be exploited by hackers, anyone could upload unauthorized file types to your site.

Protecting your directories will prevent online users 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 named “index.php”) to your uploads directory, and so on. Again, it’s best to ask help from someone with experience if you are unsure about what to do.

Security Measure #10 – Security Plugins

There are a number of great WordPress security plugins available that will address most security issues WordPress website owners face, such as preventing unauthorized users from accessing vital areas of your site, protecting your site from malicious scripts, 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 issues that could lead to hackers accessing your website files and causing damage to your site is SecureScanPro.

SecureScanPro - WordPress complete security software solution

(SecureScanPro – security software for WordPress)

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 plugin you may want to consider using is BlogDefender.

Blog Defender Security Product Suite For WordPress

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

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

BlogDefender shows you where potential security holes in your website are …

Blog Defender Security Plugin For WordPress SitesAnd lets you fix these quickly and easily …

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

Limit Login Attempts - WordPress Security Plugin

WordPress is a secure platform, but neglecting essential maintenance tasks like keeping your WP core files, plugins and themes updated to their latest versions, tightening file and data protection and taking other necessary precautions can have disastrous consequences.

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

As a final reminder, 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 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 of the utmost importance if you run a WordPress site. Hopefully, the information in this 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 seek help from 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 when we publish new information on WordPress security and tutorials about new WordPress security plugins and solutions.

***

"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

***