Hello guys, my site was attacked and the hacker claims it was done by a simple injection in ip, we all know hackers don't reveal the true ways of executing their attacks, however, would just like to verify if my ip code seems vulnerable or not?
function getip()
{
if($_SERVER["REMOTE_ADDR"])
{ $ip=$_SERVER["REMOTE_ADDR"];
} else { $ip=$_SERVER["HTTP_X_FORWARDED_FOR"];}
if(strpos($ip,",")){
$exp_ip=explode(",",$ip);
$ip=$exp_ip[0];
}
return $ip;
}
function getip()
{
if($_SERVER["REMOTE_ADDR"])
{ $ip=$_SERVER["REMOTE_ADDR"];
} else { $ip=$_SERVER["HTTP_X_FORWARDED_FOR"];}
if(strpos($ip,",")){
$exp_ip=explode(",",$ip);
$ip=$exp_ip[0];
}
return $ip;
}
Comment