Loading...
 导航 所在位置:论坛首页 -> ┈┋BBSGood专区┋┈ -> BBSGood帮助文档 -> 如何更好的预防GET方式的SQL注入
管理员发帖回复

如何更好的预防GET方式的SQL注入

作者:客服2 时间:2008-12-31 14:50:45 收藏 编辑

目前网络上各种注入工具多如牛毛,虽然论坛系统中内置了防注入的手段,但是用户不当的设置和修改仍然可被利用,在BBSGOOD论坛中,所有涉及数据库的页面都用到了conn.asp这个文件,我们在里面加入GET方式防注入的通用代码,可以有效的防止注入攻击.

在 Option Explicit 语句后面,增加以下语句

本帖相关代码

dim server_name1,script_name1,QUERY_STRING1,FsUrl1
server_name1=request.servervariables("server_name")
script_name1=request.servervariables("script_name")
QUERY_STRING1=Request.ServerVariables("QUERY_STRING")
if QUERY_STRING1="" then
    FsUrl1="http://"&server_name1&script_name1
else
    FsUrl1="http://"&server_name1&script_name1&"?"&QUERY_STRING1
end if
if instr(1,FsUrl1,"(",1)>0 or instr(1,FsUrl1,"'",1)>0 or instr(1,FsUrl1,"%20or%20",1)>0 or instr(1,FsUrl1,"%20and%20",1)>0 then
    Response.Write "含有非法字符"
    Response.End
end if

上面的代码中,过滤了get方式的 (和' 这些

该帖子于2008-12-31 15:24:36被 客服2 编辑过



·热门回顾

·最新帖子

·天天烹饪
作者:pp12a501编辑 删除 引用 第2楼

支持中.谢谢楼主分享.

签名
内衣加盟品牌内衣加盟
发帖时间:2009-12-12 11:19:31
作者:pp12a501编辑 删除 引用 第3楼
路过,好好了解下,支持中。
签名
内衣加盟品牌内衣加盟
发帖时间:2010-3-10 11:56:42
作者:timmydan编辑 删除 引用 第4楼
445222222222222222222222222222222222222222222222222224
签名
发帖时间:2010-6-2 3:29:41
作者:timli编辑 删除 引用 第5楼
金额近哦金额
签名
发帖时间:2010-6-24 11:00:58
作者:qiaozhezhu编辑 删除 引用 第6楼

Both of these 点此打开链接!wow power leveling characters carry a phenomenal 点此打开链接!wow power leveling amount of damage and hit 点此打开链接!wow power leveling points, and you should have at least 点此打开链接!aion kina one or two on your 5x5 arena 点此打开链接!buy wow gold team.Hunters and Warlocks are two other 点此打开链接!gold in wow classes that are great for the arena. Both 点此打开链接!wow gold eu have pets that can also be used to help 点此打开链接!wow gold cheap attack and kill other players, and the 点此打开链接!cheap aion power leveling warlock has many great affliction 点此打开链接!EVE ISK and curse spells that can help to slow and subdue the other side.

签名
发帖时间:2011-1-22 15:42:03
第1页 共1页 共5个回复     <<    >>    
快速回复
  • 支持UBB,HTML标签

  • 高级回复

  • 操作选项:评分 加精 解精 奖惩 设专题 设公告 解公告 固顶 总固顶 解固顶 结帖 解结帖 锁帖 解锁 移帖 删帖