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 the world’s most used CMS which makes it an easy target for attempted hacking attacks.

In 2013, WordPress installations around the world were subjected to worldwide brute force attacks.

These attacks were caused by botnets (computer networks infected with viruses and programmed to attack other vulnerable installations).

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)

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

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

This is called a “brute-force” attack.

What Is A Botnet?

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 code or scripts, which are then controlled remotely as a group, often without the computer owners’ knowledge.

Botnets are often used to send out mass spam emails from the infected computers of unsuspecting users.

The screenshot below was taken from a site that monitors online security showing the locations of the command centers of ZeuS – a botnet that has been actively compromising computer networks all around the world since 2009 …

ZeuS is a botnet that has been actively compromising computer networks all around the world since 2009.

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

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

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

WordPress often comes under attack by hackers, due to its popularity

(WordPress is the world’s most popular CMS making it a natural target for hackers)

Does This Mean We Shouldn’t Use WordPress Anymore?

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

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

Useful Information

It’s important to note that, in the case of the brute-force 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, one of the co-founders of WordPress, made this comment 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)

Protecting Your WordPress Site From Being Brute-Force Attacked – 10 Security Checks

Every web site with a security vulnerability can be seen as a potential opportunity to hackers. If you think that the information in your website or blog is of little value to hackers, think again. Corporate sites, personal blogs, government websites … even websites owned by web security and anti-hacking experts can and have been targeted.

If a hacker can exploit a web security flaw and gain complete control of your website or blog, that site can then be used to attack larger and more valuable sites.

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

The reality is that brute-force software bots are most likely scouring for security weaknesses and trying to break into your site while you are reading these very words. Whether they can do this successfully depends on how difficult you will make things for them to continue trying until they find a way to break in, or give up and decide to look for a less secure target.

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

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

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

You will see that the check will display various results and details about your site setup …

Hackertarget - WordPress Security Scan

(WP security check results. Image source: Hackertarget.com)

It should be obvious after using this tool that if you are able to freely access all of this information, so can hackers.

Hackertarget - WP Security Scan(Product 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 in your site can be potentially useful information to hackers, as this can inform them about any exploitable security weaknesses, especially where site owners haven’t updated their files.

If your website is powered by WordPress and you’re not taking steps to toughen up your site, we can practically guarantee that, at some time in the near future, your site will be hacked, or at least targeted by bots, because these attacks are systematically hitting WordPress installations all the world!

Whenever a website or blog is compromised, site owners can discover much to their dismay that they have been “locked out” of their own site, or notice that their content has been modified or that everything has been entirely wiped out. Typically, most sites will be infected with malicious scripts without the owner even being aware that this has occurred.

To avoid the heartache and aggravation (and potential loss of valuable business data) of having your website being hacked into, we have listed below ten simple, yet essential and effective security checks that will help to prevent your WordPress site from brute-force attacks.

Important Info

Note: A few of the recommended steps listed below require some technical understanding of how to modify core WordPress 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 search for a WordPress technical provider in our WordPress Services Directory.

***

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

Contact your webhosting service and ask them exactly what measures are in place to help prevent your site from botnet attacks, and what is done to make sure that your site files are being regularly backed up.

Make sure that your host backs up your server files and that, if anything goes wrong, you can quickly and easily recover your files and data.

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

Never rely just on your webhosting service provider for your site backups. Instead, learn how to maintain your WordPress site or pay someone to get this service done for you and develop a habit of religiously performing a full WordPress site maintenance routine on a frequent basis (e.g. daily, weekly, fortnightly, etc …)

A complete WordPress maintenance routine ensures that:

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

A full WordPress maintenance routine looks like this …

Maintaining your WordPress installation backed up and up-to-date is vitally important for WordPress security.(Maintaining your WP installation backed up and up-to-date is vitally important for WordPress security. Screenshot: WPTrainMe.com)

Again, we cannot stress enough how important maintaining your WordPress site frequently backed up and up-to-date is. WP maintenance is not hard to do or time-consuming, but it must be done to ensure the security of your website. 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 site is the second most important thing you should do after making sure that you still have a pulse!

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

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

The brute force attack on WordPress is mostly an attempt to compromise website admin panels by exploiting installations with “admin” as the username.

For security purposes, avoid installing 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 tutorial for WordPress users that shows you how to change your admin username, go here: Changing Your WordPress Admin Username To A More Secure User Name

Security Measure #4 – Use Strong Passwords

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

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

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

Practical Tip

You can use a password program like Roboform to generate strong login passwords …

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

We have created a detailed step-by-step tutorial for admin users on how to change your admin password here: What To Do If You Need 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)

If hackers break into your WordPress site, they will try to access the wp-config.php file, because this is the file that contains your WordPress database information, 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, prevent people finding 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

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

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

Security Measure #7 – Update Your WordPress CMS, Themes & Plugins

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

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

Security Measure #8 – Disable The Theme Editor

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

You can access the WordPress Theme Editor by selecting Appearance > Editor from your admin menu …

WordPress Theme Editor Menu

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

This means that anyone logging into your site can view and edit your theme files, or create havoc on your site.

If you want to prevent 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 – Remove Access To The WordPress Uploads Folder

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

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

(WordPress uploads folder)

(WordPress uploads directory)

If any directories in your website have weaknesses or vulnerabilities that can be exploited by malicious users, someone 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 an empty file called “index.php”) to your uploads directory, and so on. Again, it’s best to get professional assistance if you are not sure about what to do.

Security Measure #10 – Use WordPress Security Plugins

There are a number of security plugins for WordPress available that will address many common security issues faced by WordPress website owners, such as preventing unauthorized users from gaining access to vital information about your site, protecting your files from botnets, preventing unauthorized file uploads, etc.

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

SecureScanPro - complete security software solution for WordPress

(SecureScanPro – security software solution for WordPress)

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

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

Blog Defender

Blog Defender Security Solution For WordPress(Blog Defender WordPress Security Plugin)

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

BlogDefender scans you WordPress site for security vulnerabilities …

Blog Defender Security Solution For WordPressAnd then shows you how to quickly fix these …

Blog DefenderIf you don’t want to purchase a premium security plugin like SecureScanPro or BlogDefender, then use various free WP plugins, such as Limit Login Attempts

Limit Login Attempts - WordPress Security Plugin

WordPress is a secure web platform, but neglecting simple maintenance tasks like keeping your WordPress core files, plugins and themes up-to-date, 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, web security is something you 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 following the worldwide 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, the above article 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 consult a WordPress security specialist, or search for a WordPress technical provider in our WordPress Services Directory.

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

***

"Wow! I never knew there's so much to learn about WordPress! I bought one of the WordPress for Dummies three years ago, such authors need to be on this course!" - Rich Law, Create A Blog Now

***