开发者

identifying a spoofed address

How can i find the original IP address of a spoofed IP address开发者_如何学C?Is there any tools to find out?


This should do the trick:

function check_spoofed_ip()
{
    //Check Ip in HTTP Header
    if (!empty($_SERVER['HTTP_CLIENT_IP']))
    {
        $ip=$_SERVER['HTTP_CLIENT_IP'];
    }
    //Is it Proxy Forwarded?
    elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
    {
        $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
    }
    //Check @ Last, Normal Scenario 
    else
    {
        $ip=$_SERVER['REMOTE_ADDR'];
    }
    return $ip; //Returns Real IP
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜