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 most popular content management system and the preferred online publishing platform used by millions of websites and loved by thousands of website developers and web designers, it’s inevitable that at some point in time, WordPress will come under attack from hackers.

In 2013 a large-scale brute-force attack struck WordPress installations across almost every WP hosting server in existence.

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

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

About 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 admin’s login username and password. This is achieved with software programs that can work through hundreds of possible logins in minutes.

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

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

”Botnets” are networks of computers that have been infected with malicious scripts or software, which can then be controlled remotely as a group, often without the unsuspecting computer owners’ knowledge.

Botnets are typically used to blast mass spam emails from computers of compromised user accounts.

Below is a screenshot taken from a site that monitors online security showing the locations of the command centers of a botnet that has been actively compromising computer networks all around the world since 2009 called “Zeus” …

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

(The Zeus botnet has been actively infecting computer networks all around the world since 2009. Screenshot: SecureList.com)

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

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

Powering millions of sites worldwide makes WordPress a target for attempted attacks by malicious users

(Being the world’s most used CMS makes WordPress an obvious target for malicious attacks by hackers)

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

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

We explain what makes WordPress a very secure platform for websites in this article: Can You Build A Secure Business Online Using WordPress?

Important Info

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

Mike Little, one of the co-founders of WordPress with Matt Mullenweg, made the following 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)

Preventing Your WordPress Website From Brute Force Attacks – 10 Security Points

Every blog with a security vulnerability provides some degree of opportunity to hackers. An unsecured site not only offers new hackers opportunities to improve their hacking skills and claim “bragging rights” amongst their peers, but it can also acts as a valuable resource for DDoS attacks, distributing malware and engaging in information theft.

If hackers can exploit a web software flaw, the blog can then be employed to target more highly-valued websites.

Additional undesirable effects of having your site hacked include being blacklisted by search engines, having spammy links advertising things like gambling, cheap offers on brand names, etc. inserted in your content and meta data, malicious redirects to phishing sites or other websites, drive-by downloads (adding malicious programs on your visitors’ computers), and lots of other nasty things.

The harsh reality is that malicious bots are probably trying to break into your website at this very moment. Whether they can get in successfully will depend on how hard or easy you have made it for them to continue trying until they can discover how to break in, or are forced to decide to look for an easier target.

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

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

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

You will see that the check will return various results and information about your website setup …

Hackertarget - Website Security Scan

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

It should be obvious after using the above tool that if you can freely access all of this information, then so can hackers.

Website Security Scan(Image source: BlogDefender.com)

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

If your site or blog runs on WordPress and you’re not precautionary steps to bullet-proof your site, then it’s practically guaranteed that, at some point in time, your site will be hacked, or at least targeted by bots, because these attacks are systematically hitting WordPress installations around the world!

Whenever a website is broken into, webmasters will find themselves completely “locked out” of their own site, or notice that their files have been modified or even that their content has been entirely wiped out. Typically, sites will be infected with malicious scripts without the owner’s knowledge or awareness.

To help avoid the heartache that comes with discovering that your website has been hacked into, below are ten essential and effective security checks that will help to prevent your WordPress site from being brute-force attacked.

Useful Info

Note: Some of the recommended measures shown below need some technical skills to modify core WordPress or server files. If you have no web skills, or don’t want to mess around with code on your site, then ask your web host or search for a professional WordPress service provider in our WordPress Services Directory.

***

Security Measure #1 – Get In Touch With Your Web Host

Get in touch with your webhosting service provider and ask them what measures have been put into place to protect your site from botnet attacks, and what is done to ensure that your files and data get backed up.

Check that your web host backs up your sites and that, if anything should happen, you can easily get back your files.

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

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

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

A proper WP maintenance routine looks like this …

Maintaining your WordPress website or blog regularly backed up and updated is vitally important for WordPress security.(Maintaining your WP installation regularly backed up and updated is vitally important for WordPress security. Image source: WPTrainMe.com)

Again, we cannot stress enough how important maintaining your WordPress website 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 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 website is the next most important thing you should do after making sure that you are still breathing!

If you don’t want to back up your files manually, there are many free and paid plugins you can use. Learn about a WordPress backup plugin that can fully automate your site backups here: Backup, Duplicate & Protect Your WordPress Website With Backup Creator Plugin For WP

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

the worldwide brute-force botnet attack on WordPress is mostly attempting to compromise website admin panels by exploiting installations with “admin” as their username.

For reasons of website security, don’t set up WordPress sites with the username “admin”. This is the first thing hackers will test. If your site’s username is admin, change this immediately.

For a simple step-by-step tutorial for admin users on how to change your login username, go here: Changing Your WordPress Username From Admin To A More Secure Username

Security Measure #4 – Avoid Weak Passwords

A “brute force” attack occurs when malicious software continually tries to guess the right username and password character string that will unlock your site.

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

Passwords that are easy to guess, therefore, become really easy targets for brute-force attacks. Make sure that you change your password to something that contains at least 8 or 9 characters long, with upper and lowercase letters, and add a few “special” characters (^%$#&@*).

Tip

Roboform is a password program you can use to create different unbreakable passwords …

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

We have created a detailed step-by-step tutorial that shows you how to change your admin password here: Changing Passwords

Security Measure #5 – Prevent Your wp-config.php File From Being Accessible

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.php file

(wp-config.php file)

If hackers break into your WordPress website, they will normally search for your wp-config.php file, because this is the file that contains your database details, 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 your wp-config.php file from being easily accessed. 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 WP Installation Files

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

These files are not required after installation. If you don’t want to delete these files, just rename them.

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

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

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

Security Measure #8 – Disable The WordPress Theme Editor

WordPress installations come with a built-in editor that allows site administrators to edit theme and plugin files from the dashboard area.

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

WordPress Theme Editor Menu

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

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

If you want 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 WordPress Uploads Directory

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

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

(WordPress uploads folder)

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

If any directories in your website have vulnerabilities that can be exploited by hackers, anyone could upload unauthorized file types or compromise the security of 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, adding a blank index.php file (this is literally a file with nothing in it called “index.php”) to your uploads directory, and so on. Again, it’s best to hire a professional if you are unsure about what to do.

Security Measure #10 – Security Plugins

There are several WordPress security plugins available that specifically address most common security issues WordPress website owners face, such as preventing unauthorized users from gaining access to vital areas of your site, protecting your site from malicious exploits, preventing injections of code into files, etc.

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

SecureScanPro - complete security software for WordPress

(SecureScanPro – complete security plugin for WordPress)

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

Another plugin you may want to consider using is BlogDefender.

Blog Defender

Blog Defender(Blog Defender Security Suite)

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 holes …

Blog Defender WordPress Security SolutionAnd lets you quickly and easily fix these …

Blog DefenderIf you don’t want to purchase a 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 basic maintenance tasks like keeping your WP core files, WP plugins and WP themes updated to their latest versions, 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 websites is something you simply cannot ignore.

As a final reminder, below is the advice given by a website security expert to all WordPress users following the worldwide brute force attacks 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 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 professional WordPress security specialist, or search for a professional WordPress technical provider in our WordPress Services Directory.

We also recommend subscribing to WPCompendium.org to be notified whenever we publish new tips on WordPress security and reviews of new security plugins and solutions.

***

"If you're new to WordPress, this can stand on its own as a training course and will stay with you as you progress from beginner to advanced and even guru status." - Bruce (Columbus, Ohio)

***