'===========================
'过滤提交表单中的SQL
'===========================
función ForSqlForm()
tenue fqys,errc,i,elementos
nada oscuro(18)
nothis(0)="usuario de red"
nothis(1)="xp_cmdshell"
nothis(2)="/add"
nothis(3)="exec%20master.dbo.xp_cmdshell"
nothis(4)="administradores de grupo local de red"
nothis(5)="seleccionar"
nothis(6)="cuenta"
nothis(7)="asc"
nothis(8)="char"
nothis(9)="mid"
nothis(10)="'"
nothis( 11)=":"
nothis(12)=""""
nothis(13)="insertar"
nothis(14)="eliminar"
nothis(15)="soltar"
nothis(16)="truncar"
nothis(17 )="de"
nothis(18)="%"
'nothis(19)="@"
errc=false
para i= 0 a ubound(nothis)
para cada artículo solicitado. Formulario
si instr(request.Form(items),nothis(i))<>0 entonces
respuesta.write("<div>")
respuesta.write("你所填写的信息:" & server.HTMLEncode(request.Form(items)) & "<br>含非法字符:" & nothis(i))
respuesta.write("</div>")
respuesta.write("对不起,你所填写的信息含非法字符!<a href=""#"" onclick=""history.back()"">返回</a>")
respuesta.Fin()
terminar si
próximo
próximo
función final
'===========================
'过滤查询中的SQL
'===========================
función ForSqlInjection()
tenue fqys,errc,yo
nada oscuro(19)
fqys = solicitud.ServerVariables("QUERY_STRING")
nothis(0)="usuario de red"
nothis(1)="xp_cmdshell"
nothis(2)="/add"
nothis(3)="exec%20master.dbo.xp_cmdshell"
nothis(4)="administradores de grupo local de red"
nothis(5)="seleccionar"
nothis(6)="cuenta"
nothis(7)="asc"
nothis(8)="char"
nothis(9)="mid"
nothis(10)="'"
nothis( 11)=":"
nothis(12)=""""
nothis(13)="insertar"
nothis(14)="eliminar"
nothis(15)="soltar"
nothis(16)="truncar"
nothis(17 )="de"
nothis(18)="%"
nothis(19)="@"
errc=false
para i= 0 a ubound(nothis)
si instr(FQYs,nothis(i))<>0 entonces
errc=true
final si
siguiente
si errc entonces
Response.write "查询信息含非法字符!<a href=""#"" onclick=""history.back()"">返回</a>"
respuesta.end
fin si
finaliza la función