开发者

identifying a spoofed address

开发者 https://www.devze.com 2023-01-08 14:23 出处:网络
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:

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

精彩评论

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