当前位置:首页 > 建站常识 > 列表

ASP网站防注入函数

点击:时间:2016/12/7关键词:上海网页制作 asp 防注入
Response.Buffer = TrueConst EnableStopInjection = TrueIf EnableStopInjection = True ThenIf Request.QueryString <> "" Then C

ASP网站防注入函数

Response.Buffer = TrueConst EnableStopInjection = TrueIf EnableStopInjection = True ThenIf Request.QueryString <> "" Then Call StopInjection(Request.QueryString)If Request.Cookies <> "" Then Call StopInjection(Request.Cookies)If Request.Form <> "" Then Call StopInjection(Request.Form)End IfSub StopInjection(Values)Dim regExSet regEx = New RegExpregEx.IgnoreCase = TrueregEx.Global = TrueregEx.Pattern = "'|;|#|([\s\b+()]+(select|update|insert|delete|declare|@|exec|dbcc|alter|drop|create|backup|if|else|end|and|or|add|set|open|close|use|begin|retun|as|go|exists)[\s\b+]*)"Dim sItem, sValueFor Each sItem In ValuessValue = Values(sItem)If regEx.Test(sValue) ThenResponse.Write "请不要使用敏感字符 021jz.com.cn"Response.EndEnd IfNextSet regEx = NothingEnd Sub
预约建站
免费提供网站优化
领取关键词