当前位置:主页 > 查看内容

asp实现防止从外部提交数据的三种方法第1/3页

发布时间:2021-07-14 00:00| 位朋友查看

简介:防止从外部提交数据的方法 第一种做法,屏蔽特殊字符和关键字 fqys=request.servervariables("query_string") dimnothis(18) nothis(0)="netuser" nothis(1)="xp_cmdshell" nothis(2)="/add" nothis(3)="exec%20master.dbo.xp_cmdshell" nothis(4)="netlocal……
防止从外部提交数据的方法

第一种做法,屏蔽特殊字符和关键字

fqys=request.servervariables("query_string") 

dim nothis(18) 

nothis(0)="net user" 

nothis(1)="xp_cmdshell" 

nothis(2)="/add" 

nothis(3)="exec%20master.dbo.xp_cmdshell" 

nothis(4)="net localgroup administrators" 

nothis(5)="select" 

nothis(6)="count" 

nothis(7)="asc" 

nothis(8)="char" 

nothis(9)="mid" 

nothis(10)="'" 

nothis(11)=":" 

nothis(12)="""" 

nothis(13)="insert" 

nothis(14)="delete" 

nothis(15)="drop" 

nothis(16)="truncate" 

nothis(17)="from" 

nothis(18)="%" 

errc=false 

for i= 0 to ubound(nothis) 

if instr(FQYs,nothis(i))<>0 then 

errc=true 

end if 

next 

if errc then 

response.write "<script language=""javascript"">" 

response.write "parent.alert('很抱歉!你正在试图攻击本服务器或者想取得本服务器最高管理权!将直接转向首页..');" 

response.write "self.location.href='default.asp';" 

response.write "</script>" 

response.end 

end if 

原文链接:https://m.jb51.net/article/12894.htm
本站部分内容转载于网络,版权归原作者所有,转载之目的在于传播更多优秀技术内容,如有侵权请联系QQ/微信:153890879删除,谢谢!
上一篇:ASP+XML实例演练编程代码第1/3页 下一篇:没有了

推荐图文

  • 周排行
  • 月排行
  • 总排行

随机推荐