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

所属分类: 网络编程 / ASP编程 阅读数: 1878
收藏 0 赞 0 分享
防止从外部提交数据的方法

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

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 
更多精彩内容其他人还在看

asp中去除内容HTML标签的三个function函数

asp中去除内容HTML标签的三个function函数
收藏 0 赞 0 分享

chr(9)、chr(10)、chr(13)、chr(32)、chr(34)讲解

chr(9)、chr(10)、chr(13)、chr(32)、chr(34)讲解
收藏 0 赞 0 分享

方便的大家admin及admin888 经过 md5加密后16位和32位代码

方便的大家admin及admin888 经过 md5加密后16位和32位代码
收藏 0 赞 0 分享

可用的ASP无重复数字随机函数, 数组实现, 并应用于随机显示记录集

可用的ASP无重复数字随机函数, 数组实现, 并应用于随机显示记录集
收藏 0 赞 0 分享

asp动态级联菜单代码

asp动态级联菜单代码
收藏 0 赞 0 分享

ASP中经常使用的SQL语句与教程说明

ASP中经常使用的SQL语句与教程说明
收藏 0 赞 0 分享

实例分析之用ASP编程实现网络内容快速查找的代码

实例分析之用ASP编程实现网络内容快速查找的代码
收藏 0 赞 0 分享

服务端 VBScript 与 JScript 几个相同特性的写法与示例

服务端 VBScript 与 JScript 几个相同特性的写法与示例
收藏 0 赞 0 分享

ASP 环境下 VBS 事件应用 示例代码

ASP 环境下 VBS 事件应用 示例代码
收藏 0 赞 0 分享

asp 之上传漏洞终结篇

asp 之上传漏洞终结篇
收藏 0 赞 0 分享
查看更多