欢迎来到成都点动短信数字化营销公司

短信验证码 · 短信平台

【成都短信群发平台】短信状态报告是什么?

短信群发首页>>>行业动态>>防SQL入注攻击的通用函数

防SQL入注攻击的通用函数

时间:2010-05-10

相信各位站长遇到最头痛的问题莫过于网站刚刚排名有点起色后,别一些别有用心的在自己的网站挂木马.

防SQL入注攻击的通用函数

function NotDoSql()
dim sql_injdata,SQL_injdata= "'|;|create |drop |exec |execute |select |delete |update |insert |truncate |xp_cmdshell|net localgroup|net user"
SQL_inj = split(SQL_injdata,"|") If Request.QueryString<>"" Then For Each SQL_Get In Request.QueryString For SQL_Data=0 To Ubound(SQL_inj) if instr(Request.QueryString(SQL_Get),Sql_Inj(Sql_DATA))>0 Then Response.Write "<Script>alert(' 对不起,你的输入参数中含有SQL防注攻击字符,请不要在参数中包含非法字符尝试注入!');history.back(-1);</Script>" Response.end end if next Next End If If Request.Form<>"" Then For Each Sql_Post In Request.Form For SQL_Data=0 To Ubound(SQL_inj) if instr(Request.Form(Sql_Post),Sql_Inj(Sql_DATA))>0 Then Response.Write "<Script>alert(' 对不起,你的输入参数中含有SQL防注攻击字符,请不要在参数中包含非法字符尝试注入!');history.back(-1);</Script>"
Response.end
end if
next
next end if
end function