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