海外邮件中继,海外退信中继,美国高速VPS,不限流量VPN,邮局维护和管理,邮件网关,EMOS邮件中继,POSTFIX邮件中继,Winwebmail邮件中继,Winmail邮件中继,DBMail邮件中继,JDMail邮件中继,Exchange邮件中继,MDaemon邮件中继 淘宝店:http://shantan.taobao.com 云邮科技官网:www.yunrelay.com
【字体设置:大 中 小】
这是个不错的ASP防注代码,值得学习一下,利用的是正则表达式.
<%
'************** ASPSecurity SQL 防注入**************
' Copyright 2006
' Create:2006-4-06
' Update:2006-4-14
'***************************************************
If Request.Form<>"" Then StopInjection(Request.Form)
If Request.QueryString<>"" Then StopInjection(Request.QueryString)
If Request.Cookies<>"" Then StopInjection(Request.Cookies)
Function StopInjection(values)
For Each N_Get In values
Dim L_Get, L_Get2
For Each L_Get In values
L_Get2 = values(L_Get)
Set regEx = New RegExp
regEx.IgnoreCase = True
regEx.Global = True
regEx.Pattern = "(\bselect\b|\sand\s|'|;|\sdeclare\s)"
If regEx.Test(L_Get2) Then
Alert()
response.End()
End If
Set regEx = Nothing
Next
Next
End Function
Sub Alert()
Dim str
str = "<"&"Script Language=JavaScript"&">"
str = str & "alert('== 雷客图ASP站长安全助手检测到了危险字符,已经禁止本次提交 ==\n');window.close();"
str = str & "<"&"/Script"&">"
response.write str
End Sub
%>
发表评论 - 不要忘了输入验证码哦!