SQL注入问题

lishyygh1 2009-12-08 11:58:20
本人用linq框架,自己认为做了很多仿制注入的方法,也用注入工具检测过注入点.都没找到
但是结果数据库还是给注入了..
请各位指点下如何有效的仿制注入..
...全文
120 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
oopp1234567890 2009-12-08
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 js_szy 的回复:]
参考水哥的防注入的专题
[/Quote].
hujingang 2009-12-08
  • 打赏
  • 举报
回复
Global.asax.cs 这个文件


protected void Application_BeginRequest(Object sender, EventArgs e)
{
StartProcessRequest();
}

public static void StartProcessRequest()
{
try
{
string getkeys = "";
if (System.Web.HttpContext.Current.Request.QueryString != null)
{

for(int i=0;i<System.Web.HttpContext.Current.Request.QueryString.Count;i++)
{
getkeys = System.Web.HttpContext.Current.Request.QueryString.Keys[i];
if (!ProcessSqlStr(System.Web.HttpContext.Current.Request.QueryString[getkeys],0))
{
System.Web.HttpContext.Current.Response.Write("<script>window.location.href=\"/error.aspx\";</script>");
System.Web.HttpContext.Current.Response.End();
}
}
}
}
catch
{
}
}
//// <summary>
/// 分析用户请求是否正常
/// </summary>
/// <param name="Str">传入用户提交数据</param>
/// <returns>返回是否含有SQL注入式攻击代码</returns>
private static bool ProcessSqlStr(string Str,int type)
{
string SqlStr="exec|insert|select|delete|update|count|chr|mid|master|truncate|char|declare";
bool ReturnValue = true;
try
{
Str=Str.ToLower();
if (Str != "")
{
string[] anySqlStr = SqlStr.Split('|');
foreach (string ss in anySqlStr)
{
if (Str.IndexOf(ss)>=0)
{
ReturnValue = false;
}
}
}
}
catch
{
ReturnValue = false;
}
return ReturnValue;
}
ws_hgo 2009-12-08
  • 打赏
  • 举报
回复
看精华帖
pbsh 2009-12-08
  • 打赏
  • 举报
回复
友情帮顶
华夏小卒 2009-12-08
  • 打赏
  • 举报
回复
参考水哥的防注入的专题
--小F-- 2009-12-08
  • 打赏
  • 举报
回复
http://topic.csdn.net/u/20090326/11/5e584897-2dd7-4e10-af1b-9b48b146af8e.html?95281
http://topic.csdn.net/u/20090523/19/72041932-b65c-49c1-ad36-d2c63b38b174.html?96607
duanzhi1984 2009-12-08
  • 打赏
  • 举报
回复
baidu下吧!
fwacky 2009-12-08
  • 打赏
  • 举报
回复
http://topic.csdn.net/u/20081205/09/3dd06076-bcbe-45d4-998c-8999fdbe6fae.html?84220
fwacky 2009-12-08
  • 打赏
  • 举报
回复
看精华帖

22,209

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧