IP Return

Discussion in 'PHP' started by damier, Jul 10, 2006.

  1. #1
    Howdy,

    I've currently got a script that returns the users IP/Hostmask like so

    <div align="center">
    
    Your IP Address is<br>
    <? echo getenv('REMOTE_ADDR'); ?><br>
    
    Your Hostname is<br>
    <?php
    
    $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
    echo $hostname;
    
    ?><br>
    
    Code (markup):
    However, due to some research on php.net and other websites, the headers of a proxy can be faked thus getenv('REMOTE_ADDR'); getting the fake IP, is there a way to bypass this and get the TRUE IP like whatismyip.com/.org does?
     
    damier, Jul 10, 2006 IP
  2. sketch

    sketch Well-Known Member

    Messages:
    898
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    148
    #2
    whatismyip.com doesn't fetch true IPs either. I just tried it thru cgi-proxy.net and it gave me the wrong IP.

    I don't think there's a 100% accurate server-side method of tracking down the true IP. It would require something like a Java applet which can get the IP from the client's side.
     
    sketch, Jul 10, 2006 IP
  3. sandossu

    sandossu Guest

    Messages:
    2,274
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    0
    #3
    There is no method to get the true ip behind an elite/high anonymity proxy
     
    sandossu, Jul 10, 2006 IP
  4. damier

    damier Active Member

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    61
    #4
    Ok,

    Maybe not elite/high anonymity proxies, but maybe transparent?
     
    damier, Jul 10, 2006 IP
  5. sandossu

    sandossu Guest

    Messages:
    2,274
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    0
    #5
    i think there`s a way to see the ip nehind a transparent proxy. Anyway, at least you can see it`s a proxy. But if it`s an elite one, you can see it`s a proxy, it looks just like a true ip
     
    sandossu, Jul 10, 2006 IP
  6. damier

    damier Active Member

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    61
    #6
    Anyone wanna conjure up a script with reference to the comments posted on hxxp://php.net/getenv
     
    damier, Jul 10, 2006 IP
  7. deny

    deny Active Member

    Messages:
    365
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #7
    You can detect proxy with good script.Take for example site
    Proxy Server Privacy
    and look to the link Detector Proxy.
    You will see two ways of detecting proxy.
    First has been done with simple proxy variables detecting script and second one with common proxy port inspecting script.
    The same script has been integrated into contact form.If you try
    Contact
    behind proxy you will get message to disable proxy and try again.
     
    deny, Jul 11, 2006 IP