ASP用记登陆中怎样控制像 'or'='or'或'or'这种漏洞

来源:百度知道 编辑:UC知道 时间:2024/05/10 19:11:16
详细点,给下解决的方法

到网上下一个函数,就是防这种漏洞的函数,然后在asp文件开头用
<!--#include file=""-->包含进去即可

比如:
Function Checkstr(Str) '防注入函数
If IsNull(Str) or str="" Then
Checkstr = ""
Exit Function
End If
Str = Replace(Str, Chr(0), "")
If (Instr(Str,"select")>0 And Instr(Str,"from")>0) Then
response.write "呵呵,不要黑我!"
response.End
End If
Str = Replace(Str, "'", "'")
Str = Replace(Str, CHR(39), "'")
Str = Replace(Str,"--","--")
Checkstr=Str
End Function
types = CheckStr(request("type"))
保存为fun.asp
,然后<!--#include file="fun.asp"-->即可