敏感问题:有关ASP防注入!!!
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
很多人发过这个函数,居然说可以对所有的注入说不!我目前还没有发现什么问题,不知道大家有没有找到突破点?想知道到底安不安全。
这个函数到底能不能完全防注入呢???还有就是大家如果有好的防注入函数来讨论讨论吧!~