程序员

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

作者:admin 2021-07-14 我要评论

防止从外部提交数据的方法 第一种做法,屏蔽特殊字符和关键字 fqys=request.servervariables("query_string") dimnothis(18) nothis(0)="netuser" nothis(1)="xp...

在说正事之前,我要推荐一个福利:你还在原价购买阿里云、腾讯云、华为云服务器吗?那太亏啦!来这里,新购、升级、续费都打折,能够为您省60%的钱呢!2核4G企业级云服务器低至69元/年,点击进去看看吧>>>)
防止从外部提交数据的方法

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

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

版权声明:本文转载自网络,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。本站转载出于传播更多优秀技术知识之目的,如有侵权请联系QQ/微信:153890879删除

相关文章
  • asp实现防止从外部提交数据的三种方法

    asp实现防止从外部提交数据的三种方法

  • ASP+XML实例演练编程代码第1/3页

    ASP+XML实例演练编程代码第1/3页

  • asp下利用XMLHTTP 从其他页面获取数据

    asp下利用XMLHTTP 从其他页面获取数据

  • asp下实现IP限制函数代码

    asp下实现IP限制函数代码

腾讯云代理商
精彩导读
海外云服务器
热门资讯
腾讯云代理商