anyway to get real ip address behind proxy?

sohom

Supreme Member
Joined
May 26, 2013
Messages
1,315
Reaction score
608
Website
www.mediabots.net
Hello
is it possible to get real ip address behind proxy?
I need it for an affiliate program
It will be great , if it can be done through php or python

any luck?
 
Someone can correct me on this, but I believe you need to write something in Java to accomplish this. It can be done though.
 
yes, some articles in the net, saying, it needs java/javascript , in that case,what will happen if the bot using a non java browser to view web pages anonymously
 
I posted something that might help:

Code:
http://www.blackhatworld.com/blackhat-seo/php-perl/527166-share-very-simple-script-testing-your-current-proxy-anonymity.html

In a nutshell, you check for the following server variables
Code:
$_SERVER['HTTP_X_FORWARDED_FOR'] , $_SERVER['HTTP_VIA'], $_SERVER['X-REAL-IP'], $_SERVER['HTTP_X_PROXY_ID'] , $_SERVER['HTTP_CLIENT_IP']

If anyone of them are set and having a value, it's a proxy.
 
Last edited:
Try this php code
if (!empty($_SERVER['HTTP_CLIENT_IP']))
{
$ip=$_SERVER['HTTP_CLIENT_IP'];
}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
}
else
{
$ip=$_SERVER['REMOTE_ADDR'];
}
 
nxgweb ,its checking ip address only/

thanks gOgOl
also I add a flag for $_SERVER['REMOTE_ADDR']
I checked in my few test
if host name is different than the ipv4 then it also a proxy for sure

here the testing url http://tech-8.com/proxyc.php

source code here:
Code:
<?php
if (!empty($_SERVER["HTTP_CLIENT_IP"]))
{
//check for ip from share internet
$ip = $_SERVER["HTTP_CLIENT_IP"];
}
elseif (!empty($_SERVER["HTTP_X_FORWARDED_FOR"]))
{
// Check for the Proxy User
$ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
}
else
{
$ip = $_SERVER["REMOTE_ADDR"];
}
// This will print user's real IP Address
// does't matter if user using proxy or not.
echo "IPv4: ".$ip;

$via = $_SERVER['HTTP_VIA'];
$realip=  $_SERVER['X-REAL-IP'];
$proxyid = $_SERVER['HTTP_X_PROXY_ID'];

echo "<br/>Via: ".$via;
echo "<br/>realip: ".$realip;
echo "<br/>proxyid: ".$proxyid;

$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);

echo "<br/>Hostname: ".$hostname;
?>


PS: it will more efficient , if some one come with more good proxy checker , like http://www.whatismyip.com/
 
Last edited:
There is no guaranteed way to know about the proxy unless you have a list of all the Proxies Ip addresses that exist (which seems highly unlikely).
 
Back
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features and essential functions on BlackHatWorld and other forums. These functions are unrelated to ads, such as internal links and images. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock