Commit fe3a1bb6 by ruyun.zhang

SQL注入拦截

parent 4b05f152
...@@ -27,7 +27,7 @@ public class AntiSqlInject ...@@ -27,7 +27,7 @@ public class AntiSqlInject
/// </summary> /// </summary>
static AntiSqlInject() static AntiSqlInject()
{ {
SqlKeywordsArray.AddRange(SqlSeparatKeywords.Split('|')); //SqlKeywordsArray.AddRange(SqlSeparatKeywords.Split('|'));
SqlKeywordsArray.AddRange(Array.ConvertAll(SqlCommandKeywords.Split('|'), h => h + " ")); SqlKeywordsArray.AddRange(Array.ConvertAll(SqlCommandKeywords.Split('|'), h => h + " "));
SqlKeywordsArray.AddRange(Array.ConvertAll(SqlCommandKeywords.Split('|'), h => " " + h)); SqlKeywordsArray.AddRange(Array.ConvertAll(SqlCommandKeywords.Split('|'), h => " " + h));
} }
...@@ -39,7 +39,7 @@ static AntiSqlInject() ...@@ -39,7 +39,7 @@ static AntiSqlInject()
//private static string StrSymbol = ";|(|)|[|]|{|}|%|@|*|'|!"; //private static string StrSymbol = ";|(|)|[|]|{|}|%|@|*|'|!";
private const string SqlCommandKeywords = "*|and|asc(|by|char|char(|chr|column_name|count|count(|create|declare|delete|drop|drop table|exec|execute|from|grant|group_concat|having|information_schema.columns|insert|like|master|mid|mid(|net local group administrators|net user|or|orderhaving|select|sitename|table|table_schema|truncate|union|update|use|where|xp_cmdshell"; private const string SqlCommandKeywords = "*|and|asc(|by|char|char(|chr|column_name|count|count(|create|declare|delete|drop|drop table|exec|execute|from|grant|group_concat|having|information_schema.columns|insert|like|master|mid|mid(|net local group administrators|net user|or|orderhaving|select|sitename|table|table_schema|truncate|union|update|use|where|xp_cmdshell";
private const string SqlSeparatKeywords = "--|;|!|'|\"|(|)|[|]|{|}|*|/*|#|%"; //private const string SqlSeparatKeywords = "--|;|!|'|\"|(|)|[|]|{|}|*|/*|#|%";
private static readonly List<string> SqlKeywordsArray = new List<string>(); private static readonly List<string> SqlKeywordsArray = new List<string>();
/// <summary> /// <summary>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment