User IP script (php)

Often in testing NAT I want to see what my “external” IP address is. In scouring the net and doing a little hacking of my own, I came up with a script to present useful information.

Your NAT’d IP address (what do you look like to the outside world)
Your source port
The server software
The protocol and version
When the request was made.

The script (you can also download it here)



echo ‘Your IP is: ‘ . getenv(‘REMOTE_ADDR’);
echo nl2br(“n”);
echo ‘Your source port is: ‘ . getenv(‘REMOTE_PORT’);
echo nl2br(“n”);
echo ‘The server software is: ‘ . getenv(‘SERVER_SOFTWARE’);
echo nl2br(“n”);
echo ‘Name and revision of the information protocol: ‘ . getenv(‘SERVER_PROTOCOL’);
echo nl2br(“n”);
echo ‘The timestamp of the start of the request: ‘ . getenv(‘REQUEST_TIME’);
echo date(“H:i:s  –   m/d/y”, time())
?>


Here’s a screenshot of the results-

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.