Forum Moderators: phranque

Message Too Old, No Replies

How to ban IP addresses from China?

         

zaza

5:23 pm on Jun 2, 2008 (gmt 0)

10+ Year Member



How can i ban china on windows server IIS6 any idea any one?
Im bored to see on log files atempts to inject the MSSQL server...

P.S: im jealous all the others with .htaccess

topr8

5:28 pm on Jun 2, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



you need to have a database which matches ipaddresses to countries.

there are some available both commercially and for frre online

then you need to grab the requesting ip address, compare it to the database and see what country it is from

zaza

5:31 pm on Jun 2, 2008 (gmt 0)

10+ Year Member



any specific suggestion?

topr8

7:14 pm on Jun 2, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



i'm not affiliated with them! but i personally use:
ip2location.com

they update the database every month and you can download it again - you subscribe by the year. it works well for me, i am on iis and i have an include file on every page which checks the user ip and if it comes from china i serve a 404
... however be aware that a chinese user can go through a non chinese proxy, however it has cut out a lot of the injection attempts that you talk about.

as i say i know there are open source projects which are free and supply an ip address to country database, however i have no personal experience of them but am sure someone else will step into this thread with the appropriate info.

bill

2:33 am on Jun 3, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



P.S: im jealous all the others with .htaccess

ISAPI_Rewrite will alleviate that jealousy.

zaza

11:04 am on Jun 3, 2008 (gmt 0)

10+ Year Member



do u mean this? : [webmasterworld.com...]
I heard about that once upon a time but was for iis5, for iis6 no garanties...
I googled ISAPI_Rewrite and the first company - result was closed :(
do you now of any other url-rewrite any suggestion welcome. (with the url - link to it, if allowed here).

zaza

11:16 am on Jun 3, 2008 (gmt 0)

10+ Year Member



Thanx topr8 but yearly subscription is to depended for me. if they close down?
we r on were we started
Thanx any way for ur reply :)

topr8

11:20 am on Jun 3, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



you can't use .htaccess (or isapi_rewrite) to magically block china!

you still need other data

zaza

11:35 am on Jun 3, 2008 (gmt 0)

10+ Year Member



I don’t need something magic, that i need is to instruct the IIS to block requests from some networks ie. 123.6.227.158 this ip and others from that network 123.4.0.0 - 123.7.255.255 has over 200 tries to inject, right now i block single ip to prevent any damage. that i need is to have something :) and say not allow connections from that range 123.4.0.0 - 123.7.255.255. Thank u:)

miaoux

4:55 am on Jun 5, 2008 (gmt 0)

10+ Year Member



Geolocation databases okay? Search for that to get free databases with current 'China' IPs by name, or whatever. The immediate results will deal with what you need right now.