asp实现防止从外部提交数据的三种方法第1/3页
2007-11-24 00:00
1036 查看
防止从外部提交数据的方法
第一种做法,屏蔽特殊字符和关键字
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
第一种做法,屏蔽特殊字符和关键字
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实现防止从外部提交数据的三种方法第1/3页
- Asp.net实现弹出窗口提示,又防止刷新被重复提交的方法
- [转]asp.net 防止外部提交数据
- asp.net防止刷新重复提交数据解决方法的分析
- ASP实现禁止从外部提交数据
- asp快速开发方法之数据操作实例代码第1/3页
- Asp.net实现弹出窗口提示,又防止刷新被重复提交的方法
- 防止快速连续点击按钮重复提交数据之一(自定义方法实现)
- Asp.net实现弹出窗口提示,又防止刷新被重复提交的方法
- Asp.net实现弹出窗口提示,又防止刷新被重复提交的方法
- ASP实现禁止从外部提交数据
- ASP实现禁止从外部提交数据
- asp快速开发方法之数据操作实例代码第1/3页
- asp.net下gridview 批量删除的实现方法第1/3页
- asp.net access添加返回自递增id的实现方法第1/3页
- asp.net access添加返回自递增id的实现方法第1/3页
- ASP之防止外部数据提交的脚本
- asp实现防止站外提交内容的两个方法
- ASP实现禁止从外部提交数据
- asp防止站外提交数据两种方法