Get User's Real IP Address

Discussion in 'Programming' started by ketan9, Dec 23, 2006.

  1. #1
    I thought Programming would be the best place to get answer to this question as it can be done through several ways in different programming languages, but the concept still stays the same.

    I want to find the user's ip address, the real ip address. If a user is using the proxy, I want to know the proxy ip address as well as the real ip address behind the proxy. Is it possible? I am open to take answers in PHP or Javascript.


    How can I find it or is it just not possible?
     
    ketan9, Dec 23, 2006 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
  3. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #3
    Proxies wouldn't be much good if they didn't hide ip addresses......
     
    krakjoe, Dec 23, 2006 IP
    Cheap SEO Services likes this.
  4. Cheap SEO Services

    Cheap SEO Services <------DoFollow Backlinks

    Messages:
    16,664
    Likes Received:
    1,318
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I don't think it's possible. That's the sole reason why proxies are made.

    Col :)
     
    Cheap SEO Services, Dec 23, 2006 IP
  5. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #5
    You can, only if you are the owner of such proxy :p

    Peace,
     
    Barti1987, Dec 23, 2006 IP
  6. streety

    streety Peon

    Messages:
    321
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I disagree with you and krakjoe on this, anonymity is not the sole reason why proxies are made, I wouldn't even say they are the main reason.

    Proxies can be used to cache content, speeding up the request, to block offensive content, reformat pages for certain devices such as PDAs and cell phones or protect against computer viruses. All of these things can be done with providing any anonymity to the user.

    Anonymous proxies do get a lot of attention though and if a visitor to your site is using an anonymous proxy you won't be able to get their real ip address.

    If on the other hand they are using a non-anonymous proxy you can normally get both the proxies ip address and the ip address of the actual visitor. See the threads posted by nico for info
     
    streety, Dec 24, 2006 IP
  7. frankcow

    frankcow Well-Known Member

    Messages:
    4,859
    Likes Received:
    265
    Best Answers:
    0
    Trophy Points:
    180
    #7
    I believe there's a server variable called FORWARDED_IP or something very similar

    It's not always present though
     
    frankcow, Dec 25, 2006 IP
  8. frankcow

    frankcow Well-Known Member

    Messages:
    4,859
    Likes Received:
    265
    Best Answers:
    0
    Trophy Points:
    180
  9. Freewebspace

    Freewebspace Notable Member

    Messages:
    6,213
    Likes Received:
    370
    Best Answers:
    0
    Trophy Points:
    275
    #9
    and whether any body tested out this from a proxy as I want to know the results as it can be used to prevent the spam in directories

    and

    Sorry to all I tested it out and found that it does not show the real ip address
     
    Freewebspace, Dec 25, 2006 IP
  10. frankcow

    frankcow Well-Known Member

    Messages:
    4,859
    Likes Received:
    265
    Best Answers:
    0
    Trophy Points:
    180
    #10
    like I said, that variable will not always be present, it depends on the proxy software
     
    frankcow, Dec 25, 2006 IP
  11. deny

    deny Active Member

    Messages:
    365
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #11
    If the proxy is anonymous you will never get a real ip address. Only transparent (non anonymouys) servers spill visitors ip address because presence of X_FORWARDED_FOR variable show they original ip address.
    However it is possible to detect of visitors is behind proxy server even if they use (high) anonymous servers through checking IP on most common proxy ports.
    Take a look:
    Proxy Server Detection
     
    deny, Dec 26, 2006 IP
  12. Freewebspace

    Freewebspace Notable Member

    Messages:
    6,213
    Likes Received:
    370
    Best Answers:
    0
    Trophy Points:
    275
    #12
    I sed this also and I found that my real ip address is not being shown

    I can get only the ip address of the host

    I used this proxy

    www.blockmy.info
     
    Freewebspace, Dec 27, 2006 IP
  13. Litho

    Litho Peon

    Messages:
    105
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #13
    If you have a good proxy, they will not give away any information at all.

    The example above is a good one.
     
    Litho, Dec 27, 2006 IP
  14. Freewebspace

    Freewebspace Notable Member

    Messages:
    6,213
    Likes Received:
    370
    Best Answers:
    0
    Trophy Points:
    275
    #14
    That means we can idetify the real ip address from some proxies if their script is not upto the mark and if you can provide me with some other

    proxies where I can see the users Real IP address via this script
     
    Freewebspace, Dec 27, 2006 IP
  15. livingearth

    livingearth Well-Known Member

    Messages:
    1,469
    Likes Received:
    83
    Best Answers:
    0
    Trophy Points:
    140
    #15
    I take it from the above information that it should be possible to block access to visitors who are using proxies and thus prevent them from spamming your directories?
     
    livingearth, Dec 27, 2006 IP
  16. frankcow

    frankcow Well-Known Member

    Messages:
    4,859
    Likes Received:
    265
    Best Answers:
    0
    Trophy Points:
    180
    #16
    yes, but that may also block users who are behind company firewalls
     
    frankcow, Dec 27, 2006 IP
  17. kavinga

    kavinga Well-Known Member

    Messages:
    188
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    110
    #17
    This might help

    <?php 
    // use this script to detect whether a user is using a 
    //proxy server to connect to your website.
    
    echo "Proxy Detector";
    
    if(isset($HTTP_X_FORWARDED_FOR))
    {
    	if ($HTTP_X_FORWARDED_FOR) 
    	{ 
    	// proxy detected...
    	?>
    
    	Proxy Detected...
    
    	Your Actual IP Address: 
    	<?= $HTTP_X_FORWARDED_FOR ?>
    
    	Your Proxy Server: 
    	<?= $HTTP_VIA ?>
             You Proxy I.P address: <?= $REMOTE_ADDR ?>
    
    	<?
    	}
    }
     else 
    	{ 
    	// no proxy detected
    	?>
    	
    	No Proxy Detected
    	
    	Your Actual IP Address:
    	<?= $REMOTE_ADDR ?>
    	
    	<?
    } 
    ?>
    HTML:
    I found this when I searching google :p
     
    kavinga, Jan 16, 2007 IP
  18. Nestrer

    Nestrer Well-Known Member

    Messages:
    1,663
    Likes Received:
    103
    Best Answers:
    0
    Trophy Points:
    135
    #18
    Nestrer, Jan 17, 2007 IP
  19. sukantab

    sukantab Well-Known Member

    Messages:
    2,075
    Likes Received:
    49
    Best Answers:
    0
    Trophy Points:
    110
    #19
    This is surely possible. Otherwise people would have gone to their sites thru proxy and clicked on their own ads and generated revenue.

    GOogle mentiones they check real ip addresses. I can't remember where I read it.
     
    sukantab, Jan 19, 2007 IP
  20. Nestrer

    Nestrer Well-Known Member

    Messages:
    1,663
    Likes Received:
    103
    Best Answers:
    0
    Trophy Points:
    135
    #20
    Google don't check real ip, but a proxy list.
    To get real ip, they much ctrl the proxy server first.
     
    Nestrer, Jan 19, 2007 IP