-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirebaseWritableCheck.py
47 lines (36 loc) · 1.33 KB
/
firebaseWritableCheck.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
#!/usr/bin/env python3
import requests
import argparse
import sys
__author__ = 'Regis SENET'
__email__ = '[email protected]'
__git__ = 'https://github.com/rsenet/firebaseWritableCheck'
__version__ = '0.1'
__license__ = 'GPLv3'
__pyver__ = '%d.%d.%d' % sys.version_info[0:3]
short_desc = "Firebase Write Access Checker"
parser = argparse.ArgumentParser(description=short_desc)
parser.add_argument('--url', help="Specify the firebase URL")
u_args = parser.parse_args()
# Get variable
fire_url = u_args.url
fire_data = {"Exploitation": "Successfull", "Company": "BSSI"}
try:
if fire_url:
# Check if the URL is writable
fire_write = requests.put(fire_url, json=fire_data)
if fire_write.status_code == 200:
print(">> %s has been created (write permission is allowed)" % fire_url)
# Check if the created file is readable
fire_read = requests.get(fire_url)
if fire_read.status_code == 200:
print(">> %s is readable (read permission is allowed)" % fire_url)
print(fire_read.text)
else:
print(">> %s is NOT readable (read permission is NOT allowed)" % fire_url)
else:
print("Not vulnerable")
else:
parser.print_help()
except KeyboardInterrupt:
print("\n[x] Leaving ...")