Skip to content

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

Updated regex

Krishnasis Mandal85b8bbe3f06b
diff --git a/sflib.py b/sflib.py
index 1fdcf9cd..75931670 100644
--- a/sflib.py
+++ b/sflib.py
@@ -1107,7 +1107,7 @@ class SpiderFoot:
# Returns a list
def parseCreditCards(self,data):
credit_cards=set()
- credit_card_regex="^(?:4[0-9]{12}(?:[0-9]{3})?|[25][1-7][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$"
+ credit_card_regex="(?:4[0-9]{12}(?:[0-9]{3})?|[25][1-7][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})"
# Krishnasis : Note
# Potentially more effective alternative to using Regex :
@@ -1115,7 +1115,7 @@ class SpiderFoot:
# 2. Apply Luhn's algorithm to verify the credit card
# Probable Feature : Identify the Credit Card provider
- matches=re.find_all(credit_card_regex,data)
+ matches=re.findall(credit_card_regex,data)
for match in matches:
self.debug("Found possible credit card : "+match)