[SWPU2019]Web1
[SWPU2019]Web1
考点
bypass information_schema
无列名注入
题解
bypass information_schema
information_schema 在mysql中就是个信息数据库,它保存着mysql服务器所维护的所有其他数据库的信息,包括了数据库名,表名,字段名等。
在注入中,infromation_schema 库的作用无非就是可以获取到 table_schema,table_name,column_name这些数据库内的信息。
mysql在5.7版本中新增了sys schemma,基础数据来自于performance_chema和information_schema两个库,本身数据库不存储数据
注:innoDB引擎也可以绕过对information_schema的过滤,但是mysql默认是关闭InnoDB存储引擎的
如果在设计表时,给每个表加一个自增的id字段,那么就可以使用这种方法
首先,schema_auto_increment_columns,该视图的作用简单来说就是用来对表自增ID的监控。那么我们可以通过该视图获取数据库的表名信息
如何获取没有自增主键的表的数据,这就要用到schema_table_statistics_with_buffer和x$schema_table_statistics_with_buffer
限制: mysql ≥ 5.7版本 要超级管理员才可以访问sys
使用innoDB引擎绕过information_schema
表引擎为 innoDB
MySQL > 5.5
innodb_table_stats、innodb_index_stats存放所有库名表名
select table_name from mysql.innodb_table_stats where database_name=库名;
第三种姿势
爆库名 select 1,2,3 from users where 1=abc();
爆表名 select 1,2,3 from users where Polygon(id);
爆表名 select 1,2,3 from users where linestring(id);
爆字段名 select 1,2,3 from users where (select * from (select * from users as a join users as b)as c);
爆字段名 select 1,2,3 from users where (select * from (select * from users as a join users as b using(id))as c);
无列名注入
用数字表示对应的列
当反引号不能使用时,就可以使用别名
利用 join 报错来获取列名,分别获取第一个列和第三个列
wp
上面说的三种姿势都不行。
首先,发现过滤了or,空格,information_schema,#
POST数据,提示为 The used SELECT statements have a different number of columns
写个脚本爆破一下有多少列,结果为22列,显示位在2,3位
语句为
这里进行无列名注入,查询users表进行无列名注入,查询第一列语句如下
在本题最终bypass语句如下
最后更新于