MySQL注入笔记(三)—特殊库information_schema利用

本文介绍了Mysql版本5.0及以上中information_schema特殊库的作用,包括如何查询数据库名、表名、列名和数值数据,以及使用union和子查询的功能。重点展示了通过SCHEMATA, TABLES, COLUMNS等表获取数据库结构信息的操作实例。
摘要由CSDN通过智能技术生成

1.基本介绍

Mysql version>5.0 存在该库
可以当作整个数据库的索引字典,利用它可以查询(爆破)指定库名,列名,表名等。
4.0以上支持union
4.1以上支持子查询

2.特殊库中的常用表

SCHEMATA:可查询库信息
TABLES:可查询表信息
COLUMNS:查询列名

3.通过特殊库查询信息

3.1.查询数据库

select schema_name from information_schema.schemata;
mysql> select schema_name from information_schema.schemata;
+--------------------+
| SCHEMA_NAME        |
+--------------------+
| mysql              |
| information_schema |
| performance_schema |
| sys                |
| students           |
+--------------------+
5 rows in set (0.00 sec)

3.2 查询数据表

 select table_name from information_schema.tabels where table_schema="students";
mysql> select table_name from information_schema.tables where table_schema='students';
+------------+
| TABLE_NAME |
+------------+
| class      |
+------------+
1 row in set (0.00 sec)

3.3查询字段

select column_name from information_schema.columns where table_name="class";
mysql> select column_name from information_schema.columns where table_name="class";
+-------------+
| COLUMN_NAME |
+-------------+
| id          |
| name        |
| password    |
+-------------+
3 rows in set (0.00 sec)

3.4查询数值

select id,username,password from class; 
mysql> select column_name from information_schema.columns where table_name="class";
+-------------+
| COLUMN_NAME |
+-------------+
| id          |
| name        |
| password    |
+-------------+
3 rows in set (0.00 sec)
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值