Block countries to prevent attacks on your site

If you spend any time monitoring the security of your Internet servers you may have noticed that in recent years the majority of hacking attempts and surveillance queries are coming from IP addresses originating in specific countries. These countries are becoming the most common and pervasive furthermore recently Google has expressed serious concerns about hacking attempts originating from countries such as China, Nigeria and Russia for example.

Blocking country access

Fortunately, blocking access is not hard to do. We'll be covering using an .htaccess file with your hosting account.

Works? Since we started blocking certain country traffic to our Web sites there has been a significant decrease in the number of hacking probes directed at us. At the end of the day the choice is yours.

The method of blocking Web traffic from a source is done with deny statements in Apache's .htaccess file. A short example of using this method of blocking is shown below. Your .htaccess file is found in the root folder of your hosting account. Example directives as below are added in all Site Source Solution hosting accounts by default, look for the code below.

order allow,deny
allow from all
deny from 65.19.146.2 220.248.0.0/14

Adding these statements shown above to a .htaccess file on your hosting account will block a single address (65.19.146.2) and an entire range of addresses specified by a CIDR block (220.248.0.0/14). For up to date lists (which you should use) we use the following resources:

Esta resposta lhe foi útil? 38 Usuários acharam útil (38 Votos)

Powered by WHMCompleteSolution