Skip to content

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

Removed spaces from incoming data source

Krishnasis Mandal86389e943973
diff --git a/modules/sfp_creditcard.py b/modules/sfp_creditcard.py
index 40255e9f..d2f952e5 100644
--- a/modules/sfp_creditcard.py
+++ b/modules/sfp_creditcard.py
@@ -44,7 +44,6 @@ class sfp_creditcard(SpiderFootPlugin):
self.opts[opt] = userOpts[opt]
# What events is this module interested in for input
- # For a list of all events, check sfdb.py.
def watchedEvents(self):
return ["TARGET_WEB_CONTENT"]
@@ -67,6 +66,7 @@ class sfp_creditcard(SpiderFootPlugin):
# event was received.
self.sf.debug("Received event, " + eventName + ", from " + srcModuleName)
+ # Extract Credit Card numbers
creditCards=self.sf.parseCreditCards(eventData)
myres=list()
diff --git a/sflib.py b/sflib.py
index 497377fe..d69ee491 100644
--- a/sflib.py
+++ b/sflib.py
@@ -1112,7 +1112,13 @@ class SpiderFoot:
#
# Returns a list
def parseCreditCards(self,data):
- creditCards = set()
+ creditCards = set()
+
+ # Remove whitespace from data.
+ # Credit cards might contain spaces between them..
+ # ..which will cause the regex to fail
+ data = data.replace(" ","")
+
# Extract all numbers with lengths ranging from 13 - 19 digits
possibleCCRegex = "\d{13,19}"
matches = re.findall(possibleCCRegex,data)