MYSQL注入中information_schema的替代

MYSQL注入中information_schema的替代

复现去年强网杯的Torando的时候看到用了两个平时不常用的表,所以我就去翻了一遍Mysql的默认表看看还有没有可用的,结果发现其实还有很多之前从没使用过的”漏网之鱼”,在这里记录一下。

Mysql版本: 5.7.26

数据库结构:

image-20220412203345873

先罗列一下可用表:

sys.io_global_by_file_by_bytes
information_schema.PARTITIONS
information_schema.KEY_COLUMN_USAGE
performance_schema.events_statements_summary_by_digest
performance_schema.file_instances
performance_schema.file_summary_by_instance
performance_schema.file_instances
sys.schema_index_statistics
sys.schema_object_overview
sys.schema_tables_with_full_table_scans
sys.schema_table_statistics
sys.schema_table_statistics_with_buffer
sys.statements_with_errors_or_warnings
sys.statements_with_full_table_scans
sys.statements_with_runtimes_in_95th_percentile
sys.statements_with_sorting
sys.statements_with_temp_tables
sys.statement_analysis

information_schema

schemata, columns , tables这几个表就不必多说了,标准用法

另外发现几个有意思的表INNODB_FT_DEFAULT_STOPWORDtime_zone_transition

information_schema.PARTITIONS

视图有全部的库名表名

image-20220412191106671

information_schema.KEY_COLUMN_USAGE

视图有全部的库名表名和列名

image-20220412191330379

performance_schema

performance_schema.events_statements_summary_by_digest

有历史查询记录

image-20220412193254420

performance_schema.file_instances

有全部表的存放文件,也相当于全部库名了表名

image-20220412194050731

performance_schema.file_summary_by_instance

performance_schema.file_instances

performance_schema.file_summary_by_instance和performance_schema.file_instances有全部表的存放文件,相当于全部库名表名

image-20220412194244253

在sys.io_global_by_file_by_bytes和sys.io_global_by_file_by_latency能找到全部的库名和表名

image-20220412194717371

image-20220412195024193

sys

这里面很多都是基于其他表的视图,有很多视图用于分析执行语句所以有好几个视图可以用于查看当前的查询语句方便知道查询的关键信息。

sys.io_global_by_file_by_bytes

通过file字段得到库名表名,而且很齐全

image-20220412185911797

sys.schema_index_statistics

视图有部分表名字段名

image-20220412195619726

sys.schema_object_overview

有全部库名和库里面全部表的字段数个数

image-20220412195746071

sys.schema_tables_with_full_table_scans

有部分我们库名

image-20220412195847519

sys.schema_table_statistics

sys.schema_table_statistics_with_buffer

sys.schema_table_statistics和sys.schema_table_statistics_with_buffer有全部自建表的库名表名

image-20220412200015911

image-20220412200010604

sys.statements_with_errors_or_warnings

有全部执行出错的命令语句同时有与该语句相关的数据库

image-20220412200401954

sys.statements_with_full_table_scans

有扫描整个表的执行语句,同时有相关的数据库名

image-20220412200609554

sys.statements_with_runtimes_in_95th_percentile

有部分查询语句,但是满足什么条件才回到这里我也不知道,刚刚执行的有特征的测试语句在这里我只找到了一条

image-20220412200742990

sys.statements_with_sorting

sys.statements_with_temp_tables

sys.statement_analysis

sys.statements_with_sorting和sys.statements_with_temp_tables以及sys.statement_analysis这三个视图中有很多查询语句记录但是在每个视图中我都没有找到我执行的测试语句,不知道需要满足什么条件才回到这里, 不过也还是记录一下吧

image-20220412201023346

Tips

我这里使用的是Mysql5.7.26版本的但是很多环境用的都是8.X版本的所以这个就只当一个参考,在8.X版本中肯定有一些变化,但是在这里我就不去找了,感兴趣的小伙伴可以自己去找一下8.X的。

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇