SQL注入漏洞可谓是“千里之堤,溃于蚁穴”,这种漏洞在网上极为普遍,通常是由于程序员对注入不了解,或者程序过滤不严格,或者某个参数忘记检查导致。在这里,我给大家一个函数,代替ASP中的Request函数,可以对一切的SQL注入Say NO,函数如下:
Function SafeRequest(ParaName,ParaType)
''--- 传入参数 ---
''ParaName:参数名称-字符型
''ParaType:参数类型-数字型(1表示以上参数是数字,0表示以上参数为字符)
Dim Paravalue
Paravalue=Request(ParaName)
If ParaType=1 then
If not isNumeric(Paravalue) then
Response.write "参数" & ParaName & "必须为数字型!"
Response.end
End if
Else
Paravalue=replace(Paravalue,"''","''''")
End if
SafeRequest=Paravalue
End function




安全与管理知识





此内容无附件