Skip to content

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

modules: Resolve 'DeprecationWarning: invalid escape sequence'

Brendan Coles378dfcfb03cb
diff --git a/modules/sfp_base64.py b/modules/sfp_base64.py
index 5fbb3c20..1c063cb2 100644
--- a/modules/sfp_base64.py
+++ b/modules/sfp_base64.py
@@ -61,7 +61,7 @@ class sfp_base64(SpiderFootPlugin):
self.sf.debug("Received event, %s, from %s" % (eventName, srcModuleName))
- pat = re.compile("([A-Za-z0-9+\/]+\=\=|[A-Za-z0-9+\/]+\=)")
+ pat = re.compile(r"([A-Za-z0-9+\/]+\=\=|[A-Za-z0-9+\/]+\=)")
m = re.findall(pat, eventData)
for match in m:
if self.checkForStop():
diff --git a/modules/sfp_bitcoin.py b/modules/sfp_bitcoin.py
index 62ef374e..d2edbcc6 100644
--- a/modules/sfp_bitcoin.py
+++ b/modules/sfp_bitcoin.py
@@ -81,7 +81,7 @@ class sfp_bitcoin(SpiderFootPlugin):
self.sf.debug("Received event, %s, from %s" % (eventName, srcModuleName))
# thanks to https://stackoverflow.com/questions/21683680/regex-to-match-bitcoin-addresses
- matches = re.findall("[\s:=\>]([13][a-km-zA-HJ-NP-Z1-9]{25,34})", eventData)
+ matches = re.findall(r"[\s:=\>]([13][a-km-zA-HJ-NP-Z1-9]{25,34})", eventData)
for m in matches:
self.sf.debug("Bitcoin potential match: " + m)
if self.check_bc(m):
diff --git a/modules/sfp_countryname.py b/modules/sfp_countryname.py
index ac4491d3..581ae4a2 100644
--- a/modules/sfp_countryname.py
+++ b/modules/sfp_countryname.py
@@ -242,7 +242,7 @@ class sfp_countryname(SpiderFootPlugin):
# Look for country name in source data
# Spaces are not included since New Jersey and others
# will get interpreted as Jersey, etc.
- matchCountries = re.findall("[,'\"\:\=\[\(\[\n\t\r\.] ?" + countryName + "[,'\"\:\=\[\(\[\n\t\r\.]", srcData, re.IGNORECASE)
+ matchCountries = re.findall(r"[,'\"\:\=\[\(\[\n\t\r\.] ?" + countryName + "[,'\"\:\=\[\(\[\n\t\r\.]", srcData, re.IGNORECASE)
if len(matchCountries) > 0:
# Get country name from first index of list
diff --git a/modules/sfp_dnsresolve.py b/modules/sfp_dnsresolve.py
index 29ac30af..ec2ac931 100644
--- a/modules/sfp_dnsresolve.py
+++ b/modules/sfp_dnsresolve.py
@@ -173,7 +173,7 @@ class sfp_dnsresolve(SpiderFootPlugin):
if offset < 0:
continue
- pat = re.compile("[^a-z0-9\-\.]([a-z0-9\-\.]*\." + name + ")", re.DOTALL|re.MULTILINE)
+ pat = re.compile(r"[^a-z0-9\-\.]([a-z0-9\-\.]*\." + name + ")", re.DOTALL|re.MULTILINE)
while offset >= 0:
# If the target was found at the beginning of the content, skip past it
if offset == 0:
diff --git a/modules/sfp_ethereum.py b/modules/sfp_ethereum.py
index ddb3372b..38b477ae 100644
--- a/modules/sfp_ethereum.py
+++ b/modules/sfp_ethereum.py
@@ -64,7 +64,7 @@ class sfp_ethereum(SpiderFootPlugin):
self.sf.debug("Received event, %s, from %s" % (eventName, srcModuleName))
# thanks to https://stackoverflow.com/questions/21683680/regex-to-match-ethereum-addresses
- matches = re.findall("[\s:=\>](0x[a-fA-F0-9]{40})", eventData)
+ matches = re.findall(r"[\s:=\>](0x[a-fA-F0-9]{40})", eventData)
for m in matches:
self.sf.debug("Ethereum address match: " + m)
evt = SpiderFootEvent("ETHEREUM_ADDRESS", m, self.__name__, event)
diff --git a/modules/sfp_names.py b/modules/sfp_names.py
index aaca9a39..7bfe0126 100644
--- a/modules/sfp_names.py
+++ b/modules/sfp_names.py
@@ -114,7 +114,7 @@ class sfp_names(SpiderFootPlugin):
return None
# Stage 1: Find things that look (very vaguely) like names
- rx = re.compile("([A-Z][a-z�������������]+)\s+.?.?\s?([A-Z][�������������a-zA-Z\'\-]+)")
+ rx = re.compile(r"([A-Z][a-z�������������]+)\s+.?.?\s?([A-Z][�������������a-zA-Z\'\-]+)")
m = re.findall(rx, eventData)
for r in m:
# Start off each match as 0 points.
diff --git a/modules/sfp_pageinfo.py b/modules/sfp_pageinfo.py
index ea307314..77b09342 100644
--- a/modules/sfp_pageinfo.py
+++ b/modules/sfp_pageinfo.py
@@ -24,7 +24,7 @@ regexps = dict({
'URL_PASSWORD': list(['<input.*type=[\"\']*password']),
'URL_UPLOAD': list(['type=[\"\']*file']),
'URL_JAVA_APPLET': list(['<applet ']),
- 'URL_FLASH': list(['\.swf[ \'\"]'])
+ 'URL_FLASH': list([r'\.swf[ \'\"]'])
})