diff --git a/.gitignore b/.gitignore index b3b39cc..e81f084 100644 --- a/.gitignore +++ b/.gitignore @@ -1,23 +1,13 @@ -output_*.xml -*.pyc -_log/*.log -*.db -*.cer -*.key -*.crt -*.ioc -*.ioc-select -ioc/ -yara/ -certs/ +# general things to ignore +build/ +dist/ +*.egg-info/ +*.egg +*.py[cod] +__pycache__/ +*.so +*~ -# VirtualEnv -bin/ -include/ -lib/ -local/ -pip-selfcheck.json -share/ -Scripts/ -Tcl/ -src/ \ No newline at end of file +# due to using tox and pytest +.tox +.cache diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..3c9717f --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,6 @@ +include certitude/README.md +include certitude/LICENSE +include certitude/_log/* +include certitude/ssl/* +include certitude/utils/* +recursive-include certitude/components/ *.* \ No newline at end of file diff --git a/LICENSE b/certitude/LICENSE similarity index 100% rename from LICENSE rename to certitude/LICENSE diff --git a/README.md b/certitude/README.md similarity index 100% rename from README.md rename to certitude/README.md diff --git a/certitude/__init__.py b/certitude/__init__.py new file mode 100644 index 0000000..0c25463 --- /dev/null +++ b/certitude/__init__.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import sys +import os +sys.path.append(os.path.dirname(__file__)) + +import main \ No newline at end of file diff --git a/_log/.empty b/certitude/_log/.empty similarity index 100% rename from _log/.empty rename to certitude/_log/.empty diff --git a/components/scanner/ioc/.empty b/certitude/_log/api.log similarity index 100% rename from components/scanner/ioc/.empty rename to certitude/_log/api.log diff --git a/ssl/.empty b/certitude/_log/certitude-core.log similarity index 100% rename from ssl/.empty rename to certitude/_log/certitude-core.log diff --git a/certitude/_log/db.log b/certitude/_log/db.log new file mode 100644 index 0000000..e69de29 diff --git a/certitude/_log/hashscanners.log b/certitude/_log/hashscanners.log new file mode 100644 index 0000000..e69de29 diff --git a/certitude/_log/iocscanners.log b/certitude/_log/iocscanners.log new file mode 100644 index 0000000..e69de29 diff --git a/available_modules.py b/certitude/available_modules.py old mode 100755 new mode 100644 similarity index 100% rename from available_modules.py rename to certitude/available_modules.py diff --git a/components/__init__.py b/certitude/components/__init__.py similarity index 100% rename from components/__init__.py rename to certitude/components/__init__.py diff --git a/components/interface/__init__.py b/certitude/components/interface/__init__.py similarity index 100% rename from components/interface/__init__.py rename to certitude/components/interface/__init__.py diff --git a/components/interface/static/css/bootstrap.min.css b/certitude/components/interface/static/css/bootstrap.min.css similarity index 100% rename from components/interface/static/css/bootstrap.min.css rename to certitude/components/interface/static/css/bootstrap.min.css diff --git a/components/interface/static/css/reset.css b/certitude/components/interface/static/css/reset.css similarity index 100% rename from components/interface/static/css/reset.css rename to certitude/components/interface/static/css/reset.css diff --git a/components/interface/static/css/style.css b/certitude/components/interface/static/css/style.css similarity index 100% rename from components/interface/static/css/style.css rename to certitude/components/interface/static/css/style.css diff --git a/components/interface/static/img/loading.gif b/certitude/components/interface/static/img/loading.gif similarity index 100% rename from components/interface/static/img/loading.gif rename to certitude/components/interface/static/img/loading.gif diff --git a/components/interface/static/img/logo-certitude.png b/certitude/components/interface/static/img/logo-certitude.png similarity index 100% rename from components/interface/static/img/logo-certitude.png rename to certitude/components/interface/static/img/logo-certitude.png diff --git a/components/interface/static/img/open.svg b/certitude/components/interface/static/img/open.svg similarity index 100% rename from components/interface/static/img/open.svg rename to certitude/components/interface/static/img/open.svg diff --git a/components/interface/static/js/d3.min.js b/certitude/components/interface/static/js/d3.min.js similarity index 100% rename from components/interface/static/js/d3.min.js rename to certitude/components/interface/static/js/d3.min.js diff --git a/components/interface/static/js/jquery-2.1.3.min.js b/certitude/components/interface/static/js/jquery-2.1.3.min.js similarity index 100% rename from components/interface/static/js/jquery-2.1.3.min.js rename to certitude/components/interface/static/js/jquery-2.1.3.min.js diff --git a/components/interface/static/js/jquery.placeholder.js b/certitude/components/interface/static/js/jquery.placeholder.js similarity index 100% rename from components/interface/static/js/jquery.placeholder.js rename to certitude/components/interface/static/js/jquery.placeholder.js diff --git a/components/interface/static/js/prettyprint.js b/certitude/components/interface/static/js/prettyprint.js similarity index 100% rename from components/interface/static/js/prettyprint.js rename to certitude/components/interface/static/js/prettyprint.js diff --git a/components/interface/static/js/scan.js b/certitude/components/interface/static/js/scan.js similarity index 100% rename from components/interface/static/js/scan.js rename to certitude/components/interface/static/js/scan.js diff --git a/components/interface/static/js/vis_files/CustomTooltip.js b/certitude/components/interface/static/js/vis_files/CustomTooltip.js similarity index 100% rename from components/interface/static/js/vis_files/CustomTooltip.js rename to certitude/components/interface/static/js/vis_files/CustomTooltip.js diff --git a/components/interface/static/js/vis_files/coffee-script.js b/certitude/components/interface/static/js/vis_files/coffee-script.js similarity index 100% rename from components/interface/static/js/vis_files/coffee-script.js rename to certitude/components/interface/static/js/vis_files/coffee-script.js diff --git a/components/interface/static/js/vis_files/d3.csv.min.js b/certitude/components/interface/static/js/vis_files/d3.csv.min.js similarity index 100% rename from components/interface/static/js/vis_files/d3.csv.min.js rename to certitude/components/interface/static/js/vis_files/d3.csv.min.js diff --git a/components/interface/static/js/vis_files/d3.geom.min.js b/certitude/components/interface/static/js/vis_files/d3.geom.min.js similarity index 100% rename from components/interface/static/js/vis_files/d3.geom.min.js rename to certitude/components/interface/static/js/vis_files/d3.geom.min.js diff --git a/components/interface/static/js/vis_files/d3.layout.min.js b/certitude/components/interface/static/js/vis_files/d3.layout.min.js similarity index 100% rename from components/interface/static/js/vis_files/d3.layout.min.js rename to certitude/components/interface/static/js/vis_files/d3.layout.min.js diff --git a/components/interface/static/js/vis_files/d3.min.js b/certitude/components/interface/static/js/vis_files/d3.min.js similarity index 100% rename from components/interface/static/js/vis_files/d3.min.js rename to certitude/components/interface/static/js/vis_files/d3.min.js diff --git a/components/interface/static/js/vis_files/d3.v3.min.js b/certitude/components/interface/static/js/vis_files/d3.v3.min.js similarity index 100% rename from components/interface/static/js/vis_files/d3.v3.min.js rename to certitude/components/interface/static/js/vis_files/d3.v3.min.js diff --git a/components/interface/static/js/vis_files/ga.js b/certitude/components/interface/static/js/vis_files/ga.js similarity index 100% rename from components/interface/static/js/vis_files/ga.js rename to certitude/components/interface/static/js/vis_files/ga.js diff --git a/components/interface/static/js/vis_files/jquery-1.6.2.min.js b/certitude/components/interface/static/js/vis_files/jquery-1.6.2.min.js similarity index 100% rename from components/interface/static/js/vis_files/jquery-1.6.2.min.js rename to certitude/components/interface/static/js/vis_files/jquery-1.6.2.min.js diff --git a/components/interface/static/js/vis_files/modernizr-2.0.6.min.js b/certitude/components/interface/static/js/vis_files/modernizr-2.0.6.min.js similarity index 100% rename from components/interface/static/js/vis_files/modernizr-2.0.6.min.js rename to certitude/components/interface/static/js/vis_files/modernizr-2.0.6.min.js diff --git a/components/interface/static/js/vis_files/plugins.js b/certitude/components/interface/static/js/vis_files/plugins.js similarity index 100% rename from components/interface/static/js/vis_files/plugins.js rename to certitude/components/interface/static/js/vis_files/plugins.js diff --git a/components/interface/static/js/vis_files/script.js b/certitude/components/interface/static/js/vis_files/script.js similarity index 100% rename from components/interface/static/js/vis_files/script.js rename to certitude/components/interface/static/js/vis_files/script.js diff --git a/components/interface/static/js/vis_files/vis.coffee.js b/certitude/components/interface/static/js/vis_files/vis.coffee.js similarity index 100% rename from components/interface/static/js/vis_files/vis.coffee.js rename to certitude/components/interface/static/js/vis_files/vis.coffee.js diff --git a/components/interface/templates/blank.html b/certitude/components/interface/templates/blank.html similarity index 100% rename from components/interface/templates/blank.html rename to certitude/components/interface/templates/blank.html diff --git a/components/interface/templates/campaign-hostresult.html b/certitude/components/interface/templates/campaign-hostresult.html similarity index 100% rename from components/interface/templates/campaign-hostresult.html rename to certitude/components/interface/templates/campaign-hostresult.html diff --git a/components/interface/templates/campaign-visualizations-batch.html b/certitude/components/interface/templates/campaign-visualizations-batch.html similarity index 100% rename from components/interface/templates/campaign-visualizations-batch.html rename to certitude/components/interface/templates/campaign-visualizations-batch.html diff --git a/components/interface/templates/campaign-visualizations.html b/certitude/components/interface/templates/campaign-visualizations.html similarity index 100% rename from components/interface/templates/campaign-visualizations.html rename to certitude/components/interface/templates/campaign-visualizations.html diff --git a/components/interface/templates/config-main.html b/certitude/components/interface/templates/config-main.html similarity index 100% rename from components/interface/templates/config-main.html rename to certitude/components/interface/templates/config-main.html diff --git a/components/interface/templates/config-profile-add.html b/certitude/components/interface/templates/config-profile-add.html similarity index 100% rename from components/interface/templates/config-profile-add.html rename to certitude/components/interface/templates/config-profile-add.html diff --git a/components/interface/templates/config-wincred-add.html b/certitude/components/interface/templates/config-wincred-add.html similarity index 100% rename from components/interface/templates/config-wincred-add.html rename to certitude/components/interface/templates/config-wincred-add.html diff --git a/components/interface/templates/config-xmlioc-add.html b/certitude/components/interface/templates/config-xmlioc-add.html similarity index 100% rename from components/interface/templates/config-xmlioc-add.html rename to certitude/components/interface/templates/config-xmlioc-add.html diff --git a/components/interface/templates/config-yara-add.html b/certitude/components/interface/templates/config-yara-add.html similarity index 100% rename from components/interface/templates/config-yara-add.html rename to certitude/components/interface/templates/config-yara-add.html diff --git a/components/interface/templates/host-result-vizualisation.html b/certitude/components/interface/templates/host-result-vizualisation.html similarity index 100% rename from components/interface/templates/host-result-vizualisation.html rename to certitude/components/interface/templates/host-result-vizualisation.html diff --git a/components/interface/templates/ioc-vizualisation.html b/certitude/components/interface/templates/ioc-vizualisation.html similarity index 100% rename from components/interface/templates/ioc-vizualisation.html rename to certitude/components/interface/templates/ioc-vizualisation.html diff --git a/components/interface/templates/layout.html b/certitude/components/interface/templates/layout.html similarity index 100% rename from components/interface/templates/layout.html rename to certitude/components/interface/templates/layout.html diff --git a/components/interface/templates/mass-visualizations-batch.html b/certitude/components/interface/templates/mass-visualizations-batch.html similarity index 100% rename from components/interface/templates/mass-visualizations-batch.html rename to certitude/components/interface/templates/mass-visualizations-batch.html diff --git a/components/interface/templates/scan-planification-batch-add.html b/certitude/components/interface/templates/scan-planification-batch-add.html similarity index 100% rename from components/interface/templates/scan-planification-batch-add.html rename to certitude/components/interface/templates/scan-planification-batch-add.html diff --git a/components/interface/templates/scan-planification-batch.html b/certitude/components/interface/templates/scan-planification-batch.html similarity index 100% rename from components/interface/templates/scan-planification-batch.html rename to certitude/components/interface/templates/scan-planification-batch.html diff --git a/components/interface/templates/scan-planification.html b/certitude/components/interface/templates/scan-planification.html similarity index 100% rename from components/interface/templates/scan-planification.html rename to certitude/components/interface/templates/scan-planification.html diff --git a/components/interface/templates/scan-progress.html b/certitude/components/interface/templates/scan-progress.html similarity index 100% rename from components/interface/templates/scan-progress.html rename to certitude/components/interface/templates/scan-progress.html diff --git a/components/interface/templates/session-login.html b/certitude/components/interface/templates/session-login.html similarity index 100% rename from components/interface/templates/session-login.html rename to certitude/components/interface/templates/session-login.html diff --git a/components/interface/templates/user-add.html b/certitude/components/interface/templates/user-add.html similarity index 100% rename from components/interface/templates/user-add.html rename to certitude/components/interface/templates/user-add.html diff --git a/components/interface/templates/user-list.html b/certitude/components/interface/templates/user-list.html similarity index 100% rename from components/interface/templates/user-list.html rename to certitude/components/interface/templates/user-list.html diff --git a/components/interface/web.py b/certitude/components/interface/web.py similarity index 99% rename from components/interface/web.py rename to certitude/components/interface/web.py index cfc4e4d..7689d87 100644 --- a/components/interface/web.py +++ b/certitude/components/interface/web.py @@ -84,8 +84,8 @@ def genCSRFToken(): CSRF_TOKEN_INDEX = '_csrft' -STATIC_ENDPOINT = 'static' - +STATIC_ENDPOINT = os.path.join(os.path.dirname(__file__), 'static') +TEMPLATES_FOLDER = os.path.join(os.path.dirname(__file__), 'templates') def getCSRFToken(): if not CSRF_TOKEN_INDEX in session: @@ -96,7 +96,7 @@ def getCSRFToken(): ''' APPLICATION CONFIGURATION ''' -app = Flask(__name__, static_folder=STATIC_ENDPOINT) +app = Flask(__name__, static_folder=STATIC_ENDPOINT, template_folder=TEMPLATES_FOLDER) app.secret_key = os.urandom(24) app.jinja_env.globals['csrf_token'] = getCSRFToken @@ -136,13 +136,14 @@ def decorated(*args, **kwargs): # Preventing Flask from running Bokeh twice # source : https://stackoverflow.com/questions/9449101/how-to-stop-flask-from-initialising-twice-in-debug-mode if not DEBUG or os.environ.get('WERKZEUG_RUN_MAIN') == 'true': - bokeh_process = subprocess.Popen([ + cmd = [ 'bokeh', - 'serve', 'crossbokeh.py', + 'serve', "%s" % os.path.abspath(os.path.join(__file__, '../../../crossbokeh.py')), '--address', BOKEH_LISTEN_ADDRESS, '--port', str(BOKEH_LISTEN_PORT), '--allow-websocket-origin', '%s:%d' % (BOKEH_LISTEN_ADDRESS, BOKEH_LISTEN_PORT), - ], stdout=subprocess.PIPE) + ] + bokeh_process = subprocess.Popen(cmd, stdout=subprocess.PIPE) @atexit.register def kill_server(): diff --git a/components/scanner/.gitignore b/certitude/components/scanner/.gitignore similarity index 100% rename from components/scanner/.gitignore rename to certitude/components/scanner/.gitignore diff --git a/components/scanner/__init__.py b/certitude/components/scanner/__init__.py similarity index 100% rename from components/scanner/__init__.py rename to certitude/components/scanner/__init__.py diff --git "a/components/scanner/doc/Pr\303\251requis CERTitude.pdf" "b/certitude/components/scanner/doc/Pr\202requis CERTitude.pdf" similarity index 100% rename from "components/scanner/doc/Pr\303\251requis CERTitude.pdf" rename to "certitude/components/scanner/doc/Pr\202requis CERTitude.pdf" diff --git "a/certitude/components/scanner/doc/Pr\303\251requis CERTitude.pdf" "b/certitude/components/scanner/doc/Pr\303\251requis CERTitude.pdf" new file mode 100644 index 0000000..c13fba4 Binary files /dev/null and "b/certitude/components/scanner/doc/Pr\303\251requis CERTitude.pdf" differ diff --git a/components/scanner/doc/Task_relations.pptx b/certitude/components/scanner/doc/Task_relations.pptx similarity index 100% rename from components/scanner/doc/Task_relations.pptx rename to certitude/components/scanner/doc/Task_relations.pptx diff --git a/components/scanner/flatevaluators/__init__.py b/certitude/components/scanner/flatevaluators/__init__.py similarity index 100% rename from components/scanner/flatevaluators/__init__.py rename to certitude/components/scanner/flatevaluators/__init__.py diff --git a/components/scanner/flatevaluators/arp.py b/certitude/components/scanner/flatevaluators/arp.py similarity index 100% rename from components/scanner/flatevaluators/arp.py rename to certitude/components/scanner/flatevaluators/arp.py diff --git a/components/scanner/flatevaluators/dns.py b/certitude/components/scanner/flatevaluators/dns.py similarity index 100% rename from components/scanner/flatevaluators/dns.py rename to certitude/components/scanner/flatevaluators/dns.py diff --git a/components/scanner/flatevaluators/files.py b/certitude/components/scanner/flatevaluators/files.py similarity index 100% rename from components/scanner/flatevaluators/files.py rename to certitude/components/scanner/flatevaluators/files.py diff --git a/components/scanner/flatevaluators/files_hash.py b/certitude/components/scanner/flatevaluators/files_hash.py similarity index 100% rename from components/scanner/flatevaluators/files_hash.py rename to certitude/components/scanner/flatevaluators/files_hash.py diff --git a/components/scanner/flatevaluators/memory.py b/certitude/components/scanner/flatevaluators/memory.py similarity index 100% rename from components/scanner/flatevaluators/memory.py rename to certitude/components/scanner/flatevaluators/memory.py diff --git a/components/scanner/flatevaluators/port.py b/certitude/components/scanner/flatevaluators/port.py similarity index 100% rename from components/scanner/flatevaluators/port.py rename to certitude/components/scanner/flatevaluators/port.py diff --git a/components/scanner/flatevaluators/prefetch.py b/certitude/components/scanner/flatevaluators/prefetch.py similarity index 100% rename from components/scanner/flatevaluators/prefetch.py rename to certitude/components/scanner/flatevaluators/prefetch.py diff --git a/components/scanner/flatevaluators/process.py b/certitude/components/scanner/flatevaluators/process.py similarity index 100% rename from components/scanner/flatevaluators/process.py rename to certitude/components/scanner/flatevaluators/process.py diff --git a/components/scanner/flatevaluators/registry.py b/certitude/components/scanner/flatevaluators/registry.py similarity index 100% rename from components/scanner/flatevaluators/registry.py rename to certitude/components/scanner/flatevaluators/registry.py diff --git a/components/scanner/flatevaluators/result.py b/certitude/components/scanner/flatevaluators/result.py similarity index 100% rename from components/scanner/flatevaluators/result.py rename to certitude/components/scanner/flatevaluators/result.py diff --git a/components/scanner/flatevaluators/services.py b/certitude/components/scanner/flatevaluators/services.py similarity index 100% rename from components/scanner/flatevaluators/services.py rename to certitude/components/scanner/flatevaluators/services.py diff --git a/components/scanner/flatevaluators/template.py b/certitude/components/scanner/flatevaluators/template.py similarity index 100% rename from components/scanner/flatevaluators/template.py rename to certitude/components/scanner/flatevaluators/template.py diff --git a/components/scanner/hashscan_queue.py b/certitude/components/scanner/hashscan_queue.py similarity index 100% rename from components/scanner/hashscan_queue.py rename to certitude/components/scanner/hashscan_queue.py diff --git a/certitude/components/scanner/ioc/.empty b/certitude/components/scanner/ioc/.empty new file mode 100644 index 0000000..e69de29 diff --git a/components/scanner/iocscan_queue.py b/certitude/components/scanner/iocscan_queue.py similarity index 100% rename from components/scanner/iocscan_queue.py rename to certitude/components/scanner/iocscan_queue.py diff --git a/components/scanner/logicevaluators/__init__.py b/certitude/components/scanner/logicevaluators/__init__.py similarity index 100% rename from components/scanner/logicevaluators/__init__.py rename to certitude/components/scanner/logicevaluators/__init__.py diff --git a/components/scanner/logicevaluators/arp.py b/certitude/components/scanner/logicevaluators/arp.py similarity index 100% rename from components/scanner/logicevaluators/arp.py rename to certitude/components/scanner/logicevaluators/arp.py diff --git a/components/scanner/logicevaluators/dns.py b/certitude/components/scanner/logicevaluators/dns.py similarity index 100% rename from components/scanner/logicevaluators/dns.py rename to certitude/components/scanner/logicevaluators/dns.py diff --git a/components/scanner/logicevaluators/files.py b/certitude/components/scanner/logicevaluators/files.py similarity index 100% rename from components/scanner/logicevaluators/files.py rename to certitude/components/scanner/logicevaluators/files.py diff --git a/components/scanner/logicevaluators/port.py b/certitude/components/scanner/logicevaluators/port.py similarity index 100% rename from components/scanner/logicevaluators/port.py rename to certitude/components/scanner/logicevaluators/port.py diff --git a/components/scanner/logicevaluators/prefetch.py b/certitude/components/scanner/logicevaluators/prefetch.py similarity index 100% rename from components/scanner/logicevaluators/prefetch.py rename to certitude/components/scanner/logicevaluators/prefetch.py diff --git a/components/scanner/logicevaluators/process.py b/certitude/components/scanner/logicevaluators/process.py similarity index 100% rename from components/scanner/logicevaluators/process.py rename to certitude/components/scanner/logicevaluators/process.py diff --git a/components/scanner/logicevaluators/registry.py b/certitude/components/scanner/logicevaluators/registry.py similarity index 100% rename from components/scanner/logicevaluators/registry.py rename to certitude/components/scanner/logicevaluators/registry.py diff --git a/components/scanner/logicevaluators/result.py b/certitude/components/scanner/logicevaluators/result.py similarity index 100% rename from components/scanner/logicevaluators/result.py rename to certitude/components/scanner/logicevaluators/result.py diff --git a/components/scanner/logicevaluators/services.py b/certitude/components/scanner/logicevaluators/services.py similarity index 100% rename from components/scanner/logicevaluators/services.py rename to certitude/components/scanner/logicevaluators/services.py diff --git a/components/scanner/logicevaluators/template.py b/certitude/components/scanner/logicevaluators/template.py similarity index 100% rename from components/scanner/logicevaluators/template.py rename to certitude/components/scanner/logicevaluators/template.py diff --git a/components/scanner/openioc/__init__.py b/certitude/components/scanner/openioc/__init__.py similarity index 100% rename from components/scanner/openioc/__init__.py rename to certitude/components/scanner/openioc/__init__.py diff --git a/components/scanner/openioc/ioc.py b/certitude/components/scanner/openioc/ioc.py similarity index 100% rename from components/scanner/openioc/ioc.py rename to certitude/components/scanner/openioc/ioc.py diff --git a/components/scanner/openioc/logictree.py b/certitude/components/scanner/openioc/logictree.py similarity index 100% rename from components/scanner/openioc/logictree.py rename to certitude/components/scanner/openioc/logictree.py diff --git a/components/scanner/openioc/openiocparser.py b/certitude/components/scanner/openioc/openiocparser.py similarity index 100% rename from components/scanner/openioc/openiocparser.py rename to certitude/components/scanner/openioc/openiocparser.py diff --git a/components/scanner/pipes.py b/certitude/components/scanner/pipes.py similarity index 100% rename from components/scanner/pipes.py rename to certitude/components/scanner/pipes.py diff --git a/components/scanner/remotecmd.py b/certitude/components/scanner/remotecmd.py similarity index 100% rename from components/scanner/remotecmd.py rename to certitude/components/scanner/remotecmd.py diff --git a/components/scanner/resources/collecte.tar.gz b/certitude/components/scanner/resources/collecte.tar.gz similarity index 100% rename from components/scanner/resources/collecte.tar.gz rename to certitude/components/scanner/resources/collecte.tar.gz diff --git a/components/scanner/resources/getresults.bat b/certitude/components/scanner/resources/getresults.bat similarity index 100% rename from components/scanner/resources/getresults.bat rename to certitude/components/scanner/resources/getresults.bat diff --git a/components/scanner/resources/gzip.exe b/certitude/components/scanner/resources/gzip.exe similarity index 100% rename from components/scanner/resources/gzip.exe rename to certitude/components/scanner/resources/gzip.exe diff --git a/components/scanner/resources/hash.cfg b/certitude/components/scanner/resources/hash.cfg similarity index 100% rename from components/scanner/resources/hash.cfg rename to certitude/components/scanner/resources/hash.cfg diff --git a/components/scanner/resources/import_sql.tar.gz b/certitude/components/scanner/resources/import_sql.tar.gz similarity index 100% rename from components/scanner/resources/import_sql.tar.gz rename to certitude/components/scanner/resources/import_sql.tar.gz diff --git a/components/scanner/resources/localanalysis/.gitignore b/certitude/components/scanner/resources/localanalysis/.gitignore similarity index 100% rename from components/scanner/resources/localanalysis/.gitignore rename to certitude/components/scanner/resources/localanalysis/.gitignore diff --git a/components/scanner/resources/localanalysis/pcre3.dll b/certitude/components/scanner/resources/localanalysis/pcre3.dll similarity index 100% rename from components/scanner/resources/localanalysis/pcre3.dll rename to certitude/components/scanner/resources/localanalysis/pcre3.dll diff --git a/components/scanner/resources/localanalysis/sqlite3.exe b/certitude/components/scanner/resources/localanalysis/sqlite3.exe similarity index 100% rename from components/scanner/resources/localanalysis/sqlite3.exe rename to certitude/components/scanner/resources/localanalysis/sqlite3.exe diff --git a/components/scanner/resources/python_source/.gitignore b/certitude/components/scanner/resources/python_source/.gitignore similarity index 100% rename from components/scanner/resources/python_source/.gitignore rename to certitude/components/scanner/resources/python_source/.gitignore diff --git a/components/scanner/resources/python_source/PsGetsid.exe b/certitude/components/scanner/resources/python_source/PsGetsid.exe similarity index 100% rename from components/scanner/resources/python_source/PsGetsid.exe rename to certitude/components/scanner/resources/python_source/PsGetsid.exe diff --git a/components/scanner/resources/python_source/README.md b/certitude/components/scanner/resources/python_source/README.md similarity index 100% rename from components/scanner/resources/python_source/README.md rename to certitude/components/scanner/resources/python_source/README.md diff --git a/components/scanner/resources/python_source/collector.py b/certitude/components/scanner/resources/python_source/collector.py similarity index 100% rename from components/scanner/resources/python_source/collector.py rename to certitude/components/scanner/resources/python_source/collector.py diff --git a/components/scanner/resources/python_source/getarp.py b/certitude/components/scanner/resources/python_source/getarp.py similarity index 100% rename from components/scanner/resources/python_source/getarp.py rename to certitude/components/scanner/resources/python_source/getarp.py diff --git a/components/scanner/resources/python_source/getdns.py b/certitude/components/scanner/resources/python_source/getdns.py similarity index 100% rename from components/scanner/resources/python_source/getdns.py rename to certitude/components/scanner/resources/python_source/getdns.py diff --git a/components/scanner/resources/python_source/getfiles.py b/certitude/components/scanner/resources/python_source/getfiles.py similarity index 100% rename from components/scanner/resources/python_source/getfiles.py rename to certitude/components/scanner/resources/python_source/getfiles.py diff --git a/components/scanner/resources/python_source/getfiles_hash.py b/certitude/components/scanner/resources/python_source/getfiles_hash.py similarity index 100% rename from components/scanner/resources/python_source/getfiles_hash.py rename to certitude/components/scanner/resources/python_source/getfiles_hash.py diff --git a/components/scanner/resources/python_source/getmemory.cpp b/certitude/components/scanner/resources/python_source/getmemory.cpp similarity index 100% rename from components/scanner/resources/python_source/getmemory.cpp rename to certitude/components/scanner/resources/python_source/getmemory.cpp diff --git a/components/scanner/resources/python_source/getmemory.exe b/certitude/components/scanner/resources/python_source/getmemory.exe similarity index 100% rename from components/scanner/resources/python_source/getmemory.exe rename to certitude/components/scanner/resources/python_source/getmemory.exe diff --git a/components/scanner/resources/python_source/getport.py b/certitude/components/scanner/resources/python_source/getport.py similarity index 100% rename from components/scanner/resources/python_source/getport.py rename to certitude/components/scanner/resources/python_source/getport.py diff --git a/components/scanner/resources/python_source/getprefetch.py b/certitude/components/scanner/resources/python_source/getprefetch.py similarity index 100% rename from components/scanner/resources/python_source/getprefetch.py rename to certitude/components/scanner/resources/python_source/getprefetch.py diff --git a/components/scanner/resources/python_source/getprocess.py b/certitude/components/scanner/resources/python_source/getprocess.py similarity index 100% rename from components/scanner/resources/python_source/getprocess.py rename to certitude/components/scanner/resources/python_source/getprocess.py diff --git a/components/scanner/resources/python_source/getregistry.exe b/certitude/components/scanner/resources/python_source/getregistry.exe similarity index 100% rename from components/scanner/resources/python_source/getregistry.exe rename to certitude/components/scanner/resources/python_source/getregistry.exe diff --git a/components/scanner/resources/python_source/getservices.py b/certitude/components/scanner/resources/python_source/getservices.py similarity index 100% rename from components/scanner/resources/python_source/getservices.py rename to certitude/components/scanner/resources/python_source/getservices.py diff --git a/components/scanner/resources/python_source/handle.exe b/certitude/components/scanner/resources/python_source/handle.exe similarity index 100% rename from components/scanner/resources/python_source/handle.exe rename to certitude/components/scanner/resources/python_source/handle.exe diff --git a/components/scanner/resources/python_source/launch.bat b/certitude/components/scanner/resources/python_source/launch.bat similarity index 100% rename from components/scanner/resources/python_source/launch.bat rename to certitude/components/scanner/resources/python_source/launch.bat diff --git a/components/scanner/resources/remcomsvc.exe b/certitude/components/scanner/resources/remcomsvc.exe similarity index 100% rename from components/scanner/resources/remcomsvc.exe rename to certitude/components/scanner/resources/remcomsvc.exe diff --git a/components/scanner/resources/rmtar.bat b/certitude/components/scanner/resources/rmtar.bat similarity index 100% rename from components/scanner/resources/rmtar.bat rename to certitude/components/scanner/resources/rmtar.bat diff --git a/components/scanner/resources/sql/arp.sql b/certitude/components/scanner/resources/sql/arp.sql similarity index 100% rename from components/scanner/resources/sql/arp.sql rename to certitude/components/scanner/resources/sql/arp.sql diff --git a/components/scanner/resources/sql/dns.sql b/certitude/components/scanner/resources/sql/dns.sql similarity index 100% rename from components/scanner/resources/sql/dns.sql rename to certitude/components/scanner/resources/sql/dns.sql diff --git a/components/scanner/resources/sql/files.sql b/certitude/components/scanner/resources/sql/files.sql similarity index 100% rename from components/scanner/resources/sql/files.sql rename to certitude/components/scanner/resources/sql/files.sql diff --git a/components/scanner/resources/sql/files_hash.sql b/certitude/components/scanner/resources/sql/files_hash.sql similarity index 100% rename from components/scanner/resources/sql/files_hash.sql rename to certitude/components/scanner/resources/sql/files_hash.sql diff --git a/components/scanner/resources/sql/memory.sql b/certitude/components/scanner/resources/sql/memory.sql similarity index 100% rename from components/scanner/resources/sql/memory.sql rename to certitude/components/scanner/resources/sql/memory.sql diff --git a/components/scanner/resources/sql/pcre3.dll b/certitude/components/scanner/resources/sql/pcre3.dll similarity index 100% rename from components/scanner/resources/sql/pcre3.dll rename to certitude/components/scanner/resources/sql/pcre3.dll diff --git a/components/scanner/resources/sql/port.sql b/certitude/components/scanner/resources/sql/port.sql similarity index 100% rename from components/scanner/resources/sql/port.sql rename to certitude/components/scanner/resources/sql/port.sql diff --git a/components/scanner/resources/sql/prefetch.sql b/certitude/components/scanner/resources/sql/prefetch.sql similarity index 100% rename from components/scanner/resources/sql/prefetch.sql rename to certitude/components/scanner/resources/sql/prefetch.sql diff --git a/components/scanner/resources/sql/process.sql b/certitude/components/scanner/resources/sql/process.sql similarity index 100% rename from components/scanner/resources/sql/process.sql rename to certitude/components/scanner/resources/sql/process.sql diff --git a/components/scanner/resources/sql/registry.sql b/certitude/components/scanner/resources/sql/registry.sql similarity index 100% rename from components/scanner/resources/sql/registry.sql rename to certitude/components/scanner/resources/sql/registry.sql diff --git a/components/scanner/resources/sql/services.sql b/certitude/components/scanner/resources/sql/services.sql similarity index 100% rename from components/scanner/resources/sql/services.sql rename to certitude/components/scanner/resources/sql/services.sql diff --git a/components/scanner/resources/tar.exe b/certitude/components/scanner/resources/tar.exe similarity index 100% rename from components/scanner/resources/tar.exe rename to certitude/components/scanner/resources/tar.exe diff --git a/components/scanner/utils/gen_sec_strat.bat b/certitude/components/scanner/utils/gen_sec_strat.bat similarity index 100% rename from components/scanner/utils/gen_sec_strat.bat rename to certitude/components/scanner/utils/gen_sec_strat.bat diff --git a/components/scanner/utils/ipseccmd.exe b/certitude/components/scanner/utils/ipseccmd.exe similarity index 100% rename from components/scanner/utils/ipseccmd.exe rename to certitude/components/scanner/utils/ipseccmd.exe diff --git a/config.py b/certitude/config.py old mode 100755 new mode 100644 similarity index 88% rename from config.py rename to certitude/config.py index 3b6d4fe..99d3670 --- a/config.py +++ b/certitude/config.py @@ -44,15 +44,15 @@ # SSL configuration USE_SSL = False -SSL_KEY_FILE = os.path.join('ssl','server.pem.key') -SSL_CERT_FILE = os.path.join('ssl','server.pem.cer') +SSL_KEY_FILE = os.path.join(os.path.dirname(__file__), 'ssl', 'server.pem.key') +SSL_CERT_FILE = os.path.join(os.path.dirname(__file__), 'ssl', 'server.pem.cer') INTERFACE_HASH_SALT = '' # nocommit SLEEP = 5 # second interval between database poll MIN_SUBMIT_INTERVAL = 300 # min second interval between two submissions of same IP address MIN_RESCAN_INTERVAL = 300 # min second interval between two consecutive scans on same IP address -CERTITUDE_DATABASE = "sqlite:///data.db" +CERTITUDE_DATABASE = "sqlite:///%s" % os.path.join(os.path.dirname(__file__), 'data.db') # IOC Scanner # =========== diff --git a/crossbokeh.py b/certitude/crossbokeh.py old mode 100755 new mode 100644 similarity index 100% rename from crossbokeh.py rename to certitude/crossbokeh.py diff --git a/helpers/__init__.py b/certitude/helpers/__init__.py similarity index 100% rename from helpers/__init__.py rename to certitude/helpers/__init__.py diff --git a/helpers/crypto.py b/certitude/helpers/crypto.py similarity index 100% rename from helpers/crypto.py rename to certitude/helpers/crypto.py diff --git a/helpers/hashscan_modules.py b/certitude/helpers/hashscan_modules.py similarity index 100% rename from helpers/hashscan_modules.py rename to certitude/helpers/hashscan_modules.py diff --git a/helpers/helpers.py b/certitude/helpers/helpers.py similarity index 100% rename from helpers/helpers.py rename to certitude/helpers/helpers.py diff --git a/helpers/init.py b/certitude/helpers/init.py similarity index 100% rename from helpers/init.py rename to certitude/helpers/init.py diff --git a/helpers/iocscan_modules.py b/certitude/helpers/iocscan_modules.py similarity index 100% rename from helpers/iocscan_modules.py rename to certitude/helpers/iocscan_modules.py diff --git a/helpers/log.py b/certitude/helpers/log.py similarity index 100% rename from helpers/log.py rename to certitude/helpers/log.py diff --git a/helpers/misc_models.py b/certitude/helpers/misc_models.py similarity index 100% rename from helpers/misc_models.py rename to certitude/helpers/misc_models.py diff --git a/helpers/queue_models.py b/certitude/helpers/queue_models.py similarity index 100% rename from helpers/queue_models.py rename to certitude/helpers/queue_models.py diff --git a/helpers/results_models.py b/certitude/helpers/results_models.py similarity index 100% rename from helpers/results_models.py rename to certitude/helpers/results_models.py diff --git a/helpers/yara_models.py b/certitude/helpers/yara_models.py similarity index 100% rename from helpers/yara_models.py rename to certitude/helpers/yara_models.py diff --git a/main.py b/certitude/main.py old mode 100755 new mode 100644 similarity index 100% rename from main.py rename to certitude/main.py diff --git a/requirements.txt b/certitude/requirements.txt similarity index 100% rename from requirements.txt rename to certitude/requirements.txt diff --git a/certitude/ssl/.empty b/certitude/ssl/.empty new file mode 100644 index 0000000..e69de29 diff --git a/ssl/gen-cert-for-me.bat b/certitude/ssl/gen-cert-for-me.bat similarity index 100% rename from ssl/gen-cert-for-me.bat rename to certitude/ssl/gen-cert-for-me.bat diff --git a/ssl/gen-cert-for-me.sh b/certitude/ssl/gen-cert-for-me.sh similarity index 100% rename from ssl/gen-cert-for-me.sh rename to certitude/ssl/gen-cert-for-me.sh diff --git a/utils/clean.sql b/certitude/utils/clean.sql similarity index 100% rename from utils/clean.sql rename to certitude/utils/clean.sql diff --git a/utils/ioc-selector.py b/certitude/utils/ioc-selector.py similarity index 100% rename from utils/ioc-selector.py rename to certitude/utils/ioc-selector.py diff --git a/components/scanner/resources/localanalysis/pcre.so b/components/scanner/resources/localanalysis/pcre.so deleted file mode 100644 index fe3e4e6..0000000 Binary files a/components/scanner/resources/localanalysis/pcre.so and /dev/null differ diff --git a/components/scanner/resources/localanalysis/strings.so b/components/scanner/resources/localanalysis/strings.so deleted file mode 100644 index 1f6e679..0000000 Binary files a/components/scanner/resources/localanalysis/strings.so and /dev/null differ diff --git a/components/scanner/resources/sql/pcre.so b/components/scanner/resources/sql/pcre.so deleted file mode 100644 index fe3e4e6..0000000 Binary files a/components/scanner/resources/sql/pcre.so and /dev/null differ diff --git a/components/scanner/resources/sql/strings.so b/components/scanner/resources/sql/strings.so deleted file mode 100644 index 1f6e679..0000000 Binary files a/components/scanner/resources/sql/strings.so and /dev/null differ diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..187e482 --- /dev/null +++ b/setup.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from setuptools import setup, find_packages + +setup(name='certitude', + version='1.0', + description='The Seeker of IOC', + long_description=open('certitude/README.md').read(), + url='https://github.com/CERT-W/certitude', + author='CERT-W', + author_email='cert@wavestone.com', + license='GPL', + classifiers=[ + 'Topic :: Security', + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Information Technology', + 'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)', + ], + keywords='cert-w certitude scan ioc seeker', + packages=find_packages(), + python_requires='<3', + install_requires=['plyara', + 'bokeh', + 'dnspython', + 'flask', + 'flask-login', + 'impacket', + 'lxml', + 'netaddr', + 'pandas', + 'pbkdf2', + 'ply', + 'pyasn1', + 'pycryptodome', + 'pyopenssl', + 'sqlalchemy'], + dependency_links=['git+https://github.com/8u1a/plyara.git#egg=plyara'], + entry_points = { + 'console_scripts': ['certitude=certitude.main:main'], + }, + include_package_data=True) \ No newline at end of file