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 SecurityBeing the world’s most popular CMS makes WordPress an easy target for malicious attacks by hackers.

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

These attacks were caused by networks of infected computers programmed to attack other sites, also commonly known as “botnets”.

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 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. To do this, hackers use software programs that can guess hundreds of possible logins in minutes.

If you’re using obvious login details, your site can be easily hacked by the malicious software’s repeated attempts to work out your site’s login details.

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/botnet)

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

Botnets are normally used used to blast out mass spam emails from the infected 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 world since 2009.

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

These were highly distributed and well organized attacks. Over 90,000 IP addresses were identified by a number of hosting companies just in the initial attack, when the web was flooded with millions of attempts to force their way into WordPress users admin areas. The large-scale brute force attacks then continued, with over 30,000 WordPress sites being hacked each day.

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

WordPress often is targeted by hackers

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

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

No. In fact, there are many great reasons why you should choose WordPress if you are concerned at all about website security.

To learn what makes WordPress a very secure platform for websites, read this article: Why WordPress Is A Secure Platform For Websites –

Info

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

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

How To Prevent Your WordPress Blog From Brute-Force Attacks – Ten Security Points

You may think that your site offers no value to hackers, but the reality is that all websites have value to a malicious user.

If hackers can exploit a security weakness that allows them to gain access and control of your web site, your blog can then be employed as part of a larger network of “bots” to target larger and more highly-valued web sites.

Additional undesirable effects of having your site hacked and your site security compromised include being blacklisted by search engines, 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 or other websites, data exfiltration (stealing information or Personal Identifiable Information from your web applications), and many other nasties.

The truth is that software-driven bots are probably trying to hack into your website right now. Whether they will hack into your site successfully will depend on how challenging you have made things for them to keep trying until they discover a way to get in, or are forced to decide to look for a less protected target.

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

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

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

You will see that the test will yield various results and information about your website setup …

Website Security Scan

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

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

Website Security Check(Screenshot source: BlogDefender.com)

Being able to see which 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 on your server can all be potentially valuable information to hackers, as this can inform them about any exploitable security weaknesses, especially where the owners haven’t updated their software versions.

If your site or blog is powered by WordPress and you are not preventive steps to bullet-proof your site, then we can practically guarantee that, at some point, someone will attempt to hack your website, because these attacks are systematically hitting WordPress installations around the world!

Whenever a site gets broken into, webmasters can find themselves “locked out” of their own site, or notice that their content has been interfered with or that everything has been entirely wiped out. Typically, compromised sites will be infected with malicious software or viruses without the owner even being aware that a breach has taken place.

To avoid the heartache of having your website or blog being hacked into, we have listed below 10 simple, yet essential and effective security checks that will help to prevent your WordPress site from being attacked by brute-force botnets.

Info

Note: A few of the recommended measures below need some technical understanding of how to modify core WordPress or server files. If you have no web editing skills, or don’t want to mess around with file code, then ask your web host or a professional WordPress service provider for help.

***

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

Contact your webhosting provider and ask them exactly what measures have been put in place to protect your site from being attacked, and what they are doing to make sure that your files and data get regularly backed up.

Make sure that your webhosting provider regularly backs up your sites and that, if disaster strikes, you can easily get back your files.

Security Measure #2 – Perform Full WordPress Backups And Keep Your Website Frequently Up-To-Date

You should never rely on your web host for your site backups. Instead, learn how to maintain and manage your WordPress site or get this service done for you and maintain a habit of religiously performing a full WordPress site maintenance routine frequently (e.g. daily, weekly, fortnightly, etc …)

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

A proper WP maintenance routine looks like this …

Maintaining your WordPress website regularly backed up and up-to-date is vitally important for WordPress security.(Maintaining your WP web site fully backed up and up-to-date is vitally important for WordPress security. Screenshot: WPTrainMe.com)

Again, we cannot stress enough how vitally important maintaining your WordPress site frequently backed up and up-to-date is. 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 WordPress site maintenance yourself, get someone else to do it but make sure this gets done. Backing up your website is the second most important thing you must do after making sure that you are still breathing!

If you don’t want to perform manual backups, there are a number of free and paid WordPress plugins you can use. Learn about a WordPress backup plugin that can fully automate your backup process here: Backup, Duplicate And Protect Your WP Websites And Blogs With Backup Creator Plugin For WordPress

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

The mass brute force attack on WordPress is mostly attempting to compromise site administrator panels and gain access to the site by exploiting sites using “admin” as their account name.

For reasons of website security, never install WordPress sites with the username “admin”. This is the first thing hackers will test. If your blog’s username is “admin”, change it immediately.

We have created a detailed tutorial that shows you how to change your admin username here: Changing Your WP Admin Username To Another User Name

Security Measure #4 – Your Password

A “brute force” attack occurs when a malicious script continually hits a username and password field with different character strings in an attempt to guess the right login combination that will give the hacker entry to your website.

Unless some measure is put into place to prevent the brute force attack (see further below for a couple of effective suggestions for doing this), the “bot” will just persist in attacking your site until it eventually gets access.

Passwords that are easy to guess, therefore, make very easy targets for botnets. Make sure that you change your password to a string containing at least 8 or 9 characters long, and that includes upper and lowercase letters, combined with a few “special” characters (%^#$@&*).

Tip

If you have trouble coming up with strong passwords or are reluctant to set up different passwords for all your online logins, then use a password tool like Roboform …

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

For a tutorial for WordPress admin users on how to change your login password, go here: Changing Passwords

Security Measure #5 – Secure Your WP Config 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.php file

(wp-config.php file)

If a hacker breaks into your WordPress site, they will normally try to access 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 them 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 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 Installation Files

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

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

Security Measure #7 – Upgrade Your WordPress Site, Themes And Plugins

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

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

Security Measure #8 – Disable Your WordPress Theme Editor

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

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

WordPress Theme Editor Menu

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

This means that anyone logging into your site can view and change your theme templates, or cause mayhem on your site.

If you want to prevent unauthorized people from being able to access 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 The Site’s Uploads Folder

The WordPress “uploads” directory stores all the media that gets uploaded to your website.

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

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

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

If any files stored in his folder have weaknesses or vulnerabilities that can be exploited by hackers, this could become a serious threat to the security of your site.

Protecting your directories will prevent unauthorized people 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 blank file called “index.php”) to your uploads directory, and so on. Again, it’s best to ask for assistance from someone with experience if you are not sure about what to do.

Security Measure #10 – Security Plugins

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

Many WordPress plugins address some but not all areas of WordPress security. One security plugin that seems to do 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 - total security plugin for WordPress

(SecureScanPro – complete security plugin for WordPress)

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

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

Blog Defender

Blog Defender(Blog Defender)

This product is a package of WordPress security video tutorials, WordPress plugins and tools, plus WordPress security documentation in PDF and DOC formats.

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

Blog Defender Security Plugin For WordPressAnd lets you easily fix these …

Blog DefenderIf you don’t want to buy a 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 very secure web platform, but neglecting basic maintenance tasks like updating your WordPress software, WordPress plugins and themes, tightening file and data protection and taking other necessary precautions can expose your website to attacks by hackers and bots.

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

As a final reminder of the importance of website security, below is the advice given by an expert on website security to all WordPress users following the large-scale 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 of the utmost importance if you run a WordPress site. Hopefully, the above information 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.

Also, do yourself a favor and subscribe to WPCompendium.org to receive notifications via email whenever we publish new articles and tutorials on WordPress security and tutorials about WordPress security plugins.

***

"This is an awesome training series. I have a pretty good understanding of WordPress already, but this is helping me to move somewhere from intermediate to advanced user!" - Kim Lednum

***