fix: [UI Decoded items] fix download decoded file

pull/519/head
Terrtia 2020-05-14 10:26:54 +02:00
parent 8f44a8d2c6
commit 5475660785
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
2 changed files with 6 additions and 6 deletions

View File

@ -162,8 +162,6 @@ def get_correlation_node_icon(correlation_name, correlation_type=None, value=Non
elif correlation_name == 'decoded': elif correlation_name == 'decoded':
node_color = '#88CCEE' node_color = '#88CCEE'
print(Decoded.get_decoded_item_type(value))
print(value)
correlation_type = Decoded.get_decoded_item_type(value).split('/')[0] correlation_type = Decoded.get_decoded_item_type(value).split('/')[0]
if correlation_type == 'application': if correlation_type == 'application':
icon_text = '\uf15b' icon_text = '\uf15b'

View File

@ -6,6 +6,7 @@
''' '''
import redis import redis
import os import os
import sys
import datetime import datetime
import json import json
from Date import Date 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 Role_Manager import login_admin, login_analyst, login_read_only
from flask_login import login_required from flask_login import login_required
sys.path.append(os.path.join(os.environ['AIL_BIN'], 'lib'))
import Decoded
# ============ VARIABLES ============ # ============ VARIABLES ============
import Flask_config import Flask_config
@ -705,8 +709,7 @@ def downloadHash():
# hash exist # hash exist
if r_serv_metadata.hget('metadata_hash:'+hash, 'estimated_type') is not None: 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 = Decoded.get_decoded_filepath(hash)
b64_full_path = os.path.join(os.environ['AIL_HOME'], b64_path)
hash_content = '' hash_content = ''
try: try:
with open(b64_full_path, 'rb') as f: with open(b64_full_path, 'rb') as f:
@ -1079,8 +1082,7 @@ def hash_types():
def send_file_to_vt_js(): def send_file_to_vt_js():
hash = request.args.get('hash') hash = request.args.get('hash')
b64_path = r_serv_metadata.hget('metadata_hash:'+hash, 'saved_path') b64_full_path = Decoded.get_decoded_filepath(hash)
b64_full_path = os.path.join(os.environ['AIL_HOME'], b64_path)
b64_content = '' b64_content = ''
with open(b64_full_path, 'rb') as f: with open(b64_full_path, 'rb') as f:
b64_content = f.read() b64_content = f.read()