方法一:
<%if session("username"="" or session("userkey"="" then
response.redirect "../../"
end if%>
(说明:只要有用户注入则跳转到../../目录,呵呵,看你怎么给我注入)
方法二:
<%
server_v1=Cstr(Request.ServerVariables("HTTP_REFERER")
server_v2=Cstr(Request.ServerVariables("SERVER_NAME")
if mid(server_v1,8,len(server_v2))<>server_v2 then
response.write "<br><br><center><table border=1 cellpadding=20 bordercolor=black bgcolor=#EEEEEE width=450>"
response.write "<tr><td style=“font:9pt Verdana“>"
response.write "你提交的路径有误,禁止从站点外部提交数据请不要乱该参数!"
response.write "</td></tr></table></center>"
response.end
end if
%>
(说明:只要有用户注入则判断为外部连接哦,呵呵,看你怎么给我注入)
方法三:
<% dim From_url,Serv_url
From_url = Cstr(Request.ServerVariables("HTTP_REFERER")
Serv_url = Cstr(Request.ServerVariables("SERVER_NAME")
if mid(From_url,8,len(Serv_url)) <> Serv_url then
response.write "NO"
response.redirect("../"
response.end
end if%>
(说明:只要有用户注入则跳转到../(这个可以改为其它网站,或其它页面,给它们一点小的警告也行哦)目录,呵呵,看你怎么给我注入)
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/feng19821209/archive/2005/01/19/260112.aspx