How to Ban an IP Address?

Discussion in 'ASP General' started by Victor, Sep 24, 2006.

  1. Victor

    Victor Guest

    Is it possible to ban an IP address from global.asa, or by another method?

    On a shared server, I'm seeing someone from China that appears to be trying to access my
    site illegally (trying to access server root via cgi-bin).

    Can I test for the user from global.asa and then execute a Response.End? Or is there
    another way?

    Thanks!
     
    Victor, Sep 24, 2006
    #1
    1. Advertising

  2. Victor

    Evertjan. Guest

    Victor wrote on 24 sep 2006 in microsoft.public.inetserver.asp.general:

    > Is it possible to ban an IP address from global.asa, or by another
    > method?


    see below

    > On a shared server, I'm seeing someone from China that appears to be
    > trying to access my site illegally (trying to access server root via
    > cgi-bin).


    Why would that be illegal?

    It is only illegal, if the "perpetator" is acting illegally according to
    the laws in his or her country.

    > Can I test for the user from global.asa and then execute a
    > Response.End? Or is there another way?


    You could test in session_onstart:

    <%
    q = request.servervariables("remote_addr")
    If q = "123.456.789.123" then Session.Abandon:Response.End
    %>


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Sep 24, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. www.gustando.net

    GOogle ban

    www.gustando.net, Dec 19, 2005, in forum: HTML
    Replies:
    5
    Views:
    515
    PeterMcC
    Dec 22, 2005
  2. Alien
    Replies:
    8
    Views:
    352
    Alien
    Jul 5, 2006
  3. Xah Lee

    Ban Xah Lee

    Xah Lee, Mar 7, 2009, in forum: Java
    Replies:
    41
    Views:
    1,433
    RedGrittyBrick
    Sep 2, 2009
  4. Xah Lee

    Ban Xah Lee

    Xah Lee, Mar 7, 2009, in forum: Python
    Replies:
    53
    Views:
    2,027
    markspace
    Sep 1, 2009
  5. Sun
    Replies:
    0
    Views:
    140
Loading...

Share This Page