LittleBigTouff
14/01/2008, 19h47
Ce hack permet de détecter les vrais ip même derrière un proxy, le proxy ip est enregistré dans un champ supplémentaire, mais alors ignoré :)
Remerciements et support
Ce Hack a été traduit en français pour vBulletin-Ressources avec l'autorisation explicite de son auteur. / This Hack was translated into French for vBulletin-Ressources with the explicit authorization of its author.
vBulletin-Ressources et son équipe offrira du support vis à vis des hacks traduits, bien sûr, dans la mesure du possible de chacun, autant en terme de temps que de connaissances/ vBulletin-Ressources and its team will offer support for the translated hacks, of course, as far as possible for everyone, as much in term of time that knowledge.
vBulletin-Ressources remercie l'auteur du hack pour avoir fourni son autorisation. / vBulletin-Ressources thanks the author for the hack to have provided its authorization.Conception
Auteur du Hack / Author Of Hack : Paul M (http://www.vbulletin.org/forum/member.php?u=63698)
Source / Link of Thread: Proxy IP to real IP conversion (http://www.vbulletin.org/forum/showthread.php?t=165483)
Version vBulletin Requise / Version vBulletin Required : vB 3.7.0
Testé / Tested: Oui sur 3.7.0
Traducteur / Translator: LittleBigTouff
Copyright © 2006 vBulletin-Ressources.com - Tous droits réservés Uniquement pour nos traductions / Copyright © 2006 vBulletin-Ressources.com - All Rights Reserved Only for ours translationsInstallation
Importez le fichier .xml depuis votre panel admin
Ouvrir le fichier class_core.php et trouvez : function fetch_ip()
{
return $_SERVER['REMOTE_ADDR'];
}
Ajoutez en dessous : /*
Paul M - Try to detect real ip when proxy is in use.
*/
function fetch_real_ip()
{
$real_ip = '';
$ignoreprivate = false;
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$real_ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
else if (isset($_SERVER['HTTP_CLIENT_IP']))
{
$real_ip = $_SERVER['HTTP_CLIENT_IP'];
}
else if (isset($_SERVER['HTTP_FROM']))
{
$real_ip = $_SERVER['HTTP_FROM'];
}
if (preg_match("#\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}#", $real_ip, $iplist))
{
$real_ip = $iplist[0];
if ($ignoreprivate AND preg_match("#^(127|10|172\.(1[6-9]|2[0-9]|3[0-1])|192\.168|169\.254)\.#", $real_ip))
{
$real_ip = '';
}
}
else
{
$real_ip = '';
}
return $real_ip;
}
Trouvez : // fetch client IP address
$registry->ipaddress = $this->fetch_ip();
define('IPADDRESS', $registry->ipaddress);
// attempt to fetch IP address from behind proxies - useful, but don't rely on it...
$registry->alt_ip = $this->fetch_alt_ip();
define('ALT_IP', $registry->alt_ip);
Remplacez par : // Paul M - Set Real, Alt & Proxy IP addresses
$registry->ipaddress = $this->fetch_ip();
$registry->alt_ip = $this->fetch_alt_ip();
$registry->real_ip = $this->fetch_real_ip();
define('ALT_IP', $registry->alt_ip);
if ($registry->real_ip)
{
define('PROXYIP', $registry->ipaddress);
define('IPADDRESS', $registry->real_ip);
}
else
{
define('PROXYIP', '');
define('IPADDRESS', $registry->ipaddress);
}
Trouvez : // define session constants
define('SESSION_HOST', substr($registry->ipaddress, 0, 15));
Remplacez par : // Paul M - Define session host
define('SESSION_HOST', substr(IPADDRESS, 0, 15));
Et enfin trouvez : if (!defined('SESSION_IDHASH'))
{
define('SESSION_IDHASH', md5($_SERVER['HTTP_USER_AGENT'] . $this->fetch_substr_ip($registry->alt_ip))); // this should *never* change during a session
}
Remplacez par : if (!defined('SESSION_IDHASH'))
{
// Paul M - Define session id
define('SESSION_IDHASH', md5($_SERVER['HTTP_USER_AGENT'] . vB_Session::fetch_substr_ip(IPADDRESS)));
}
Uploadez le fichier px.gif dans images/buttonsScreenshot
Remerciements et support
Ce Hack a été traduit en français pour vBulletin-Ressources avec l'autorisation explicite de son auteur. / This Hack was translated into French for vBulletin-Ressources with the explicit authorization of its author.
vBulletin-Ressources et son équipe offrira du support vis à vis des hacks traduits, bien sûr, dans la mesure du possible de chacun, autant en terme de temps que de connaissances/ vBulletin-Ressources and its team will offer support for the translated hacks, of course, as far as possible for everyone, as much in term of time that knowledge.
vBulletin-Ressources remercie l'auteur du hack pour avoir fourni son autorisation. / vBulletin-Ressources thanks the author for the hack to have provided its authorization.Conception
Auteur du Hack / Author Of Hack : Paul M (http://www.vbulletin.org/forum/member.php?u=63698)
Source / Link of Thread: Proxy IP to real IP conversion (http://www.vbulletin.org/forum/showthread.php?t=165483)
Version vBulletin Requise / Version vBulletin Required : vB 3.7.0
Testé / Tested: Oui sur 3.7.0
Traducteur / Translator: LittleBigTouff
Copyright © 2006 vBulletin-Ressources.com - Tous droits réservés Uniquement pour nos traductions / Copyright © 2006 vBulletin-Ressources.com - All Rights Reserved Only for ours translationsInstallation
Importez le fichier .xml depuis votre panel admin
Ouvrir le fichier class_core.php et trouvez : function fetch_ip()
{
return $_SERVER['REMOTE_ADDR'];
}
Ajoutez en dessous : /*
Paul M - Try to detect real ip when proxy is in use.
*/
function fetch_real_ip()
{
$real_ip = '';
$ignoreprivate = false;
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$real_ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
else if (isset($_SERVER['HTTP_CLIENT_IP']))
{
$real_ip = $_SERVER['HTTP_CLIENT_IP'];
}
else if (isset($_SERVER['HTTP_FROM']))
{
$real_ip = $_SERVER['HTTP_FROM'];
}
if (preg_match("#\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}#", $real_ip, $iplist))
{
$real_ip = $iplist[0];
if ($ignoreprivate AND preg_match("#^(127|10|172\.(1[6-9]|2[0-9]|3[0-1])|192\.168|169\.254)\.#", $real_ip))
{
$real_ip = '';
}
}
else
{
$real_ip = '';
}
return $real_ip;
}
Trouvez : // fetch client IP address
$registry->ipaddress = $this->fetch_ip();
define('IPADDRESS', $registry->ipaddress);
// attempt to fetch IP address from behind proxies - useful, but don't rely on it...
$registry->alt_ip = $this->fetch_alt_ip();
define('ALT_IP', $registry->alt_ip);
Remplacez par : // Paul M - Set Real, Alt & Proxy IP addresses
$registry->ipaddress = $this->fetch_ip();
$registry->alt_ip = $this->fetch_alt_ip();
$registry->real_ip = $this->fetch_real_ip();
define('ALT_IP', $registry->alt_ip);
if ($registry->real_ip)
{
define('PROXYIP', $registry->ipaddress);
define('IPADDRESS', $registry->real_ip);
}
else
{
define('PROXYIP', '');
define('IPADDRESS', $registry->ipaddress);
}
Trouvez : // define session constants
define('SESSION_HOST', substr($registry->ipaddress, 0, 15));
Remplacez par : // Paul M - Define session host
define('SESSION_HOST', substr(IPADDRESS, 0, 15));
Et enfin trouvez : if (!defined('SESSION_IDHASH'))
{
define('SESSION_IDHASH', md5($_SERVER['HTTP_USER_AGENT'] . $this->fetch_substr_ip($registry->alt_ip))); // this should *never* change during a session
}
Remplacez par : if (!defined('SESSION_IDHASH'))
{
// Paul M - Define session id
define('SESSION_IDHASH', md5($_SERVER['HTTP_USER_AGENT'] . vB_Session::fetch_substr_ip(IPADDRESS)));
}
Uploadez le fichier px.gif dans images/buttonsScreenshot