Skip to content

SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.

Fix Google Maps to use API now, as old API doesn't work without a key anymore.

Steve Micallef27c8bd15843d
diff --git a/modules/sfp_googlemaps.py b/modules/sfp_googlemaps.py
index a44119b6..24fc4dd3 100644
--- a/modules/sfp_googlemaps.py
+++ b/modules/sfp_googlemaps.py
@@ -16,16 +16,23 @@ from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEvent
class sfp_googlemaps(SpiderFootPlugin):
- """Google Maps:Footprint,Investigate,Passive:Real World::Identifies potential physical addresses and latitude/longitude coordinates."""
+ """Google Maps:Footprint,Investigate,Passive:Real World:apikey:Identifies potential physical addresses and latitude/longitude coordinates."""
# Default options
- opts = {}
+ opts = {
+ "api_key": ""
+ }
+ optdescs = {
+ "api_key": "Google Geocoding API Key."
+ }
results = dict()
+ errorState = False
def setup(self, sfc, userOpts=dict()):
self.sf = sfc
self.results = dict()
+ self.errorState = False
for opt in userOpts.keys():
self.opts[opt] = userOpts[opt]
@@ -46,8 +53,16 @@ class sfp_googlemaps(SpiderFootPlugin):
srcModuleName = event.module
eventData = event.data
+ if self.errorState:
+ return None
+
self.sf.debug("Received event, " + eventName + ", from " + srcModuleName)
+ if self.opts['api_key'] == "":
+ self.sf.error("You enabled sfp_googlemaps but did not set an API key!", False)
+ self.errorState = True
+ return None
+
# Don't look up stuff twice
if eventData in self.results:
self.sf.debug("Skipping " + eventData + " as already mapped.")
@@ -56,7 +71,8 @@ class sfp_googlemaps(SpiderFootPlugin):
self.results[eventData] = True
res = self.sf.fetchUrl("https://maps.googleapis.com/maps/api/geocode/json?address=" + \
- eventData, timeout=self.opts['_fetchtimeout'],
+ eventData + "&key=" + self.opts['api_key'],
+ timeout=self.opts['_fetchtimeout'],
useragent=self.opts['_useragent'])
if res['content'] is None:
self.sf.info("No location info found for " + eventData)
diff --git a/static/img/spiderfoot.png b/static/img/spiderfoot.png
deleted file mode 100644
index 67b2690f..00000000
Binary files a/static/img/spiderfoot.png and /dev/null differ