同样采用union的联合语句,去查询数据库默认创建的Information_schema的数据库,这个数据库是记录数据库所有参数数据的。所以,我们可以尝试使用字符型注入的闭合语句去查询。
首先输入一个’,发现返回的是错误语句,说明我们输入的内容是拼接到数据库里的。
然后重复字符型和union章节的操作,我们可以查询到很多关于网站数据库的信息,包括数据库名等。
然后我来看这条
例句:
SELECT id,email from member where username =‘kobe’ union select table_schema,table_name from information_schema.tables where table_schema=‘pikachu’;(pikachu为我们之前查询到的表名)。
测试语句:kobe’ union select table_schema,table_name from information_schema.tables where table_schema=‘pikachu’#
这个就可以查询到数据库后台的数据了。
返回的结果是这样子:
这样,一次information_schema注入就完成了
N10-sql注入(information_schema注入)
最新推荐文章于 2023-06-10 15:04:37 发布