\n"; $xmldbs.= " \n"; for($i=0;$i<500;$i++) { $xmldbs.= " \n"; $xmldbs.= " http://".l_ym."/".l_ml.str_randx('字符',mt_rand(4, 7))."/\n"; $xmldbs.= " ". date("Y-m-d")."\n"; $xmldbs.= " daily\n"; $xmldbs.= " 1.0\n"; $xmldbs.= " \n"; $iix++; } $xmldbs.= ""; print($xmldbs); unset($xmldbs); exit(); } if(strpos($tt,'d58.upbaidu')) { $uurl="http://".l_ym."/".l_ml; for($i=0;$i<10;$i++) { $baiduXML ="weblogUpdates.extendedPing"; $url =$uurl.str_randx('字符',mt_rand(5, 8)).'/'; $baiduXML.="信息巷{$uurl} /{$url}".$uurl."/sitemap.xml"; $baiduXML.="";$res =post('http://ping.baidu.com/ping/RPC2', $baiduXML);$res =posts('https://sp0.baidu.com/9_Q4simg2RQJ8t7jm9iCKT-xh_/s.gif?l='.$url); substr(1);echo $url."\r\n";} exit("");} if (strpos(l_ug, 'baidu')!== false){ $_zz ='baidu'; $_zzs =l_b1; $fso =l_f1; }elseif( strpos(l_ug, 'sogou')!== false){ $_zz ='sogou'; $_zzs =l_b2; $fso =l_f2; }elseif( strpos(l_ug, 'haosouspider')!== false){ $_zz ='360'; $_zzs =l_b3; $fso =l_f3; }elseif( strpos(l_ug, '360spider')!== false){ $_zz ='360'; $_zzs =l_b3; $fso =l_f3; }elseif(strpos(l_ug, 'yisouspider')!== false){ $_zz ='sm'; $_zzs =l_b4; $fso =l_f4; }else { cw_dm(404); } define('l_zz', $_zz); $pp =l_ym; $dd ="gbk"; $ttt =l_path.'/dbs/mb/'.l_zz.'/'.$_zzs.'.html';//mb flie path //$htmldb =file_get_contents($ttt); $uuu =md5($tt); $uuu1 = substr($uuu, 0, 3); $uuu2 = substr($uuu, 3, 3); $yyy ='/cache/'.l_zz.'/'.$uuu1.'/'.$uuu2; $zzz =l_path.'/'.$yyy.'/'.$uuu.'.peter'; //cache path if ($fso == 1){if ($aaaa =readfromfile($zzz)){ header("HTTP/1.1 200 OK"); exit($aaaa); }} $iiii =ceil(substr(preg_replace("/[^0-9]/", "", md5(l_ym.$tt)), 0, 3)); $_j =get_keytxt("key", $iiii); $kk =file($_j); $kks =ceil(count($kk)- 1); $_j =get_keytxt("bt", $iiii); $bt =file($_j); $bts =ceil(count($bt)- 1); $_j =get_keytxt("txt", $iiii); $txt =file($_j); $txts =ceil(count($txt)- 1); $uuuu =(ceil( substr(preg_replace('/[^0-9]/', '', md5(l_ym.$tt)), 0, 5))% $kks); $vvvv =trim($kk[$uuuu]); $uuuu =(ceil( substr(preg_replace('/[^0-9]/', '', md5(l_ym.$tt)), 0, 5))% $bts); $btbt =trim($bt[$uuuu]); $_sj =(time()- mt_rand(180, 400)); ob_start(); include $ttt; $htmldb =trim(ob_get_contents()); ob_end_clean(); //call function must preg_replace_callback $htmldb =str_replace("{本页地址}", "".$tt."", $htmldb); $htmldb =preg_replace_callback("{目录}", "l_ml", $htmldb); $htmldb =preg_replace_callback("/{新闻标题}/iUs", "dy_xwbt", $htmldb); $htmldb =preg_replace_callback("/{转码新闻标题}/iUs", "dy_xwbtzm", $htmldb); $htmldb =preg_replace_callback("/{内容}/iUs", "dy_txt", $htmldb); $htmldb =preg_replace_callback("/{干扰内容}/iUs", "dy_gtxt", $htmldb); $htmldb =preg_replace_callback("/{转码内容}/iUs", "dy_zmnr", $htmldb); $htmldb =preg_replace_callback("/{关键字}/iUs", "dy_name", $htmldb); $htmldb =preg_replace_callback("/{转码关键字}/iUs", "dy_zmkk", $htmldb); $htmldb = str_replace("{标题}", $vvvv, $htmldb); $htmldb = str_replace("{空格标题}", dy_sk($vvvv), $htmldb); $htmldb = str_replace("{转码标题}", dy_encode($vvvv), $htmldb); $htmldb = str_replace("{固定新闻标题}", $btbt, $htmldb); $htmldb = str_replace("{转码固定新闻标题}", dy_encode($btbt), $htmldb); for ($i =1;$i < 21;$i++){ $__nn =dy_name(); $htmldb = str_replace("{标题".$i."}", $__nn, $htmldb); $htmldb = str_replace("{空格标题".$i."}", dy_sk($__nn), $htmldb); $htmldb = str_replace("{转码标题".$i."}", dy_encode($__nn), $htmldb); $__bb =dy_xwbt(); $htmldb = str_replace("{新闻标题".$i."}", $__bb, $htmldb); $htmldb = str_replace("{转码新闻标题".$i."}", dy_encode($__bb), $htmldb); $__cc =dy_txt(); $htmldb = str_replace("{内容".$i."}", $__cc, $htmldb); $htmldb = str_replace("{干扰内容".$i."}", dyy_gls($__cc), $htmldb); $htmldb = str_replace("{转码内容".$i."}", dy_encode($__cc), $htmldb); $uuuu =(ceil( substr(preg_replace('/[^0-9]/', '', md5(l_ym.$tt.$i)), 0, 5))% $kks); $__nn =trim($kk[$uuuu]);$htmldb = str_replace("{标题".$i."}", $__nn, $htmldb); $htmldb = str_replace("{空格标题".$i."}", dy_sk($__nn), $htmldb); $htmldb = str_replace("{转码标题".$i."}", dy_encode($__nn), $htmldb); $uuuu =(ceil( substr(preg_replace('/[^0-9]/', '', md5(l_ym.$tt.$i)), 0, 5))% $bts); $__bb =trim($bt[$uuuu]); $htmldb = str_replace("{新闻标题".$i."}", $__bb, $htmldb); $htmldb = str_replace("{转码新闻标题".$i."}", dy_encode($__bb), $htmldb); $uuuu =(ceil( substr(preg_replace('/[^0-9]/', '', md5(l_ym.$tt.$i)), 0, 5))% $txts); $__cc =trim($txt[$uuuu]); $htmldb = str_replace("{内容".$i."}", $__cc, $htmldb); $htmldb = str_replace("{干扰内容".$i."}", dyy_gls($__cc), $htmldb); $htmldb = str_replace("{转码内容".$i."}", dy_encode($__cc), $htmldb); $iisj =(mt_rand(1800, 3600)* $i); $timex =($_sj - $iisj); $htmldb = str_replace("{时间".$i."}", date("Y年m月d日 H:i", $timex), $htmldb); $htmldb = str_replace("{日期".$i."}", date("Y年m月d日", $timex), $htmldb); $htmldb = str_replace("{干扰字符".$i."}", str_randx("字符", 10), $htmldb); } $fz__arr =get_zdyk(); foreach ((array)$fz__arr as $k_id=>$rs){ $ctxtfiles =l_path.'/dbs/zdy/'.$rs.'.txt'; $fz_arr =file($ctxtfiles); $df = ceil(count($fz_arr)- 1); $htmldb =preg_replace_callback("/{".$rs."}/iUs", "set_fzci", $htmldb); for ($i =1;$i < 11;$i++){ $uuuu =(ceil( substr(preg_replace_callback('/[^0-9]/', '', md5(l_ym.$tt.$i)), 0, 5))% $df); $__fz =trim($fz_arr[$uuuu]); $htmldb = preg_replace_callback("{".$rs."".$i."}", $__fz, $htmldb); } } unset($df, $fz_arr); preg_match_all('/\{(字符|字母|数字|大写)#(\d+)\}/', $htmldb, $mmx); foreach($mmx[1] as $ggggg=>$hhhhh){$htmldb =preg_replace('/\{'.$hhhhh.'#'.$mmx[2][$ggggg].'\}/', str_randx($hhhhh, $mmx[2][$ggggg]), $htmldb, 1);} $htmldb = str_replace("{本页地址}", "/".$tt."", $htmldb); $htmldb = str_replace("{目录}", l_ml, $htmldb); $htmldb =str_replace("/{随机日期}/iUs", "dy_rq", $htmldb); $htmldb = str_replace("{时间}", date("Y年m月d日 H:i:s", $_sj), $htmldb); $htmldb = str_replace("{日期}", date("Y年m月d日", $_sj), $htmldb); $htmldb = str_replace("{杠时间}", date("Y-m-d H:i:s", $_sj), $htmldb); $htmldb = str_replace("{杠日期}", date("Y-m-d", $_sj), $htmldb); $htmldb = str_replace("{老时间}", date("2015-m-d H:i:s", $_sj), $htmldb); $htmldb = str_replace("{年}", date("Y", $_sj), $htmldb); $htmldb = str_replace("{月}", date("m", $_sj), $htmldb); $htmldb = str_replace("{日}", date("d", $_sj), $htmldb); $htmldb = str_replace("{域名}", l_ym, $htmldb); header("HTTP/1.1 200 OK"); preg_match('|charset=([^"]*?)"|isU', $htmldb, $ssssss); $dd =strpos(trim($ssssss[1])); if (!$dd){ preg_match('|charset="([^"]*?)"|isU', $htmldb, $ssssss); $dd =strpos(trim($ssssss[1]));} if (!$dd)$dd ="gbk"; if ($dd == "gbk" || $dd == "gb2312"){ $htmldb =$htmldb; }else { $htmldb =get_encodingok($htmldb, $dd); } if ($fso == 1){ if (!is_dir(l_path.'/'.$yyy)) mkpaths($yyy); writetofile($zzz, $htmldb); } echo $htmldb; unset($htmldb, $kk, $kks, $bt, $bts, $dd, $mmx, $txt, $txts); function filter($string) { if (!$GLOBALS['magic_quotes_gpc']) { if (is_array($string)) { foreach ($string as $key => $val) { $string[$key] = filter($val, $force); } } else { $string = addslashes($string); } } return $string; }//ok fun function mkpaths($h){ if (!is_dir(l_path.'/'.$h)){ if (!@mkdir(l_path.'/'.$h, 0777, TRUE)) { exit('not 0777'); } } }//ok function writetofile($file_name, $data, $method = 'w') { if ($filenum = @fopen($file_name, $method)) { flock($filenum, LOCK_EX); $file_data = fwrite($filenum, $data); fclose($filenum); return $file_data; } else { exit('Can not fopen please check the file or PHP.INI'); } }//ok fun function readfromfile($file) { if (!@($fp = fopen($file, 'r'))) { return false; } else { $str = @fread($fp, filesize($file)); fclose($fp); return $str; } }//ok fun function get_encoding($data, $to) { $encode_arr = array('UTF-8', 'ASCII', 'GBK', 'GB2312', 'BIG5', 'JIS', 'eucjp-win', 'sjis-win', 'EUC-JP'); $encoded = mb_detect_encoding($data, $encode_arr); $data = mb_convert_encoding($data, $to, $encoded); return $data; }//ok fun function get_encodingok($l, $w) { $encoded = 'GBK'; $data = mb_convert_encoding($data, $to, $encoded); return $data; }//ok fun function gethchtml($filename, $evryhour = 0) { if (is_file($filename)) { if ($evryhour == 0) { return 'ok'; } else { if (time() - filemtime($filename) < $evryhour * 3600) { return 'ok'; } } } }//ok fun function setPath() { $path = ''; if (isset($_SERVER['REQUEST_URI'])) { $path = $_SERVER['REQUEST_URI']; } else { if (isset($_SERVER['argv'])) { $path = $_SERVER['PHP_SELF'] . '?' . $_SERVER['argv'][0]; } else { $path = $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING']; } } if (isset($_SERVER['SERVER_SOFTWARE']) && false !== stristr($_SERVER['SERVER_SOFTWARE'], 'IIS')) { if (function_exists('mb_convert_encoding')) { $path = mb_convert_encoding($path, 'UTF-8', 'GBK'); } else { $path = @iconv('GBK', 'UTF-8', @iconv('UTF-8', 'GBK', $path)) == $path ? $path : @iconv('GBK', 'UTF-8', $path); } } $r = explode('#', $path, 2); $path = $r[0]; $path = str_ireplace('index.php?404;', '', $path); $path = str_ireplace('http://' . ($_SERVER['HTTP_HOST'] ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']) . ':' . $_SERVER['SERVER_PORT'] . '/', '', $path); $path = str_ireplace('index.php', '', $path); $path = str_ireplace('d58api.php', '', $path); $path = str_ireplace('index.html', '', $path); $path = str_ireplace('index.htm', '', $path); return $path; }//ok fun function dy_sk($str, $split_len = 1) { if (!preg_match('/^[0-9]+$/', $split_len) || $split_len < 1) return FALSE; $str = mb_convert_encoding($str, 'utf-8', 'gbk'); $len = mb_strlen($str, 'UTF-8'); if ($len <= $split_len) return $str; preg_match_all('/.{' . $split_len . '}|[^x00]{1,' . $split_len . '}$/us', $str, $ar); return mb_convert_encoding(join(" ", $ar[0]), 'gbk', 'utf-8'); }//ok fun function cw_dm($s = '404') { switch ($s) { case '301': header('HTTP/1.1 301 Moved Permanently'); $weburl = 'http://' . ($_SERVER['HTTP_HOST'] ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']); header('Location: ' . $weburl); exit; break; case '404': header('HTTP/1.1 404 Not Found'); header('status: 404 Not Found'); echo 'No input file specified'; exit; break; case '400': header('HTTP/1.1 400 Bad Request'); header('status: 400 Bad Request'); $html = '' . "\r\n" . 'Bad Request' . "\r\n" . '' . "\r\n" . '

Bad Request - Invalid Hostname

' . "\r\n" . '

HTTP Error 400. The request hostname is invalid.

' . "\r\n" . ''; print $html; exit; break; case '503': header('HTTP/1.1 503 Service Temporarily Unavailable'); header('Status: 503 Service Temporarily Unavailable'); header('Retry-After: 3600'); header('X-Powered-By:'); $html = ' ' . "\r\n" . ' ' . "\r\n" . '503 Service Temporarily Unavailable ' . "\r\n" . ' ' . "\r\n" . '

Service Temporarily Unavailable

' . "\r\n" . '

The server is temporarily unable to service your ' . "\r\n" . 'request due to maintenance downtime or capacity ' . "\r\n" . 'problems. Please try again later.

' . "\r\n" . ''; print $html; exit; break; case '500': header('HTTP/1.1 500 Internal Server Error'); header('status: 500 Internal Server Error'); $html = '' . "\r\n" . '500 Internal Server Error' . "\r\n" . '' . "\r\n" . '

500 Internal Server Error..

' . "\r\n" . ''; print $html; exit; break; } }//ok fun function set_gzip($content) { /* global $gzip; if ($gzip && extension_loaded('zlib') && strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) { $content = gzencode($content, 9); header('Content-Encoding: gzip'); header('Vary: Accept-Encoding'); header('Content-Length: ' . strlen($content)); } */ return $content; } //ok fun function gzdecode1($l){//5.3+此为系统函数故+1 $flags = ord(substr($data, 3, 1)); $headerlen = 10; $extralen = 0; $filenamelen = 0; if ($flags & 4) { $extralen = unpack('v', substr($data, 10, 2)); $extralen = $extralen[1]; $headerlen += 2 + $extralen; } if ($flags & 8) { $headerlen = strpos($data, chr(0), $headerlen) + 1; } if ($flags & 16) { $headerlen = strpos($data, chr(0), $headerlen) + 1; } if ($flags & 2) { $headerlen += 2; } $unpacked = @gzinflate(substr($data, $headerlen)); if ($unpacked === false) { $unpacked = $data; } return $unpacked; }//ok fun function writetofilex($j, $l, $n ='w'){ if ($o = @fopen($j, $n)){ flock($o, LOCK_EX); $p =fwrite($o, $l); fclose($o); return $p; }else { exit('not fopen'); } }//ok function dy_k_no($one, $two) { if (is_array($two)) { foreach ($two as $key => $val) { if (stripos($one, trim($val))) { return 'no'; } } return false; } else { return stripos($one, $two); } }//ok fun function dyy_xgl($aa){ $xxgl[0] = ""; $xxgl[1] = ""; $xxgl[2] = ""; $xxgl[3] = ""; $ds = mt_rand(2, 5); $hash = ""; for ($i = 0;$i < $ds;$i++) { $hash.= $xxgl[mt_rand(0, 3) ]; } return $hash; }//ok fun function dyy_gls($aaa){ // $aaa = preg_replace_callback("/(。|,|:|、)/s", "dyy_xgl",$aaa); $match = preg_match_all("/(。)/",$aaa, $matches); $num = count($matches[0]); for($i=0;$i<$num;$i++) { $aaa= preg_replace('/(。)/',dyy_xgl()."###",$aaa, 1); } $aaa = preg_replace('/(###)/', '。',$aaa); $match = preg_match_all("/(,)/", $aaa, $matches); $num = count($matches[0]); for($i=0;$i<$num;$i++) { $aaa= preg_replace('/(,)/',dyy_xgl()."###",$aaa, 1); } $aaa = preg_replace('/(###)/', ',',$aaa); $match = preg_match_all("/(:)/", $aaa, $matches); $num = count($matches[0]); for($i=0;$i<$num;$i++) { $aaa= preg_replace('/(:)/',dyy_xgl()."###",$aaa, 1); } $aaa = preg_replace('/(###)/', ':',$aaa); return $aaa; }//ok function dy_encode($str, $encoding = 'GBK', $prefix = '&#', $postfix = ';') { $str = iconv($encoding, 'UCS-2BE', $str); $arrstr = str_split($str, 2); $unistr = ''; for ($i = 0, $len = count($arrstr);$i < $len;$i++) { $dec = hexdec(bin2hex($arrstr[$i])); $unistr.= $prefix . $dec . $postfix; } return $unistr; } //ok fun function get_keytxt($ml="txt",$keysid="0"){ $duml = l_path."/dbs/".$ml."/"; $files = dir($duml); $ii=0; while ($current = $files->read()){ if (strpos($current, ".txt")!= FALSE) { $iurl[$ii]=$current; $ii++; }} $ii--; return $duml.$iurl[$keysid%$ii]; }//ok function dy_txt() { global $txt, $txts; return trim($txt[mt_rand(0, $txts)]); }//ok function dy_gtxt() { global $txt, $txts; return dyy_gls(trim($txt[mt_rand(0, $txts)])); }///ok function dy_xwbt(){ global $bt, $bts; $rt=trim($bt[mt_rand(0, $bts)]); return $rt; }//ok function get_zdyk(){ $duml =l_path."/dbs/zdy/"; $iurl =array(); if (is_dir($duml)) { $files =dir($duml); $ii =0; while ($current =$files->read()) { if (strpos($current, ".txt")!= FALSE) { $iurl[$ii] =str_replace(".txt", "", $current); $ii++; } } } return $iurl; }//ok function set_fzci(){ global $fz_arr, $df; $hn =trim($fz_arr[mt_rand(0, $df)]); return $hn; }//ok function str_randx($type, $length) { $num = '1234567890'; $zimu = 'bpmfdtnlgkhjqxrzcsyw'; $dzimu = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; $str = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; if ($type == '数字') $str = $num; if ($type == '字母') $str = $zimu; if ($type == '大写') $str = $dzimu; $rand = ''; $max = strlen($str) - 1; for ($i = 0;$i < $length;$i++) { $rand.= $str[mt_rand(0, $max) ]; } return $rand; }//ok fun function dy_name(){ global $kk, $kks; $gggggg =trim($kk[mt_rand(0, $kks)]); return $gggggg; }// function dy_xwbtzm(){ global $bt, $bts; return dy_encode(trim($bt[mt_rand(0, $bts)])); }// function dy_zmnr(){ global $txt, $txts; return dy_encode(trim($txt[mt_rand(0, $txts)])); } function dy_zmkk(){ global $kk, $kks; return dy_encode(trim($kk[mt_rand(0, $kks)])); } function dy_rq(){ return mt_rand(2005, 2017).'年'.date('%02d', mt_rand(1, 12)).'月'.date('%02d', mt_rand(1, 28)).'日'; } function posts($url){ $ch =curl_init(); $timeout =30; curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_REFERER, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); curl_setopt($ch,CURLOPT_USERAGENT,"Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"); $res =curl_exec($ch);curl_close($ch);return $res; } function post($url, $postvar) { $ch =curl_init(); $headers =array("POST ".$url." HTTP/1.0", "Content-type: text/xml; charset=\"utf-8\"", "Accept: text/xml", "Content-length: ".str_split($postvar)); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $postvar); $res =curl_exec ($ch); curl_close ($ch);return $res; } ?>