·Àsql×¢ÈëÀà
using System;
using System.Text.RegularExpressions;
using System.Web;
namespace FSqlKeyWord
{
/**//**//**//// <summary>
/// SqlKey µÄժҪ˵Ã÷¡£
/// </summary>
public class SqlKey
{
private HttpRequest request;
//private const 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 StrKeyWord1 = @"(like|and|exec|insert|select|delete|update|chr|mid|master|or|truncate|char|declare|join)".Replace("|",")|(");
private const string StrKeyWord = @"( like | and | exec |insert|select|delete|update|chr|mid|master| or |truncate|char|declare|join|exec master|xp_cmdshell|net user|systypes|sysobjects)";
//private const string StrRegex = @"([-|;|,|/|(|)|[|]|}|{|%|@|*|!|'])";
private const string StrRegex = @"--|'|@|!";
public SqlKey(System.Web.HttpRequest _request)
{
//
// TODO: ÔÚ´Ë´¦Ìí¼Ó¹¹Ô캯ÊýÂß¼
//
this.request = _request;
}
public SqlKey()
{
//
// TODO: ÔÚ´Ë´¦Ìí¼Ó¹¹Ô캯ÊýÂß¼
//
//this.request = _request;
}
/**//**//**//// <summary>
/// Ö»¶ÁÊôÐÔ SQL¹Ø¼ü×Ö
/// </summary>
public static string KeyWord
{
get
{
return StrKeyWord;
}
}
/**//**//**//// <summary>
/// Ö»¶ÁÊôÐÔ¹ýÂËÌØÊâ×Ö·û
/// </summary>
public static string RegexString
{
get
{
return StrRegex;
}
}
/**//**//**//// <summary>
/// ¼ì²éURL²ÎÊýÖÐÊÇ·ñ´øÓÐSQL×¢Èë¿ÉÄܹؼü×Ö¡£
/// </summary>
/// <param na
Ïà¹ØÎĵµ£º
¡¾ÎÄÕ±êÌâ¡¿±àд
SQL
²éѯµÄ¹Ø¼ü—
SQL
Óï¾äµÄÖ´ÐÐ˳Ðò
¡¾ÎÄÕÂ×÷Õß¡¿Ôø½¡Éú
¡¾×÷ÕßÓÊÏä¡¿
zengjiansheng1@126.com
¡¾×÷Õß
QQ
¡¿
190678908
¡¾×÷Õß
MSN
¡¿
zengjiansheng1@hotmail.com
¡¾×÷Õß²©¿Í¡¿
blog.csdn.net/newjueqi
*********************************************************** ......
Ò»¡¢É¶ÊÇsql×¢Èë
Ëùνsql×¢Èë¼òµ¥Ëµ¾ÍÊDZ»ÈË×êÁËSQLµÄ¿Õ×ÓÏÂÃæ¾Ù¸ö×î¼òµ¥µÄÀý×Ó¡£
sql Ϊ£º"select * from users where username='"+userName+"' and password='"+password+"' "
1¡¢¹¥»÷ÕßÖ»ÒªÔÚ´«ÈëµÄuserName¼ÓÉÏ'--ÉÏÃæµÄsql±ã½« ......
ÈçºÎʹÓà SSL À´È·±£Óë SQL Server 2000 °²È«Í¨ÐÅ
¸üÐÂÈÕÆÚ£º 2004Äê04ÔÂ20ÈÕ
±¾Ò³ÄÚÈÝ
Ä¿±ê
ÊÊÓ÷¶Î§
ÈçºÎʹÓñ¾ÕÂÄÚÈÝ
ÕªÒª
Äú±ØÐëÁ˽âµÄ±³¾°ÖªÊ¶
°²×°·þÎñÆ÷ÑéÖ¤Ö¤Êé
ÑéÖ¤Ö¤ÊéÊÇ·ñÒÑ°²×°
ÔÚ¿Í»§¶Ë°²×° CA °ä·¢µÄÖ¤Êé
Ç¿ÖÆËùÓпͻ§¶ËʹÓà SSL
ÔÊÐí¿Í»§¶Ë¾ö¶¨ÊÇ·ñʹÓà SSL
Ñé֤ͨÐÅÊÇ·ñÒѼÓÃÜ
ÆäËû× ......
ÔÚÕâÒ»Ò³ÖУ¬ÎÒÃÇÁгöËùÓÐÔÚÕâ¸öÍøÕ¾ÓÐÁгö SQL Ö¸ÁîµÄÓï·¨¡£ÈôÒª¸üÏ꾡µÄ˵Ã÷£¬ÇëµãÑ¡Ö¸ÁîÃû³Æ¡£
ÕâÒ»Ò³µÄÄ¿µÄÊÇÌṩһ¸ö¼ò½àµÄ SQL Óï·¨×öΪ¶ÁÕ߲ο¼Ö®Óá£ÎÒÃǽ¨ÒéÄúÏÖÔھͰ´ Control-D ½«±¾Ò³¼ÓÈëÄúµÄ¡ºÎÒµÄ×î°®¡»¡£
Select
SELECT "À¸Î»" from "±í¸ñÃû"
Distinct
SELECT DISTINCT "À¸Î»"
from "±í¸ñÃû"
Where
......