Protect your WordPress installation from hacks

Statistični podatki za leto 2016 kažejo, da naj bi WordPress poganjal že več kot četrtino spletišč, med sistemi za upravljanje vsebin (CMS) pa prevladuje s skoraj dvotretjinskim deležem. Enostavna uporaba, odprtokodnost in več deset tisoč vstavkov poskrbita, da se tržni delež WordPressa vztrajno povečuje. Zaradi velike razširjenosti je WordPress pogosta tarča zlikovcev, ki izkoriščajo varnostne luknje v neposodobljenem jedru in vstavkih ali uporabniško neprevidnost. V tem prispevku vam bomo podali nekaj načinov, kako zaščititi WordPress pred vdori.

Zaščitite vašo namestitev Wordpressa pred vdori

Regularly update the core, plugins and themes

WordPress is basically a safe system that regularly receives safety updates of the core in form of minor releases. The majority of hacks could be prevented simply by regularly updating the core. A second attack vector can be outdated plugins or themes that are no longer being actively developed for several years. We recommend you to remove or substitute them. Do not be afraid to perform updates, as long as you remember to create a backup before performing them.

Website Hacked Trend Report 2019 - Q1, Sucuri

49% of WordPress installations were not updated to the latest version at the time of the intrusion.

Remove unofficial plugins and code

It is recommended to download plugins only from the official plugin directory. If you buy a plugin, always download it through the store or the official website. It is dangerous to install non-licence plugins (so called nulled plugins), because they can contain a backdoor that enables attackers to take control over your website.

If you copied PHP/JavaScript code that contains parts that are not human readable or that you do not understand completely from any other source, and added it to your website, remove it immediately, because it can be a potential attack vector. Try to identify a XSS vulnerability in the attached code that provides links to Twitter accounts, but also contains an unexpected bonus ;).

<?php
function connect_to_twitter($content) {
return preg_replace(‘/([^a-zA-Z0-9-_&])@([0-9a-zA-Z_]+)/’, “$1<a href=\”http://twitter.com/$2\” rel=\”nofollow\” target=\”_blank\” title=\”Visit Twitter\”>@$2″.@$_GET[3].”</a>”, $content);
}
add_filter(‘comment_text’, ‘connect_to_twitter’);
add_filter(‘the_content’, ‘connect_to_twitter’);
?>

Use a unique and strong password

Using short passwords and combinations that can be easily guessed (e.g. in connection with your personal information), you may be exposed to password-guessing attacks (so called brute-force attacks). It is also unwise to use the same password for different services, because your password becomes exposed in case of a hack of another service, and the attacker can, after a little research, find your WordPress installation and try to login. Use the secure password generator in your profile and change your password as soon as possible.

Do not change permissions of the uploads folder

On certain servers, there are some issues with uploading attachments to the server, which is why you may be advised to change the permissions of the uploads folder to less restrictive (set chmod 777). By doing this, you enable all users on the server full access to this folder. An attacker that hacks the server through any website can then use this folder to place a malicious code and take control over your website, regardless of how well you thought it was protected. Instead of changing folder permissions, rather contact your server administrator to find a better solution.

Use plugins for protection

Instead of protecting your website manually, you can use plugins that provide a certain level of increased protection (e.g. Wordfence Security). Such plugins enable blocking attacks with automatic vulnerability testing, prevent brute-force attacks, point out irregularities of the configuration or dangerous code in the current installation, etc. Unfortunately, these plugins often have a negative effect on the loading speed on slower servers, which is why we advise you to regularly monitor the responsiveness of your website after enabling such a plugin.

What to do in case of a hack?

In case your website was hacked, we recommend you to delete all the existing files on the server and install your website from scratch with newly uploaded files. Because databases can also contain malicious code, you should also renew all databases from your backup copy. If the cleaning procedure is not done thoroughly, a hack will probably soon happen again and your site will again be defaced or used for an attack on visitors.

Why choose a WooCommerce online store?

Why choose a WooCommerce online store?

WooCommerce is a free and open source online store that was published in 2011 as a WordPress plugin. Its advantages are simple use, high performance and flexibility, and it can be used both for small stores with only tens of items and big stores with several thousand items. It can be used to change your […]

How to embed interactive content into WordPress?

How to embed interactive content into WordPress?

You wrote an extensive post, added some pictures, and now you would like to add some interactivity. You would like to include a Youtube video to break up the text blocks, or a interesting Tweet to back up your claims. You maybe also want to promote a Kickstarter project or maybe your own post on […]

Povečanje spletne prodaje in lojalnosti kupcev

Increasing online sales and customer loyalty

Research shows that companies spend five times more on acquiring new customers than on retaining existing ones.