送你一个玩意
'思路:用正则表达式检查是否存在注入的关键词
Dim SqlString As String =" 1=1orsdf"
If Regex.IsMatch(SqlString .ToLower(), "/response|group_concat|cmd|sysdate|xor|declare|db_name|char| and| or|truncate| asc| desc|drop |table|count|from|select|insert|update|delete|union|into|load_file|outfile/") Then
MessageBox.show("发现SQL注入")
Else
MessageBox.show("SQL检测通过")
End If
发现后,你要怎么处理,自行决定。鉴于注入sql都很难看,一般我就改为1=2,让它不能bb