![]() |
Blocking IPs |
Post Reply ![]() |
Page 12> |
Author | |
Logistix ![]() Newbie ![]() Joined: 30-July-2008 Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() Posted: 30-July-2008 at 9:09am |
Hello all,
After doing some research, I've successfully managed to block IPs accessing my store. Simply edit Default.asp to read as follows:
<%
If Request.ServerVariables("Remote_Addr") = "xxx.xxx.xxx.xxx" Then Response.End End if If Request.ServerVariables("Remote_Addr") = "xxx.xxx.xxx.xxx" Then Response.End End if 'redirect to home page Response.Redirect("pc/home.asp") %> Add additional code for additional IPs:
If Request.ServerVariables("Remote_Addr") = "xxx.xxx.xxx.xxx" Then
Response.End End if Hope this helps some of you out there! Edited by Logistix - 30-July-2008 at 10:11am |
|
![]() |
|
macleather ![]() Newbie ![]() Joined: 23-June-2008 Location: Los Angeles Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() |
Logistix, I don't mean to sound dense, but why do you want to block IP addresses? Are you having problems with some surfers?
Just curious. Alan |
|
![]() |
|
Stuck ![]() Groupie ![]() ![]() Joined: 09-March-2007 Location: United States Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() |
I would sure like to block a copycat competitor or two (If I knew how to do it without blocking potential customers at the same time)!
![]() |
|
![]() |
|
Hamish ![]() Admin Group ![]() Joined: 12-October-2006 Location: United Kingdom Status: Offline Points: 56 |
![]() ![]() ![]() ![]() ![]() |
Hi,
This may work, but is easy to circumvent, If they realise the cause of course! They just need to access the site from elsewhere, use an proxy server, or if they have a dynamic IP address they will be straight in next time they get a new IP address. |
|
![]() |
|
macleather ![]() Newbie ![]() Joined: 23-June-2008 Location: Los Angeles Status: Offline Points: 3 |
![]() ![]() ![]() ![]() ![]() |
Stuck,
Good point, I didn't think of the havoc a unscrupulous competitor could cause. ![]() Alan |
|
![]() |
|
Logistix ![]() Newbie ![]() Joined: 30-July-2008 Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() |
@Alan - It appears someone is spamming my website (for whatever reason) and the attacks seem to be coming from set IPs.
The solution isn't perfect, but because I don't have access to IIS, it's the next best thing. All my logon pages require a security code, and I have setup my control panel to alert me if x amount of invalid attempts are made. This is how I know my site is being targetted.
|
|
![]() |
|
Hamish ![]() Admin Group ![]() Joined: 12-October-2006 Location: United Kingdom Status: Offline Points: 56 |
![]() ![]() ![]() ![]() ![]() |
Hi Logistix,
When you say "spam" your site - I assume they are trying to get in via the logon pages? In which case blocking them is a great idea. You may want to block whole subnets, assuming that the subnets in question are outside your target geographical market. Another instance where you may wish to block specific IP addresses is if you use Google Ads and someone is carrying out click fraud against your adverts. We have discovered very suspicious activity on one of our clients ad campaigns just today. Google provide a tool to prevent the ads being served to specified IP addresses. |
|
![]() |
|
Logistix ![]() Newbie ![]() Joined: 30-July-2008 Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() |
|
|
![]() |
|
Hamish ![]() Admin Group ![]() Joined: 12-October-2006 Location: United Kingdom Status: Offline Points: 56 |
![]() ![]() ![]() ![]() ![]() |
Hi Logistix,
I'm in the UK as well. IP addresses were handed out in "blocks" to ISP's all round the world, so I don't think there is a simple way of blocking whole countries, BUT you can block whole IP ranges, or rather subnets. A quick bit of googling reveals there are 91,000+ blocks of IP addresses by country - so It's best to target the specific IP or IP range that's causing you trouble. www.aspfaqs.com/ASPscripts/PrintFAQ.asp?FAQID=179 I use a Whois program from Karen Kenworthy (www.karenware.com) to look up IP addresses as this tells me the IP range the address is part of as well as the origin. As an example the random IP address : 87.212.134.19 gives a result of :- inetnum: 87.212.128.0 - 87.212.159.255 netname: VERSATEL-CONSUMER-2 descr: Versatel Consumer is one of the largest ISP's in the Netherlands If you really wanted to block the WHOLE of this range you could try code like :- RemAddr = Request.ServerVariables("Remote_Addr") If (RemAddr >= "87.212.128.0") and (RemAddr <= "87.212.159.255") Then Response.End End if As an aside, whilst writing this I came across : www.proxyserverprivacy.com/ipaddress_range.php where you can get lists of IP address ranges by country. If it's a really important issue you could use a service such as the one provided by GeoIP.com - which provide a DB and API's to allow you to check IP addresses against the DB. |
|
![]() |
|
Logistix ![]() Newbie ![]() Joined: 30-July-2008 Status: Offline Points: 0 |
![]() ![]() ![]() ![]() ![]() |
Thanks for that Hamish very useful info :)
|
|
![]() |
Post Reply ![]() |
Page 12> |
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |