SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.
Python attacksurfacecticybersecurityfootprintinghackinginformation-gatheringinformation-securityinfosecintelligence-gatheringosintosint-frameworkosint-reconnaissanceosint-toolpentestingpythonreconsecurity-toolsthreat-intelligencethreatintel
sfwebui: Replace hard coded version with __version__ (#1183)
bcolesa0d90a90f49d
diff --git a/dyn/HEADER.tmpl b/dyn/HEADER.tmplindex 12274c68..c4bad78d 100644--- a/dyn/HEADER.tmpl+++ b/dyn/HEADER.tmpl@@ -2,7 +2,7 @@<html lang="en"><head><meta charset="utf-8">- <title>SpiderFoot v3.3</title>+ <title>SpiderFoot v${version}</title><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="description" content=""><meta name="author" content="">@@ -93,13 +93,13 @@ class="nav-item"><a href="${docroot}/opts" class="nav-link"><i class="glyphicon<div class="modal-content"><div class="modal-header">- <h3 class="modal-title">SpiderFoot 3.3</h3>+ <h3 class="modal-title">SpiderFoot ${version}</h3></div><div class="modal-body"><p>SpiderFoot is an open source, GPL-licensed footprinting tool, created by <a href='https://twitter.com/binarypool' target=_new>Steve Micallef</a>. It is designed to be easy to use, fast and extensible.</p><p>If you have any bugs to report, or requests for enhancements, please contact the support mailing list at <a href=mailto:[email protected]>[email protected]</a>.- <p>You are running version <b>3.3</b>.</p>+ <p>You are running version <b>${version}</b>.</p><p> Visit the project website at <a href='https://www.spiderfoot.net/r.php?u=aHR0cHM6Ly93d3cuc3BpZGVyZm9vdC5uZXQv&s=os_int' target=_new>https://www.spiderfoot.net/</a>.</p><p> View the documentation at <a href='https://www.spiderfoot.net/documentation/' target=_new>https://www.spiderfoot.net/documentation/</a>.</p><p> Check out the Github repo at <a href='https://github.com/smicallef/spiderfoot' target=_new>https://github.com/smicallef/spiderfoot</a>.</p>diff --git a/sfwebui.py b/sfwebui.pyindex c1c872c9..c5ee1d2f 100644--- a/sfwebui.py+++ b/sfwebui.py@@ -104,10 +104,10 @@ class SpiderFootWebUi:"""Unauthorized access HTTP 401 error pageArgs:- status: TBD- message: TBD- traceback: TBD- version: TBD+ status (str): HTTP response status code and message+ message (str): Error message+ traceback (str): Error stack trace+ version (str): CherryPy versionReturns:str: HTML response@@ -118,17 +118,18 @@ class SpiderFootWebUi:"""Error page 404Args:- status: TBD- message: TBD- traceback: TBD- version: TBD+ status (str): HTTP response status code and message+ message (str): Error message+ traceback (str): Error stack trace+ version (str): CherryPy versionReturns:str: HTTP response template"""+ print(message)templ = Template(filename='dyn/error.tmpl', lookup=self.lookup)- return templ.render(message='Not Found', docroot=self.docroot, status=status)+ return templ.render(message='Not Found', docroot=self.docroot, status=status, version=__version__)def cleanUserInput(self, inputList):"""Sanitize user input, poorly.@@ -541,7 +542,7 @@ class SpiderFootWebUi:time.sleep(1)templ = Template(filename='dyn/scanlist.tmpl', lookup=self.lookup)- return templ.render(rerunscans=True, docroot=self.docroot, pageid="SCANLIST")+ return templ.render(rerunscans=True, docroot=self.docroot, pageid="SCANLIST", version=__version__)rerunscanmulti.exposed = True@@ -557,7 +558,7 @@ class SpiderFootWebUi:templ = Template(filename='dyn/newscan.tmpl', lookup=self.lookup)return templ.render(pageid='NEWSCAN', types=types, docroot=self.docroot,modules=self.config['__modules__'], scanname="",- selectedmods="", scantarget="")+ selectedmods="", scantarget="", version=__version__)newscan.exposed = True@@ -599,7 +600,7 @@ class SpiderFootWebUi:return templ.render(pageid='NEWSCAN', types=types, docroot=self.docroot,modules=self.config['__modules__'], selectedmods=modlist,scanname=str(scanname),- scantarget=str(scantarget))+ scantarget=str(scantarget), version=__version__)clonescan.exposed = True@@ -611,7 +612,7 @@ class SpiderFootWebUi:"""templ = Template(filename='dyn/scanlist.tmpl', lookup=self.lookup)- return templ.render(pageid='SCANLIST', docroot=self.docroot)+ return templ.render(pageid='SCANLIST', docroot=self.docroot, version=__version__)index.exposed = True@@ -631,7 +632,7 @@ class SpiderFootWebUi:return self.error("Scan ID not found.")templ = Template(filename='dyn/scaninfo.tmpl', lookup=self.lookup, input_encoding='utf-8')- return templ.render(id=id, name=html.escape(res[0]), status=res[5], docroot=self.docroot,+ return templ.render(id=id, name=html.escape(res[0]), status=res[5], docroot=self.docroot, version=__version__,pageid="SCANLIST")scaninfo.exposed = True@@ -648,7 +649,7 @@ class SpiderFootWebUi:templ = Template(filename='dyn/opts.tmpl', lookup=self.lookup)self.token = random.SystemRandom().randint(0, 99999999)- return templ.render(opts=self.config, pageid='SETTINGS', token=self.token,+ return templ.render(opts=self.config, pageid='SETTINGS', token=self.token, version=__version__,updated=updated, docroot=self.docroot)opts.exposed = True@@ -721,7 +722,7 @@ class SpiderFootWebUi:"""templ = Template(filename='dyn/error.tmpl', lookup=self.lookup)- return templ.render(message=message, docroot=self.docroot)+ return templ.render(message=message, docroot=self.docroot, version=__version__)def scandelete(self, id, confirm=None):"""Delete a scan@@ -757,7 +758,7 @@ class SpiderFootWebUi:raise cherrypy.HTTPRedirect(f"{self.docroot}/")templ = Template(filename='dyn/scandelete.tmpl', lookup=self.lookup)- return templ.render(id=id, name=str(res[0]),+ return templ.render(id=id, name=str(res[0]), version=__version__,names=list(), ids=list(),pageid="SCANLIST", docroot=self.docroot)@@ -798,7 +799,7 @@ class SpiderFootWebUi:templ = Template(filename='dyn/scandelete.tmpl', lookup=self.lookup)return templ.render(id=None, name=None, ids=ids.split(','), names=names,- pageid="SCANLIST", docroot=self.docroot)+ pageid="SCANLIST", docroot=self.docroot, version=__version__)scandeletemulti.exposed = True