ProductCart E-Commerce Solutions Homepage
Forum Home Forum Home > ProductCart > Customizing ProductCart
  New Posts New Posts RSS Feed - Blocking IPs
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Blocking IPs

 Post Reply Post Reply Page  12>
Author
Message
Logistix View Drop Down
Newbie
Newbie


Joined: 30-July-2008
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote Logistix Quote  Post ReplyReply Direct Link To This Post Topic: Blocking IPs
    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
Back to Top
macleather View Drop Down
Newbie
Newbie


Joined: 23-June-2008
Location: Los Angeles
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote macleather Quote  Post ReplyReply Direct Link To This Post Posted: 30-July-2008 at 2:29pm
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


Back to Top
Stuck View Drop Down
Groupie
Groupie
Avatar

Joined: 09-March-2007
Location: United States
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote Stuck Quote  Post ReplyReply Direct Link To This Post Posted: 30-July-2008 at 3:36pm
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)! Thumbs%20Up
Back to Top
Hamish View Drop Down
Admin Group
Admin Group


Joined: 12-October-2006
Location: United Kingdom
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hamish Quote  Post ReplyReply Direct Link To This Post Posted: 30-July-2008 at 4:08pm
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.
Back to Top
macleather View Drop Down
Newbie
Newbie


Joined: 23-June-2008
Location: Los Angeles
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote macleather Quote  Post ReplyReply Direct Link To This Post Posted: 30-July-2008 at 4:11pm
Stuck,

Good point, I didn't think of the havoc a unscrupulous competitor could cause. Ouch

Alan
Back to Top
Logistix View Drop Down
Newbie
Newbie


Joined: 30-July-2008
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote Logistix Quote  Post ReplyReply Direct Link To This Post Posted: 31-July-2008 at 9:30am
@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.
Back to Top
Hamish View Drop Down
Admin Group
Admin Group


Joined: 12-October-2006
Location: United Kingdom
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hamish Quote  Post ReplyReply Direct Link To This Post Posted: 31-July-2008 at 9:46am
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.
 
Back to Top
Logistix View Drop Down
Newbie
Newbie


Joined: 30-July-2008
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote Logistix Quote  Post ReplyReply Direct Link To This Post Posted: 31-July-2008 at 10:03am
Originally posted by Hamish Hamish wrote:

When you say "spam" your site - I assume they are trying to get in via the logon pages?
That's correct, specifically contact.asp more than anything which is really odd. I used to have Google Ads but not anymore...
How would I go about blocking a range of IPs or entire countries? I am based in the UK and 99% of business is based in the UK.
Back to Top
Hamish View Drop Down
Admin Group
Admin Group


Joined: 12-October-2006
Location: United Kingdom
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hamish Quote  Post ReplyReply Direct Link To This Post Posted: 31-July-2008 at 10:54am
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.

Back to Top
Logistix View Drop Down
Newbie
Newbie


Joined: 30-July-2008
Status: Offline
Points: 0
Post Options Post Options   Thanks (0) Thanks(0)   Quote Logistix Quote  Post ReplyReply Direct Link To This Post Posted: 31-July-2008 at 1:22pm
Thanks for that Hamish very useful info :)
Back to Top
 Post Reply Post Reply Page  12>
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.094 seconds.