tags:

views:

29

answers:

1

How can i find the original IP address of a spoofed IP address?Is there any tools to find out?

A: 

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
}
Codex73

related questions