110,533
社区成员
发帖
与我相关
我的任务
分享
sql注入呗,这么简单的问题。
我的一个站的后台,拦截的扫描记录,给你参考参考,看看这些家伙都是用什么样的字符串在扫描
跟你说吧,你这是被广告软件扫出了你的sql漏洞,被注入利用了,让你给人家做广告呢,不是数据库问题,是你的sql语句里接收的参数变量未对其进行过滤检查,看看类似这样的过滤:/sl过滤关键字 public static bool CheckKeyWord(string sWord) { //过滤关键字 string StrKeyWord = @"select|insert|delete|from|count\(|drop table|update|truncate|asc\(|mid\(|char\(|xp_cmdshell|exec master|netlocalgroup administrators|:|net user|""|or|and"; //过滤关键字符 string StrRegex = @"[-|;|,|/|\(|\)|\[|\]|}|{|%|\@|*|!|']"; if (Regex.IsMatch(sWord, StrKeyWord, RegexOptions.IgnoreCase) || Regex.IsMatch(sWord, StrRegex)) return true; return false; }
/sl过滤关键字
public static bool CheckKeyWord(string sWord)
{
//过滤关键字
string StrKeyWord = @"select|insert|delete|from|count\(|drop table|update|truncate|asc\(|mid\(|char\(|xp_cmdshell|exec master|netlocalgroup administrators|:|net user|""|or|and";
//过滤关键字符
string StrRegex = @"[-|;|,|/|\(|\)|\[|\]|}|{|%|\@|*|!|']";
if (Regex.IsMatch(sWord, StrKeyWord, RegexOptions.IgnoreCase) || Regex.IsMatch(sWord, StrRegex))
return true;
return false;
}