{"id":989,"date":"2014-06-27T09:59:52","date_gmt":"2014-06-27T13:59:52","guid":{"rendered":"http:\/\/www.blogseye.com\/?p=989"},"modified":"2014-06-27T09:59:52","modified_gmt":"2014-06-27T13:59:52","slug":"ive-started-banning-whole-countries","status":"publish","type":"post","link":"http:\/\/blogseye\/2014\/06\/ive-started-banning-whole-countries.html","title":{"rendered":"I’ve Started Banning Whole Countries"},"content":{"rendered":"

I have been writing programs to analyze my web server logs. My hosting company penalizes me for PHP executions and charges more if I have too much traffic. I had to start blocking IP address. Next, I started adding ranges of IP addresses, and today I’ve started adding countries.<\/p>\n

My analysis shows that 100% of all traffic from Russia and China has been comment spam, password guessing robots, exploit testers, or crawlers looking for something on my web pages. I received no legitimate hits on my websites that I could find from Russia or China.<\/p>\n

I now have about 25% of the original traffic on my sites, but my analysis has shown no loss in real people – the people who click links and buy stuff from my websites. At least 75% of the hits on my sites were from spam an other malicious robots.<\/p>\n

Now, whenever I see more than 100 hits from a website, I look up the IP at lacnic.net<\/a> and ban the whole subnet. Here is an example from my .htaccess file.<\/p>\n

# EVERHOST Internet Service Provider ro
\ndeny from 188.240.128.0\/20<\/p>\n

This is hosting company in Romania. They deserve to be banned. There is no way a program running on a hosting company should be accessing my site.<\/p>\n

Here is another:<\/p>\n

# China Mobile Communications Corporation
\ndeny from 117.168.0.0\/14<\/p>\n

This is a huge block coming from China Mobile. I can’t believe that a cell phone is running a robot, so they must offer hosting or a way to use broadband so an infected PC his hitting my site. I have never had a legitimate hit on one of my websites from this block as far as I know.<\/p>\n

I don’t feel bad about blocking a quarter of a million IP numbers from accessing my site. I have tried reporting IP address using the abuse email from their network pages, but either the email bounces or they do nothing about it. Some network admins do something, but most just open a ticket and the hits keep coming. My plugin to report spam to networks was a total waste of time.<\/p>\n

Today I banned the entire country of Bulgaria., and I think I will also ban Ukraine. I get lots of repeat offenders from these countries.<\/p>\n

My spam software automatically adds anything detected by Akismet or Stop Spammers. I get lots of hits which result in things like this in my .htaccess file:<\/p>\n

deny from 87.229.177.122<\/p>\n

This is an ISP in Russia:<\/p>\n

111250 Russia SOVINTEL\/EDN et SovamTelePort
\np2p and static IP pool for (xEthr, xDSL, Wi-Fi .. )<\/p>\n

If I report to their abuse, I get an email telling me that my request must be in Russian. I need to add:<\/p>\n

deny from 87.229.176.0\/21<\/p>\n

to my .htaccess file. This would kill access by a whole bunch of Russians.<\/p>\n

There comes a time when I sort the .htaccess file and notice dozens of bad hits on IPs starting with 87.229. That’s when I need to ban large blocks, and now sometimes whole countries.<\/p>\n

 <\/p>\n","protected":false},"excerpt":{"rendered":"

I have been writing programs to analyze my web server logs. My hosting company penalizes me for PHP executions and charges more if I have too much traffic. I had to start blocking IP address. Next, I started adding ranges of IP addresses, and today I’ve started adding countries. My analysis shows that 100% of […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/posts\/989"}],"collection":[{"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/comments?post=989"}],"version-history":[{"count":1,"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/posts\/989\/revisions"}],"predecessor-version":[{"id":990,"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/posts\/989\/revisions\/990"}],"wp:attachment":[{"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/media?parent=989"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/categories?post=989"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/tags?post=989"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}