SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.
Python attacksurfacecticybersecurityfootprintinghackinginformation-gatheringinformation-securityinfosecintelligence-gatheringosintosint-frameworkosint-reconnaissanceosint-toolpentestingpythonreconsecurity-toolsthreat-intelligencethreatintel
Review Changes - 3, some bug fixes and some logical changes
Krishnasis Mandal0bcc2f5569ec
diff --git a/modules/sfp_countryname.py b/modules/sfp_countryname.pyindex dc93cd0e..9f6471e8 100644--- a/modules/sfp_countryname.py+++ b/modules/sfp_countryname.py@@ -173,11 +173,13 @@ class sfp_countryname(SpiderFootPlugin):# Check if country code is present in the phone numbertry:countryCode = region_code_for_country_code(phoneNumber.country_code)+ # try block handles key not found exception+ return abbvCountryCodes[countryCode.upper()]except:# Region code not present in source phone numberself.debug("Skipped invalid phone number: " + srcPhoneNumber)return None- return abbvCountryCodes[countryCode.upper()]+# Detect name of country from TLD of domain namedef detectCountryFromTLD(self, srcDomain):@@ -219,17 +221,17 @@ class sfp_countryname(SpiderFootPlugin):return None# Detect name of country from whois lookup, Geo Info, Physical Address data- def detectCountryFromData(self, srcWhoIs):+ def detectCountryFromData(self, srcData):# Get dictionary of country codes and country namesabbvCountryCodes = self.getCountryCodeDict()countries = list()- # Look for countrycodes and country in whois data+ # Look for countrycodes and country in source datafor countryName in abbvCountryCodes.values():- # Look for country name in whois data- matchCountries = re.findall("[\s,'\"]" + countryName + "[\s,'\"]", srcWhoIs, re.IGNORECASE)+ # Look for country name in source data+ matchCountries = re.findall("[\s,'\"]" + countryName + "[\s,'\"]", srcData, re.IGNORECASE)if len(matchCountries) > 0:# Get country name from first index of list@@ -283,7 +285,11 @@ class sfp_countryname(SpiderFootPlugin):elif eventName == "IBAN_NUMBER":countryNames.append(self.detectCountryFromIBAN(eventData))elif eventName in ["DOMAIN_WHOIS", "GEOINFO", "PHYSICAL_ADDRESS"] or (eventName == "AFFILIATE_DOMAIN_WHOIS" and self.opts["affiliate"]) or (eventName == "CO_HOSTED_SITE_DOMAIN_WHOIS" and self.opts["cohosted"]):- countryNames.extend(self.detectCountryFromData(eventData))+ tempDataList = self.detectCountryFromData(eventData)+ if tempDataList is None:+ countryNames.append(None)+ else:+ countryNames.extend(tempDataList)# Check if countryNames is emptyif None in countryNames: