ASP中管理页面'or'='or'这个漏洞怎么封?麻烦帮帮忙

来源:百度知道 编辑:UC知道 时间:2024/06/30 01:54:42
QQ77950929 验证ASP...不要拿复制的给我..看不懂 - -! 拜托速度..谢谢了

楼上说得太复杂了……其实一句话就好了

keyword是你输入的值

if instr(request("keyword"),"=") then ....(转到出错叶面还是纪录IP随便你)

这不就行了?

我晕 360 安全卫士 啥时候加的这功能? 痴线呀

过滤。不直接加入到 sql 语句就可以阿,简单。

防SQL注入要过滤SQL语句里的参数。
一般情况下,过滤空格和单引号就可以了。
用以下两个函数:
Function ReqNum(StrName) '用于数字型参数的过滤
ReqNum = Trim(Request(StrName))
If ReqNum <> "" And Not IsNull(ReqNum) Then
If Not isNumeric(ReqNum) Then
Response.Write("参数必须是数字!") : Response.End
End If
Else
Response.Write("参数不能为空!") : Response.End
End If
End Function

Function ReqStr(StrName) '用于字符型参数的过滤
ReqStr = Replace(Replace(Replace(Request(StrName),"'","''" )," ","" ),"%20","")
End Function
调用很简单,比如要过滤id参数(数字型),就这样:
id=ReqNum("id")
过滤username参数(字符型):
username=ReqStr("username&