-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexploiter.py
189 lines (172 loc) · 7.94 KB
/
exploiter.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
import requests
import warnings
import json
import sys
import time
import os
from time import sleep
# The screen clear function
def screen_clear():
# for mac and linux(here, os.name is 'posix')
if os.name == 'posix':
_ = os.system('clear')
else:
# for windows platfrom
_ = os.system('cls')
screen_clear()
def slowprint(s):
for c in s + '\n':
sys.stdout.write(c)
sys.stdout.flush()
time.sleep(7. /100)
slowprint("\033[1;31m \033[91m [!] Starting Exploiter ...")
time.sleep(3)
os.system('clear')
def slowprint(s):
for c in s + '\n':
sys.stdout.write(c)
sys.stdout.flush()
time.sleep(0. /100)
slowprint(''' \033[1;31m \033[91m
_____ ______ _ _ _
/ ____| | ____| | | (_) |
| | __ _ __ ___ __ _ _ __ | |__ __ ___ __ | | ___ _| |_ ___ _ __
| | |_ | '_ ` _ \ / _` | '_ \ | __| \ \/ / '_ \| |/ _ \| | __/ _ \ '__|
| |__| | | | | | | (_| | |_) | | |____ > <| |_) | | (_) | | || __/ |
\_____|_| |_| |_|\__,_| .__/ |______/_/\_\ .__/|_|\___/|_|\__\___|_|
| | | |
|_| |_|
\033[97m ''')
def slowprint(s):
for c in s + '\n':
sys.stdout.write(c)
sys.stdout.flush()
time.sleep(3. /100)
slowprint("\t\t \033[93m Coded By : Parshwa Bhavsar \033[97m")
vulnerable_apis = []
warnings.filterwarnings("ignore")
apikey = raw_input("Please enter the Google Maps API key you wanted to test: ")
url = "https://maps.googleapis.com/maps/api/staticmap?center=45%2C10&zoom=7&size=400x400&key="+apikey
response = requests.get(url, verify=False)
if response.status_code == 200:
print "API key is \033[1;31;40m vulnerable \033[0m for Staticmap API! BOOM! Here is the Link "
print url
vulnerable_apis.append("Staticmap")
else:
print "not vulnerable"
print "Reason: "+ response.content
url = "https://maps.googleapis.com/maps/api/streetview?size=400x400&location=40.720032,-73.988354&fov=90&heading=235&pitch=10&key="+apikey
response = requests.get(url, verify=False)
if response.status_code == 200:
print "API key is \033[1;31;40m vulnerable \033[0m for Streetview API! BOOM! Here is the Link"
print url
vulnerable_apis.append("Streetview")
else:
print "not vulnerable"
print "Reason: "+ response.content
url = "https://www.google.com/maps/embed/v1/place?q=Seattle&key="+apikey
response = requests.get(url, verify=False)
if response.status_code == 200:
print "API key is \033[1;31;40m vulnerable \033[0m for Embed (Basic-Free) API! BOOM! Here is the Link"
print "<iframe width=\"600\" height=\"450\" frameborder=\"0\" style=\"border:0\" src=\""+url+"\" allowfullscreen></iframe>"
vulnerable_apis.append("Embed (Basic-Free)")
else:
print "not vulnerable"
print "Reason: "+ response.content
url = "https://www.google.com/maps/embed/v1/search?q=record+stores+in+Seattle&key="+apikey
response = requests.get(url, verify=False)
if response.status_code == 200:
print "API key is \033[1;31;40m vulnerable \033[0m for Embed (Advanced-Paid) API! BOOM! Here is the Link"
print "<iframe width=\"600\" height=\"450\" frameborder=\"0\" style=\"border:0\" src=\""+url+"\" allowfullscreen></iframe>"
vulnerable_apis.append("Embed (Advanced-Paid)")
else:
print "not vulnerable"
if len(response.content.split("\"")) < 77:
print "Reason: "+ response.content
else:
print "Reason: "+ response.content.split("\"")[77]
url = "https://maps.googleapis.com/maps/api/directions/json?origin=Disneyland&destination=Universal+Studios+Hollywood4&key="+apikey
response = requests.get(url, verify=False)
if response.text.find("error_message") < 0:
print "API key is \033[1;31;40m vulnerable \033[0m for Directions API! BOOM! Here is the Link"
print url
vulnerable_apis.append("Directions")
else:
print "not vulnerable"
print "Reason: "+ response.json()["error_message"]
url = "https://maps.googleapis.com/maps/api/geocode/json?latlng=40,30&key="+apikey
response = requests.get(url, verify=False)
if response.text.find("error_message") < 0:
print "API key is \033[1;31;40m vulnerable \033[0m for Geocode API! BOOM! Here is the Link"
print url
vulnerable_apis.append("Geocode")
else:
print "not vulnerable"
print "Reason: "+ response.json()["error_message"]
url = "https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=40.6655101,-73.89188969999998&destinations=40.6905615%2C-73.9976592%7C40.6905615%2C-73.9976592%7C40.6905615%2C-73.9976592%7C40.6905615%2C-73.9976592%7C40.6905615%2C-73.9976592%7C40.6905615%2C-73.9976592%7C40.659569%2C-73.933783%7C40.729029%2C-73.851524%7C40.6860072%2C-73.6334271%7C40.598566%2C-73.7527626%7C40.659569%2C-73.933783%7C40.729029%2C-73.851524%7C40.6860072%2C-73.6334271%7C40.598566%2C-73.7527626&key="+apikey
response = requests.get(url, verify=False)
if response.text.find("error_message") < 0:
print "API key is \033[1;31;40m vulnerable \033[0m for Distance Matrix API! BOOM! Here is the Link"
print url
vulnerable_apis.append("Distance Matrix")
else:
print "not vulnerable"
print "Reason: "+ response.json()["error_message"]
url = "https://maps.googleapis.com/maps/api/place/findplacefromtext/json?input=Museum%20of%20Contemporary%20Art%20Australia&inputtype=textquery&fields=photos,formatted_address,name,rating,opening_hours,geometry&key="+apikey
response = requests.get(url, verify=False)
if response.text.find("error_message") < 0:
print "API key is \033[1;31;40m vulnerable \033[0m for Find Place From Text API! BOOM! Here is the Link"
print url
vulnerable_apis.append("Find Place From Text")
else:
print "not vulnerable"
print "Reason: "+ response.json()["error_message"]
url = "https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Bingh&types=%28cities%29&key="+apikey
response = requests.get(url, verify=False)
if response.text.find("error_message") < 0:
print "API key is \033[1;31;40m vulnerable \033[0m for Autocomplete API! BOOM! Here is the Link"
print url
vulnerable_apis.append("Autocomplete")
else:
print "not vulnerable"
print "Reason: "+ response.json()["error_message"]
url = "https://maps.googleapis.com/maps/api/elevation/json?locations=39.7391536,-104.9847034&key="+apikey
response = requests.get(url, verify=False)
if response.text.find("error_message") < 0:
print "API key is \033[1;31;40m vulnerable \033[0m for Elevation API!BOOM! Here is the Link"
print url
vulnerable_apis.append("Elevation")
else:
print "not vulnerable"
print "Reason: "+ response.json()["error_message"]
url = "https://maps.googleapis.com/maps/api/timezone/json?location=39.6034810,-119.6822510×tamp=1331161200&key="+apikey
response = requests.get(url, verify=False)
if response.text.find("errorMessage") < 0:
print "API key is \033[1;31;40m vulnerable \033[0m for Timezone API! BOOM! Here is the Link"
print url
vulnerable_apis.append("Timezone")
else:
print "not vulnerable"
print "Reason: "+ response.json()["errorMessage"]
url = "https://roads.googleapis.com/v1/nearestRoads?points=60.170880,24.942795|60.170879,24.942796|60.170877,24.942796&key="+apikey
response = requests.get(url, verify=False)
if response.text.find("error") < 0:
print "API key is \033[1;31;40m vulnerable \033[0m for Roads API! BOOM! Here is the Link"
print url
vulnerable_apis.append("Roads")
else:
print "not vulnerable"
print "Reason: "+ response.json()["error"]["message"]
url = "https://www.googleapis.com/geolocation/v1/geolocate?key="+apikey
postdata = {'considerIp': 'true'}
response = requests.post(url, data=postdata, verify=False)
if response.text.find("error") < 0:
print "API key is \033[1;31;40m vulnerable \033[0mfor Geolocation API! BOOM! Here is the Link"
print "curl -i -s -k -X $'POST' -H $'Host: www.googleapis.com' -H $'Content-Length: 22' --data-binary $'{\"considerIp\": \"true\"}' $'"+url+"'"
vulnerable_apis.append("Geolocation")
else:
print "not vulnerable"
print "Reason: "+ response.json()["error"]["message"]
print "Results:"
for i in range (len(vulnerable_apis)):
print "- " + vulnerable_apis[i]