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 making it an obvious target for malicious attempts by hackers.

In early 2013 a worldwide brute-force attack hit WordPress installations on virtually every WP hosting server in existence around the world.

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

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 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 done using software programs and scripts that automatically tries to guess hundreds of possible login combinations in minutes.

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

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

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

Botnets are normally used used to blast mass spam emails.

Below is a screenshot taken from a site that monitors online security showing the locations of the command centers of ZeuS – a botnet that has been actively infecting 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.

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

These were well organized and highly distributed botnet attacks. 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 admin areas occurred. The attacks then continued, with over 30,000 WordPress blogs being hacked per day.

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

WordPress is the world's most popular CMS making it an obvious target for attempted hacker attacks

(Powering millions of websites worldwide makes WordPress a target for hacking)

Does This Mean We Should Stop Using WordPress?

No. In fact, there are many very good reasons why you should continue using WordPress if you are concerned about the security of your online business.

To learn what makes WordPress a very secure web platform, see this article: Is WordPress Secure?

Useful Info

It’s important to understand that, in the case of April 2013 brute-force attack described above, no specific WordPress vulnerability was being exploited (the same script was also targeting sites built using other applications 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)

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

You may think that your website or blog is of no interest to hackers, but the reality is that every website has value to a malicious user.

If hackers can find a security weakness in your system that lets them compromise the control of your blog, that site can then be employed as part of a larger network of “bots” to target other highly-valued websites.

Additional undesirable consequences of having your site hacked and your site security compromised include getting blacklisted by search engines, having spammy links promoting things like gambling, porn, etc. inserted into your content, malicious redirects to phishing sites and other websites, data exfiltration (stealing information or Personal Identifiable Information from your web applications), and many other nasty things.

The reality is that brute-force software bots are trying to hack into your website or blog at this very moment. Whether they can do this successfully or not, depends on how challenging you can make it for them to continue trying until they find a way to get access, or decide to look for a more vulnerable target.

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

Does your website run on WordPress? If so visit Hackertarget.com and run your website through their WordPress security check …

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

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

WordPress Security Check

(WP security scan results. Screenshot source: Hackertarget.com)

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

Hackertarget - Website Security Scan(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 in your site can be useful information to hackers, as this informs them about potential vulnerabilities, especially in older versions.

If your site or blog runs on WordPress and you are not preventive steps to bolster the security of your site, then it’s practically guaranteed that, at some time in the near future, your site will be hacked, or at least targeted by bots, because these brute-force attacks are systematically targeting WordPress sites worldwide!

Typically, whenever a site is hacked, webmasters will find themselves “locked out” of their own site, or notice that their content has been interfered with or even entirely wiped out. Typically, sites will be infected with malicious software without the owner’s knowledge or awareness.

To avoid the heartache of discovering that your web site has been hacked into, we have listed below 10 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 need some technical skills to modify core WordPress and server files. If you have no web skills, or don’t want to mess around with file code, then ask your web host or a professional WordPress technical provider for assistance.

***

Security Measure #1 – Contact Your Hosting Company

Contact your web host and ask them what measures they offer to protect your site from botnet attacks, and what they are doing to make sure that your files and data get backed up.

It is important to make sure that your host is backing up your server files and that, if disaster strikes, you can quickly and easily get back your files and data.

Security Measure #2 – Back Up Your WordPress Data And Files And Keep Your Website Regularly Maintained

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

A full WordPress maintenance routine ensures that:

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

A complete WP site maintenance routine looks like this …

Maintaining your WP website or blog frequently backed up and updated is vitally important for WordPress security.(Maintaining your WordPress website fully backed up and up-to-date is vitally important for WordPress security. Screenshot image: WPTrainMe.com)

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

If you don’t want to back up your data manually, there are a number of WordPress plugins you can use. Learn about a WordPress backup plugin that can automate your site backups here: Backup, Clone & Keep Your WP Websites Protected With Backup Creator WP Plugin

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

The brute force attack on WordPress sites was mostly an attempt to compromise site admin panels by exploiting WordPress installations that used “admin” as the user name.

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

For a step-by-step tutorial created especially for non-technical admin users that shows you how to change your WordPress admin username, go here: How To Change Your Admin Username In WordPress

Security Measure #4 – Choose A Strong Password

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

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

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

Useful Tip

Roboform is a password tool that lets you create strong login passwords …

You can use a password software tool like Roboform to create secure passwords(Roboform is a password management software that lets you easily create secure passwords)

We have created a detailed tutorial created especially for WordPress users on how to change your admin password here: What To Do If You Need To Change A Password In WordPress

Security Measure #5 – Protect Your 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.

WP Config file

(WP Config file)

If hackers break into your WordPress website, they will normally try to access the wp-config.php file, because this is the file that contains your WordPress 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.

To protect your WordPress site from attacks and even being used as part of a bot net, therefore, 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 Installation Files

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

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

Security Measure #7 – Update Your WordPress Files, Themes And Plugins

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

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

Security Measure #8 – Disable The Theme Editor

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

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

WordPress Theme Editor Menu

(The WordPress theme editor can be accessed via the dashboard menu)

The WordPress theme editor feature allows anyone accessing your site to view and edit your WP theme template files, and create 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 – Secure Your WordPress Uploads Directory

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

Normally, this folder is visible to online users. All a person needs to do to view the contents in your “uploads” directory is navigate to your directory using their web browser …

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

(WordPress uploads directory)

If any directories in your website have vulnerabilities that can be exploited by malicious users, this can compromise the security of 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, uploading 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 seek professional help if you are not sure about what to do.

Security Measure #10 – Use WordPress Security Plugins

A number of great WordPress security plugins are available that will address most security issues WordPress site owners face, such as preventing hackers from gaining access to vital information about your site, protecting your site from brute-force attacks, preventing unauthorized file uploads, etc.

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

SecureScanPro - security software solution for WordPress

(SecureScanPro – total security software 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 security plugin you may want to consider using is BlogDefender.

Blog Defender WordPress Security Suite

Blog Defender Security Solution For WordPress(Blog Defender)

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

BlogDefender scans you website for security holes …

Blog Defender Security Solution For WordPress Websites & BlogsAnd then shows you how to fix these quickly …

Blog Defender Security Plugin For WordPress WebsitesIf you don’t want to invest in 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 very secure web platform, but neglecting simple maintenance tasks like keeping your WP 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, website security is something you simply cannot ignore.

As one last 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, website security is very important if you run a WordPress site. Hopefully, the above information has shown you what to do to keep your WordPress site protected from brute force attacks. If you need any further help or assistance with WordPress security, please seek help from a professional WordPress security specialist, or search for a WordPress service provider in our WordPress Services Directory.

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

***

"These tutorials have so much information and are easy to understand. If you use WordPress or plan to in the future these will help you with everything you need to know." - Valisa (Mesa, Arizona)

***

Originally published as How To Protect Your WordPress Site From A Brute-Force Attack.