Home

SQL注入学习-information_schema库

2019/03/30

SQL注入学习-information_schema库

查看information_schema库

1、schemata表
打开名叫schemata(这个单词是schem-图表的复数形式)的表,可以看到表中的内容,其中有一列的列名为schema_name,此列的数据为所有的数据库的名称
image

2、tables表
打开名叫tables的表,可以看到表中的其中两列:table_schema和table_name,table_name的数据为数据库中的表名,而table_schema的数据为table_name中的表所对应的数据库名
image

3、columns表
打开名叫columns的表,可以看到表中的其中三列:table_schema,table_name,column_name,其中的table_schema,table_name和在tables的表中的作用是相同的,而column_name这一列中的数据存放的是各个表里的列名
image

利用information_schema进行注入

1、猜库
select schema_name from information_schema.schema

2、猜库中的表
select table_name from information_schema.tables where table_shcema=”xxx”

3、猜表中列
select column_name from information_schema.columns where table_name=”xxx”

4、猜段
select *** from ***