ASP上两个防止SQL注入式攻击Function 
ASP上两个防止SQL注入式攻击Function
''==========================
ASP上两个防止SQL注入式攻击Function'
'过滤提交表单中的SQL
ASP上两个防止SQL注入式攻击Function'
'==========================
ASP上两个防止SQL注入式攻击Function
function ForSqlForm()
ASP上两个防止SQL注入式攻击Function
dim fqys,errc,i,items
ASP上两个防止SQL注入式攻击Function
dim nothis(18
ASP上两个防止SQL注入式攻击Functionnothis(
0)="net user" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
1)="xp_cmdshell" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
2)="/add" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
3)="exec%20master.dbo.xp_cmdshell" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
4)="net localgroup administrators" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
5)="select" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
6)="count" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
7)="asc" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
8)="char" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
9)="mid" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
10)="''" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
11)=":" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
12)="""" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
13)="insert" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
14)="delete" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
15)="drop" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
16)="truncate" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
17)="from" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
18)="%"
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Function
''nothis(19)="@"  
ASP上两个防止SQL注入式攻击Function

ASP上两个防止SQL注入式攻击Functionerrc
=false 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Function
for i= 0 to ubound(nothis) 
ASP上两个防止SQL注入式攻击Function  
for each items in request.Form
ASP上两个防止SQL注入式攻击Function  
if instr(request.Form(items),nothis(i))<>0 then 
ASP上两个防止SQL注入式攻击Function   response.write(
"<div>")
ASP上两个防止SQL注入式攻击Function   response.write(
"你所填写的信息:" & server.HTMLEncode(request.Form(items)) & "<br>含非法字符:" & nothis(i))
ASP上两个防止SQL注入式攻击Function   response.write(
"</div>")
ASP上两个防止SQL注入式攻击Function   response.write(
"对不起,你所填写的信息含非法字符!<a href=""#"" onclick=""history.back()"">返回</a>")
ASP上两个防止SQL注入式攻击Function   response.End()
ASP上两个防止SQL注入式攻击Function  
end if 
ASP上两个防止SQL注入式攻击Function  
next
ASP上两个防止SQL注入式攻击Function
next 
ASP上两个防止SQL注入式攻击Function
end function
ASP上两个防止SQL注入式攻击Function
''==========================
ASP上两个防止SQL注入式攻击Function'
'过滤查询中的SQL
ASP上两个防止SQL注入式攻击Function'
'==========================
ASP上两个防止SQL注入式攻击Function
function ForSqlInjection()
ASP上两个防止SQL注入式攻击Function
dim fqys,errc,i
ASP上两个防止SQL注入式攻击Function
dim nothis(19
ASP上两个防止SQL注入式攻击Functionfqys 
= request.ServerVariables("QUERY_STRING")
ASP上两个防止SQL注入式攻击Functionnothis(
0)="net user" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
1)="xp_cmdshell" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
2)="/add" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
3)="exec%20master.dbo.xp_cmdshell" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
4)="net localgroup administrators" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
5)="select" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
6)="count" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
7)="asc" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
8)="char" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
9)="mid" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
10)="''" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
11)=":" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
12)="""" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
13)="insert" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
14)="delete" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
15)="drop" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
16)="truncate" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
17)="from" 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
18)="%"
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionnothis(
19)="@"  
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionerrc
=false 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Function
for i= 0 to ubound(nothis) 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Function
if instr(FQYs,nothis(i))<>0 then 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Functionerrc
=true 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Function
end if 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Function
next 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Function
if errc then 
ASP上两个防止SQL注入式攻击Functionresponse.write 
"查询信息含非法字符!<a href=""#"" onclick=""history.back()"">返回</a>" 
ASP上两个防止SQL注入式攻击Functionresponse.end 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Function
end if 
ASP上两个防止SQL注入式攻击Function
ASP上两个防止SQL注入式攻击Function
end function
ASP上两个防止SQL注入式攻击Function

相关文章: