SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.
Python attacksurfacecticybersecurityfootprintinghackinginformation-gatheringinformation-securityinfosecintelligence-gatheringosintosint-frameworkosint-reconnaissanceosint-toolpentestingpythonreconsecurity-toolsthreat-intelligencethreatintel
Drop openxmllib as it doesn't work for Python 3.
smicallef940a46757ca7
diff --git a/modules/sfp_filemeta.py b/modules/sfp_filemeta.pyindex fddaa52d..3fbccfc3 100644--- a/modules/sfp_filemeta.py+++ b/modules/sfp_filemeta.py@@ -13,7 +13,8 @@import mimetypesimport PyPDF2-import openxmllib+import docx+import pptximport exifreadimport lxmlfrom StringIO import StringIO@@ -25,7 +26,7 @@ class sfp_filemeta(SpiderFootPlugin):# Default optionsopts = {- 'fileexts': ["docx", "pptx", 'xlsx', 'pdf', 'jpg', 'jpeg', 'tiff', 'tif'],+ 'fileexts': ["docx", "pptx", 'pdf', 'jpg', 'jpeg', 'tiff', 'tif'],'timeout': 300}@@ -103,21 +104,31 @@ class sfp_filemeta(SpiderFootPlugin):eventData + "(" + str(e) + ")", False)return None- if fileExt.lower() in ["pptx", "docx", "xlsx"]:+ if fileExt.lower() in ["docx"]:try:+ c = StringIO(ret['content'])+ doc = docx.Document(c)mtype = mimetypes.guess_type(eventData)[0]- doc = openxmllib.openXmlDocument(data=ret['content'], mime_type=mtype)- self.sf.debug("Office type: " + doc.mimeType)- data = doc.allProperties- meta = str(data)- except ValueError as e:- self.sf.error("Unable to parse meta data from: " +- eventData + "(" + str(e) + ")", False)- return None- except lxml.etree.XMLSyntaxError as e:- self.sf.error("Unable to parse XML within: " ++ self.sf.debug("Office type: " + str(mtype))+ a = doc.core_properties.author+ c = doc.core_properties.comments+ data = filter(None, [a, c])+ meta = ", ".join(data)+ except BaseException as e:+ self.sf.error("Unable to process file: " +eventData + "(" + str(e) + ")", False)return None++ if fileExt.lower() in ["pptx"]:+ try:+ c = StringIO(ret['content'])+ doc = pptx.Presentation(c)+ mtype = mimetypes.guess_type(eventData)[0]+ self.sf.debug("Office type: " + str(mtype))+ a = doc.core_properties.author+ c = doc.core_properties.comments+ data = filter(None, [a, c])+ meta = ", ".join(data)except BaseException as e:self.sf.error("Unable to process file: " +eventData + "(" + str(e) + ")", False)diff --git a/modules/sfp_openstreetmap.py b/modules/sfp_openstreetmap.pyindex 4f894a01..984b1248 100644--- a/modules/sfp_openstreetmap.py+++ b/modules/sfp_openstreetmap.py@@ -11,12 +11,11 @@# Licence: GPL# --------------------------------------------------------------------------------import jsontry:import re2 as reexcept ImportError as e:import re-+import jsonimport timeimport urllibfrom sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEventdiff --git a/requirements.txt b/requirements.txtindex 48c5b334..f27a2e11 100644--- a/requirements.txt+++ b/requirements.txt@@ -15,5 +15,6 @@ PyPDF2>=1.26.0stem>=1.7.1python-whois>=0.7.1future-openxmllib>=1.1.1pyOpenSSL>=16.2.0+python-docx>=0.8.10+python-pptx>=0.6.18