Skip to content

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

Catch string split errors

Brendan Coles24870257de97
diff --git a/modules/sfp_github.py b/modules/sfp_github.py
index d098507e..596761e6 100644
--- a/modules/sfp_github.py
+++ b/modules/sfp_github.py
@@ -81,8 +81,13 @@ class sfp_github(SpiderFootPlugin):
# Extract name and location from profile
if eventName == "SOCIAL_MEDIA":
- network = eventData.split(": ")[0]
- name = eventData.split(": ")[1]
+ try:
+ network = eventData.split(": ")[0]
+ name = eventData.split(": ")[1]
+ except BaseException as e:
+ self.sf.error("Unable to parse SOCIAL_MEDIA: " +
+ eventData + " (" + str(e) + ")", False)
+ return None
if not network == "Github":
self.sf.debug("Skipping social network profile, " + name + ", as not a Github profile")
diff --git a/modules/sfp_myspace.py b/modules/sfp_myspace.py
index 58441f70..1098c8f7 100644
--- a/modules/sfp_myspace.py
+++ b/modules/sfp_myspace.py
@@ -89,8 +89,13 @@ class sfp_myspace(SpiderFootPlugin):
# Retrieve location from MySpace profile
if eventName == "SOCIAL_MEDIA":
- network = eventData.split(": ")[0]
- name = eventData.split(": ")[1]
+ try:
+ network = eventData.split(": ")[0]
+ name = eventData.split(": ")[1]
+ except BaseException as e:
+ self.sf.error("Unable to parse SOCIAL_MEDIA: " +
+ eventData + " (" + str(e) + ")", False)
+ return None
if network != "MySpace":
self.sf.debug("Skipping social network profile, " + name + ", as not a MySpace profile")
diff --git a/modules/sfp_slideshare.py b/modules/sfp_slideshare.py
index 6956d12a..162493c3 100644
--- a/modules/sfp_slideshare.py
+++ b/modules/sfp_slideshare.py
@@ -57,8 +57,13 @@ class sfp_slideshare(SpiderFootPlugin):
self.sf.debug("Received event, " + eventName + ", from " + srcModuleName)
# Retrieve profile
- network = eventData.split(": ")[0]
- name = eventData.split(": ")[1]
+ try:
+ network = eventData.split(": ")[0]
+ name = eventData.split(": ")[1]
+ except BaseException as e:
+ self.sf.error("Unable to parse SOCIAL_MEDIA: " +
+ eventData + " (" + str(e) + ")", False)
+ return None
if not network == "SlideShare":
self.sf.debug("Skipping social network profile, " + name + ", as not a SlideShare profile")
diff --git a/modules/sfp_spyonweb.py b/modules/sfp_spyonweb.py
index 57852a4e..95cc9030 100644
--- a/modules/sfp_spyonweb.py
+++ b/modules/sfp_spyonweb.py
@@ -228,8 +228,13 @@ class sfp_spyonweb(SpiderFootPlugin):
# Find affiliate domains for the specified Google AdSense ID or Google Analytics ID
if eventName in [ 'WEB_ANALYTICS_ID' ]:
- network = eventData.split(": ")[0]
- analytics_id = eventData.split(": ")[1]
+ try:
+ network = eventData.split(": ")[0]
+ analytics_id = eventData.split(": ")[1]
+ except BaseException as e:
+ self.sf.error("Unable to parse WEB_ANALYTICS_ID: " +
+ eventData + " (" + str(e) + ")", False)
+ return None
data = dict()
if network == 'Google AdSense':
diff --git a/modules/sfp_twitter.py b/modules/sfp_twitter.py
index 75788547..cea5f174 100644
--- a/modules/sfp_twitter.py
+++ b/modules/sfp_twitter.py
@@ -53,8 +53,13 @@ class sfp_twitter(SpiderFootPlugin):
self.sf.debug("Received event, " + eventName + ", from " + srcModuleName)
# Retrieve profile
- network = eventData.split(": ")[0]
- name = eventData.split(": ")[1]
+ try:
+ network = eventData.split(": ")[0]
+ name = eventData.split(": ")[1]
+ except BaseException as e:
+ self.sf.error("Unable to parse SOCIAL_MEDIA: " +
+ eventData + " (" + str(e) + ")", False)
+ return None
if not network == "Twitter":
self.sf.debug("Skipping social network profile, " + name + ", as not a Twitter profile")