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 leading content management system and the online publishing platform of choice used by millions of businesses and loved by thousands of web developers and website designers, it’s inevitable that at some point in time, WordPress will become a prime target for attacks from hackers.

In early 2013, WordPress installations around the world were subjected to large-scale brute-force attacks.

These attacks were caused by networks of infected computers programmed to attack other vulnerable installations (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)

One of the many ways hackers will attempt to break into a WordPress site is by trying to guess the site’s administration login username and password. This is achieved with software programs and scripts that can guess hundreds of possible login combinations in minutes.

If you’re not using strong usernames or unguessable passwords, your site could be easily hacked by repeated attempts to work out your site’s login details.

This is called a “brute force” login 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 private computers that have been compromised and infected with malicious code or software, which are then controlled remotely as a group, typically without the unsuspecting computer owners even being aware that this is happening.

Botnets are regularly used to blast mass spam emails.

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

ZeuS is a botnet that has been actively compromising 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)

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

Coverage of this brute-force attack was reported by all 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

(WordPress powers millions of sites around the world, which makes it a frequent target for hacking)

Does This Mean We Should Stop Using WordPress?

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

To learn what makes WordPress a very secure web platform, read this article: Is WordPress A Secure Website Platform?

Important

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

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

How To Protect Your WordPress Site From Being Brute Force Attacked – 10 Security Points

Every web site with a security vulnerability offers some value to hackers. A compromised website not only presents newbie hackers opportunities to improve their skills and win “respect” from their peers, but it can also be a resource for DDoS attacks, distributing malware and defrauding users through information theft.

If someone can find a way to break in and take over your website, your blog can then be employed as a “bot” to attack other valued web sites.

Additional undesirable consequences of having your website hacked include being blacklisted by Google, having spammy links promoting things like viagra, porn, etc. in your content, redirecting visitors to phishing sites and other websites, drive-by downloads (adding malicious programs on your visitors’ computers), and lots of other nasties.

The reality is that software-driven bots are most likely scouring for vulnerabilities and trying to break into your website at this very moment. Whether they will successfully break into your site or not, will depend on how difficult you can make things for hackers and botnets to continue persisting until they discover how to get access, or decide to look for an easier target.

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

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

Hackertarget - Website Security Scan(Hackertarget – WordPress Security Scan Product image source: Hackertarget.com)

You will see that the test will yield a number of results and details about your site …

Hackertarget - WP Security Check

(Hackertarget – website security check results. Product image source: Hackertarget.com)

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

Hackertarget - WordPress Security Check(Product image source: Blog Defender)

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 are all potentially useful information to hackers, as this can inform them about any exploitable security vulnerabilities, especially in older versions.

If your site or blog is driven by WordPress and you’re not proactive steps to toughen up your site, then it’s practically guaranteed that, at some point, 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, site owners can discover much to their dismay that they have been “locked out” of their own site, or notice that their files have been vandalized or even entirely wiped out. Typically, most compromised sites will be infected with malicious software or viruses without the owner even being aware that this has occurred.

To help avoid the heartache and frustration (and significant loss of valuable business data) of having your website or blog being hacked into, we have listed below ten simple, yet essential and effective security measures that will help to protect your WordPress site from being attacked by brute-force botnets.

Useful Info

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

***

Security Measure #1 – Contact Your Host

Contact your web host and ask them exactly what measures are in place to protect your site from brute force attacks, and what is done to ensure that your server files are regularly being backed up.

Check that your host is backing up your sites and that, if disaster strikes, you can quickly and easily recover your site.

Security Measure #2 – Perform Complete WordPress Backups And Keep Your Site Regularly Updated

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

A full WordPress maintenance routine ensures that:

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

A full WP site maintenance routine looks like this …

Maintaining your WP site frequently backed up and updated is vitally important for WordPress security.(Maintaining your WP website frequently backed up and updated is vitally important for WordPress security. Source: WPTrainMe.com)

Again, we cannot stress enough how important maintaining your WordPress web site completely 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 or blog. If you do not want to learn how to do WordPress maintenance yourself, pay a professional to do it but make sure this gets done. Backing up your website is the next most important thing you must do after making sure that your heart is still beating!

If you don’t want to back up your site manually, there are many WordPress plugins you can use. You can read about a WordPress backup plugin that can fully automate your backup process here: Back Up, Clone And Protect Your WordPress Web Sites With Backup Creator WP Plugin

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

the worldwide brute force attack on WordPress is mostly an attempt to compromise website administrator panels and gain access to the site by exploiting installations that used “admin” as their account name.

For security purposes, avoid installing sites with the username admin. This is the first thing hackers will test. If your blog’s username is admin, change this immediately.

We have created a simple step-by-step tutorial that shows you how to change your admin username here: How To Change Your WP Username From Admin To Another Username

Security Measure #4 – Change Your Password

A “brute force” attack occurs when malicious software continually hits a login or password field with different character strings trying to guess the right login combination that will unlock your site.

Unless you put some measure in place to prevent the brute force attack from happening (see further below for a couple of simple and effective suggestions for doing this), the “bot” will just continue attacking your site until it eventually “cracks” the code.

Weak passwords, therefore, are very easy targets for attacks. Make sure that you change your password to something that contains at least eight characters long, with 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 management program like Roboform …

Roboform is a password management program that lets you generate different strong passwords(You can use a password management tool like Roboform to create strong passwords)

For a detailed tutorial for WordPress admin users on how to change your password, go here: How To Reset Passwords In WordPress

Security Measure #5 – Protect 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 options for WordPress.

wp-config.php

(WP Config file)

If a hacker breaks into your website, they will typically search for 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 someone 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 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 – Delete Or Rename Unnecessary Website 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, just rename them.

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

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

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

Security Measure #8 – Disable The WordPress Theme Editor

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

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

WordPress Theme Editor Menu

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

The WordPress theme feature lets anyone accessing your blog’s admin area view and edit your theme template files, and create havoc on your site.

To prevent people from accessing the WordPress Theme editor, you will need to disable it. This can be done by editing your wp-config.php file.

Security Measure #9 – Protect The WordPress Uploads Folder

The “uploads” folder stores all the media files that get uploaded to your website.

By default, this folder is visible to all users online. All a person needs to do to see the contents stored in your “uploads” folder is visit your directory using their web browser …

(WordPress uploads folder)

(WordPress uploads directory)

If any files stored in his folder have vulnerabilities that can be exploited by hackers, this could seriously threaten the security of your website.

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, uploading a blank index.php file (this is literally a blank file named “index.php”) to your uploads directory, and so on. Again, it’s best to ask for assistance from someone who knows what they are doing if you are unsure about what to do.

Security Measure #10 – Install WordPress Security Plugins

Some great WordPress security plugins are available that will address many common security issues faced by WordPress website owners, such as preventing hackers from accessing vital areas of your site, protecting your website from malicious scripts, preventing injections of code into files, etc.

Many 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 files and damaging your site is SecureScanPro.

SecureScanPro - security software for WordPress

(SecureScanPro – security plugin for WordPress)

SecureScanPro is easy to install and easy to use, and fixes 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 Security Plugin For WordPress Websites

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

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

BlogDefender scans you WordPress installation for security holes …

Blog Defender Security Product Suite For WordPress SitesAnd then shows you how to quickly and easily fix these …

Blog Defender Security PluginIf you don’t want to purchase 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 essential maintenance tasks like keeping your WordPress installation, plugins and themes up-to-date, tightening file and data security and taking other necessary precautions can expose your site to attacks by hackers and bots.

Regardless of the type of business you run or plan to run online and how small you think your web presence is, you simply cannot ignore the importance of securing your sites.

As one last reminder, below is the advice given by an expert on web security to all WordPress users following the large-scale brute force attacks by botnets 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, this 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 consult a professional WordPress security specialist, or search for a WordPress technical provider in our WordPress Services Directory.

Also, don’t forget to subscribe to WPCompendium.org to receive notifications whenever we publish new tutorials on WordPress security and tutorials about new security plugins and solutions.

***

"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

***

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