SQL注入-查表查列


概述

  Ciscn2021线上初赛的easy-sql中,过滤了information、sys、nno等关键字。
但是能够查询表名的数据库、表是值得收集的。

  MySQL5.7中,有四个默认数据库,分别是information_schema库、sys库、mysql库、performance_schema库。

  (1)information_schema自带数据库:可以查询表名和列名。

  (2)sys系统库:支持MySQL 5.6或更高版本,5.5.x及其以下版本不支持。
更多的权限限制可以查看《MySQL默认数据库之sys库 》这篇文章。

  (3)mysql系统数据库:主要存储了一些存储MySQL服务的系统信息表。一般情况下mysql库的表都是MYASIM引擎

  (4)performance_schema库。


系统数据库sys_4+3-ok

  总结:默认库sys中,可用来查询表名和列名的表。

	(1)schema_auto_increment_columns表,可以查询所有的数据库名、表名、列名
前三个列名是:table_schema、table_name、column_name

	(2)schema_index_statistics表,可以查询所有的数据库名、表名
	(3)schema_table_statistics表,可以查询所有的数据库名、表名
	(4)schema_table_statistics_with_buffer表,可以查询所有的数据库名、表名

	(5)x$schema_index_statistics,表名
	(6)x$schema_table_statistics,表名
	(7)x$schema_table_statistics_with_buffer,表名

  1、sys.schema系列表:MySQL执行语句select * from 表;查看表的内容。
有1个表可以查询表名和列名,另外3个表可以查询表名。

	(1)schema_auto_increment_columns表,可以查询所有的数据库名、表名、列名
前三个列名是:table_schema、table_name、column_name

	(2)schema_index_statistics表,可以查询所有的数据库名、表名
	(3)schema_table_statistics表,可以查询所有的数据库名、表名
	(4)schema_table_statistics_with_buffer表,可以查询所有的数据库名、表名

| schema_object_overview,数据库中表的数量
| schema_redundant_indexes,查询为空
| schema_table_lock_waits,查询为空
| schema_tables_with_full_table_scans,查询为空           
| schema_unused_indexes,未使用的索引列表

  2、sys.$x系列:有3个可查询表名的表,与schema系列对应,只是加了前缀$x

	x$schema_flattened_keys,可以可以查询所有的数据库名、表名,以及第一列的列名或主键列名
它们的列名分别是:table_schema、table_name、index_columns

	x$schema_index_statistics,表名
	x$schema_table_statistics,表名
	x$schema_table_statistics_with_buffer,表名

| x$schema_table_lock_waits,为空
| x$schema_tables_with_full_table_scans,查询执行过全扫描访问的表
| x$statements_with_full_table_scans,查看全表扫描或者没有使用到最优索引的语句
| x$statements_with_temp_tables,使用临时表的规范化语句

  3、其他目前可记录的表:
sys.version表,可以查询sys_version和mysql_version。
sys.innodb系列3个表,没找到表信息和列信息。

+-------------+---------------+
| sys_version | mysql_version |
+-------------+---------------+
| 1.5.1       | 5.7.26        |
+-------------+---------------+

系统数据库mysql


系统数据库performance_schema


参考

  《MySQL默认数据库之sys库 》,2019-07
http://blog.itpub.net/26736162/viewspace-2651254/

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值