From 5475660785000ec2d1c6d7ae2a04e099dc57a17a Mon Sep 17 00:00:00 2001 From: Terrtia Date: Thu, 14 May 2020 10:26:54 +0200 Subject: [PATCH] fix: [UI Decoded items] fix download decoded file --- bin/lib/Correlate_object.py | 2 -- var/www/modules/hashDecoded/Flask_hashDecoded.py | 10 ++++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/lib/Correlate_object.py b/bin/lib/Correlate_object.py index 479105f0..90fcea3d 100755 --- a/bin/lib/Correlate_object.py +++ b/bin/lib/Correlate_object.py @@ -162,8 +162,6 @@ def get_correlation_node_icon(correlation_name, correlation_type=None, value=Non elif correlation_name == 'decoded': node_color = '#88CCEE' - print(Decoded.get_decoded_item_type(value)) - print(value) correlation_type = Decoded.get_decoded_item_type(value).split('/')[0] if correlation_type == 'application': icon_text = '\uf15b' diff --git a/var/www/modules/hashDecoded/Flask_hashDecoded.py b/var/www/modules/hashDecoded/Flask_hashDecoded.py index dd1c341a..0ad24fdf 100644 --- a/var/www/modules/hashDecoded/Flask_hashDecoded.py +++ b/var/www/modules/hashDecoded/Flask_hashDecoded.py @@ -6,6 +6,7 @@ ''' import redis import os +import sys import datetime import json from Date import Date @@ -20,6 +21,9 @@ from flask import Flask, render_template, jsonify, request, Blueprint, redirect, from Role_Manager import login_admin, login_analyst, login_read_only from flask_login import login_required +sys.path.append(os.path.join(os.environ['AIL_BIN'], 'lib')) +import Decoded + # ============ VARIABLES ============ import Flask_config @@ -705,8 +709,7 @@ def downloadHash(): # hash exist if r_serv_metadata.hget('metadata_hash:'+hash, 'estimated_type') is not None: - b64_path = r_serv_metadata.hget('metadata_hash:'+hash, 'saved_path') - b64_full_path = os.path.join(os.environ['AIL_HOME'], b64_path) + b64_full_path = Decoded.get_decoded_filepath(hash) hash_content = '' try: with open(b64_full_path, 'rb') as f: @@ -1079,8 +1082,7 @@ def hash_types(): def send_file_to_vt_js(): hash = request.args.get('hash') - b64_path = r_serv_metadata.hget('metadata_hash:'+hash, 'saved_path') - b64_full_path = os.path.join(os.environ['AIL_HOME'], b64_path) + b64_full_path = Decoded.get_decoded_filepath(hash) b64_content = '' with open(b64_full_path, 'rb') as f: b64_content = f.read()