30-11-2011, 03:48 PM
Je vous met à disposition un script anti proxy pour "éviter" les multis comptes. En faite si le script retourne 0 c'est que vous n’êtes pas derrière un proxy et si il retourne un chiffre supérieur à 0 c'est que vous êtes derrière un proxy.
Voici le script qui vérifie si vous êtes derrière un proxy:
Voici le chiffre de retour
:
0 = pas de proxy
1,2,3,4,5 = proxy, 5 étant un proxy hautement anonyme
Voici le script qui vérifie si vous êtes derrière un proxy:
Citation : function get_ip() {
if($_SERVER) {
if($_SERVER['HTTP_X_FORWARDED_FOR'])
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
elseif($_SERVER['HTTP_CLIENT_IP'])
$ip = $_SERVER['HTTP_CLIENT_IP'];
else
$ip = $_SERVER['REMOTE_ADDR'];
}
else {
if(getenv('HTTP_X_FORWARDED_FOR'))
$ip = getenv('HTTP_X_FORWARDED_FOR');
elseif(getenv('HTTP_CLIENT_IP'))
$ip = getenv('HTTP_CLIENT_IP');
else
$ip = getenv('REMOTE_ADDR');
}
return $ip;
}
function detect_proxy($myIP) {
$scan_headers = array(
'HTTP_VIA',
'HTTP_X_FORWARDED_FOR',
'HTTP_FORWARDED_FOR',
'HTTP_X_FORWARDED',
'HTTP_FORWARDED',
'HTTP_CLIENT_IP',
'HTTP_FORWARDED_FOR_IP',
'VIA',
'X_FORWARDED_FOR',
'FORWARDED_FOR',
'X_FORWARDED',
'FORWARDED',
'CLIENT_IP',
'FORWARDED_FOR_IP',
'HTTP_PROXY_CONNECTION'
);
$flagProxy = false;
$libProxy = '0';
foreach($scan_headers as $i)
if($_SERVER[$i]) $flagProxy = true;
if ( in_array($_SERVER['REMOTE_PORT'], array(8080,80,6588,8000,3128,553,554))
|| @fsockopen($_SERVER['REMOTE_ADDR'], 80, $errno, $errstr, 2))
$flagProxy = true;
// Proxy LookUp
if ( $flagProxy == true &&
isset($_SERVER['REMOTE_ADDR']) &&
!empty($_SERVER['REMOTE_ADDR']) )
// Transparent Proxy
// REMOTE_ADDR = proxy IP
// HTTP_X_FORWARDED_FOR = your IP
if ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) &&
!empty($_SERVER['HTTP_X_FORWARDED_FOR']) &&
$_SERVER['HTTP_X_FORWARDED_FOR'] == $myIP
)
$libProxy = '1';
// Simple Anonymous Proxy
// REMOTE_ADDR = proxy IP
// HTTP_X_FORWARDED_FOR = proxy IP
else if ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) &&
!empty($_SERVER['HTTP_X_FORWARDED_FOR']) &&
$_SERVER['HTTP_X_FORWARDED_FOR'] == $_SERVER['REMOTE_ADDR']
)
$libProxy = '2';
// Distorting Anonymous Proxy
// REMOTE_ADDR = proxy IP
// HTTP_X_FORWARDED_FOR = random IP address
else if ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) &&
!empty($_SERVER['HTTP_X_FORWARDED_FOR']) &&
$_SERVER['HTTP_X_FORWARDED_FOR'] != $_SERVER['REMOTE_ADDR']
)
$libProxy = '3';
// Anonymous Proxy
// HTTP_X_FORWARDED_FOR = not determined
// HTTP_CLIENT_IP = not determined
// HTTP_VIA = determined
else if ( $_SERVER['HTTP_X_FORWARDED_FOR'] == '' &&
$_SERVER['HTTP_CLIENT_IP'] == '' &&
!empty($_SERVER['HTTP_VIA'])
)
$libProxy = '4';
// High Anonymous Proxy
// REMOTE_ADDR = proxy IP
// HTTP_X_FORWARDED_FOR = not determined
else
$libProxy = '5';
return $libProxy;
}
$ip = get_ip();
$typeProxy = detect_proxy($ip);
Voici le chiffre de retour
:
Citation :echo "$typeProxy";
0 = pas de proxy
1,2,3,4,5 = proxy, 5 étant un proxy hautement anonyme