<%
'=========================================================
'　　　　　　　　　　　飞　扬　网　络
' Copyright (C) 2003-2005 feiyang.Com. All Rights Reserved.
' Web: http://www.feiyang.com
' QQ: 99686532        E-mail: bgh_edu@126.com
'=========================================================
%>
<%
'dim sql_injdata 
SQL_injdata = "'|and|exec|insert|delete|update|chr|from|"&_
"master|truncate|char|declare|object|script|applet|execute|join|"&_
"union|where|like|drop|create|rename|truncate|alter|nchar|alter|"&_
"cast|exists|xp_cmdshell"
'SQL_injdata = "'|""|and|exec|insert|select|delete|update|count|*|%|chr|mid|master|truncate|char|declare|xp_cmdshell|net user|/add|exec%20master.dbo.xp_cmdshell|net localgroup administrators|count|:|drop|from|--|(|)|chr"
SQL_inj = split(SQL_Injdata,"|") 

If Request.QueryString<>"" Then 
For Each SQL_Get In Request.QueryString 
For SQL_Data=0 To Ubound(SQL_inj) 
if instr(Lcase(Request.QueryString(SQL_Get)),Sql_Inj(Sql_DATA))>0 Then 
Response.Write "参数中包含非法字符"&Sql_Inj(Sql_DATA)
Response.end 
end if 
next 
Next 
End If 
'这样我们就实现了get请求的注入的拦截，但是我们还要过滤post请求，所以我们还得继续考虑request.form,这个也是以数组形式存在的，，我们只需要再进一次循环判断即可。代码如下 
If Request.Form<>"" Then 
For Each Sql_Post In Request.Form 
For SQL_Data=0 To Ubound(SQL_inj) 
if instr(Lcase(Request.Form(Sql_Post)),Sql_Inj(Sql_DATA))>0 Then 
Response.Write "参数中包含非法字符"&Sql_Inj(Sql_DATA)
Response.end 
end if 
next 
next 
end if 
%>