同样采用union的联合语句,去查询数据库默认创建的Information_schema的数据库,这个数据库是记录数据库所有参数数据的。所以,我们可以尝试使用字符型注入的闭合语句去查询。
首先输入一个’,发现返回的是错误语句,说明我们输入的内容是拼接到数据库里的。
sql注入(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’#
这个就可以查询到数据库后台的数据了。
返回的结果是这样子:
sql注入(information_schema注入)
这样,一次information_schema注入就完成了

相关文章:

  • 2021-06-10
  • 2021-08-09
  • 2021-11-29
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-16
  • 2022-01-20
  • 2022-03-05
  • 2021-10-31
  • 2021-08-28
相关资源
相似解决方案