Some kind of script to detect if IP is a proxy?

Discussion in 'PHP' started by FFMG, Apr 7, 2009.

  1. #1
    Hi,

    Is there a script that would allow me to detect if the visitor is using a proxy or not.
    I want to prevent my signup page from been used by proxy users.

    I know that there are hundreds of proxies around, but anything is better than the 2500 'spam' signups I get a day.

    I use http://recaptcha.net/ on many pages but the signup process spans over 4 pages, so it cannot be used.

    Any suggestions?

    FFMG
     
    FFMG, Apr 7, 2009 IP
  2. ActiveFrost

    ActiveFrost Notable Member

    Messages:
    2,072
    Likes Received:
    63
    Best Answers:
    3
    Trophy Points:
    245
    #2
    <?php
    if (isset($_SERVER['HTTP_X_FORWARDED'])) {
    	echo "You are behind a proxy!";
    } else {
    	echo "No proxies detected!";
    }
    ?>
    PHP:
    However, not everything can be detected :)
     
    ActiveFrost, Apr 8, 2009 IP
  3. Freewebspace

    Freewebspace Notable Member

    Messages:
    6,213
    Likes Received:
    370
    Best Answers:
    0
    Trophy Points:
    275
    #3
    But it does n't work always..

    Some times it might not allow a genuine signup..
     
    Freewebspace, Apr 8, 2009 IP
  4. ActiveFrost

    ActiveFrost Notable Member

    Messages:
    2,072
    Likes Received:
    63
    Best Answers:
    3
    Trophy Points:
    245
    #4
    I already said - not everything can be detected .. I know that there are a few ISP's where your connection goes through a proxy server ( unique IP, unique user, but .. forwarded .. ) !
     
    ActiveFrost, Apr 8, 2009 IP
  5. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I think the only way to do it is to compare against a list of known public proxies.

    Otherwise you have two problems:

    1) You exclude legitimate users who are connecting through proxies at their workplaces, etc.

    2) You fail to detect the majority of proxies, which don't add any header to advertise their role in the transaction.
     
    SmallPotatoes, Apr 8, 2009 IP
  6. FFMG

    FFMG Well-Known Member

    Messages:
    1,091
    Likes Received:
    39
    Best Answers:
    0
    Trophy Points:
    160
    #6
    Ideally I would query their IP to a database of proxies.
    That way I could easily find the proxies.

    I cannot really rely on the headers that are been passed.

    FFMG
     
    FFMG, Apr 8, 2009 IP
  7. harrisunderwork

    harrisunderwork Well-Known Member

    Messages:
    1,005
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    135
    #7
    But that also cannot guarantee complete success.
     
    harrisunderwork, Apr 8, 2009 IP
  8. FFMG

    FFMG Well-Known Member

    Messages:
    1,091
    Likes Received:
    39
    Best Answers:
    0
    Trophy Points:
    160
    #8
    What cannot???

    FFMG
     
    FFMG, Apr 8, 2009 IP
  9. harrisunderwork

    harrisunderwork Well-Known Member

    Messages:
    1,005
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    135
    #9
    Because, for that you will need exact database of proxies, and it is very difficult to find such a database.
     
    harrisunderwork, Apr 9, 2009 IP