From 2d022514568fe717143037a5e26021af281c8bb0 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Thu, 5 Dec 2019 10:00:52 +0100 Subject: [PATCH] fix: [screenshot canevas + domain link] fix item domain link + screenshot canevas: chg colors and icons for unsafe tags --- var/www/modules/showpaste/Flask_showpaste.py | 17 +++++++++-------- .../showpaste/templates/show_saved_paste.html | 6 +++++- .../crawler/crawler_splash/showDomain.html | 10 +++++++--- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/var/www/modules/showpaste/Flask_showpaste.py b/var/www/modules/showpaste/Flask_showpaste.py index 82a5cb5c..2472dc96 100644 --- a/var/www/modules/showpaste/Flask_showpaste.py +++ b/var/www/modules/showpaste/Flask_showpaste.py @@ -20,8 +20,6 @@ import ssdeep import Paste import requests -from pyfaup.faup import Faup - sys.path.append(os.path.join(os.environ['AIL_BIN'], 'packages/')) import Tag @@ -48,8 +46,6 @@ vt_enabled = Flask_config.vt_enabled PASTES_FOLDER = Flask_config.PASTES_FOLDER SCREENSHOT_FOLDER = Flask_config.SCREENSHOT_FOLDER -faup = Faup() - showsavedpastes = Blueprint('showsavedpastes', __name__, template_folder='templates') # ============ FUNCTIONS ============ @@ -94,7 +90,6 @@ def showpaste(content_range, requested_path): p_date_list = [] p_hashtype_list = [] - for dup_list in p_duplicate_str_full_list: dup_list = dup_list[1:-1].replace('\'', '').replace(' ', '').split(',') if dup_list[0] == "tlsh": @@ -221,9 +216,7 @@ def showpaste(content_range, requested_path): if 'infoleak:submission="crawler"' in l_tags: crawler_metadata['get_metadata'] = True crawler_metadata['domain'] = r_serv_metadata.hget('paste_metadata:'+requested_path, 'domain') - faup.decode(crawler_metadata['domain']) - domain_unpack = faup.get() - crawler_metadata['domain'] = domain_unpack['domain'] + crawler_metadata['domain'] = crawler_metadata['domain'].rsplit(':', 1)[0] if tags_safe: tags_safe = Tag.is_tags_safe(Domain.get_domain_tags(crawler_metadata['domain'])) crawler_metadata['paste_father'] = r_serv_metadata.hget('paste_metadata:'+requested_path, 'father') @@ -371,6 +364,7 @@ def show_item_min(requested_path , content_range=0): crawler_metadata['paste_father'] = r_serv_metadata.hget('paste_metadata:'+relative_path, 'father') crawler_metadata['real_link'] = r_serv_metadata.hget('paste_metadata:'+relative_path,'real_link') crawler_metadata['screenshot'] = get_item_screenshot_path(relative_path) + crawler_metadata['har_file'] = Item.get_item_har(relative_path) else: crawler_metadata['get_metadata'] = False @@ -466,6 +460,13 @@ def showDiff(): def screenshot(filename): return send_from_directory(SCREENSHOT_FOLDER, filename+'.png', as_attachment=True) +# @showsavedpastes.route('/har/paste/') +# @login_required +# @login_read_only +# def har(filename): +# har_file = Item.get_item_har(filename) +# return jsonify(har_file) + @showsavedpastes.route('/send_file_to_vt/', methods=['POST']) @login_required @login_analyst diff --git a/var/www/modules/showpaste/templates/show_saved_paste.html b/var/www/modules/showpaste/templates/show_saved_paste.html index b7884ef6..7b2b265b 100644 --- a/var/www/modules/showpaste/templates/show_saved_paste.html +++ b/var/www/modules/showpaste/templates/show_saved_paste.html @@ -452,6 +452,10 @@ + + {% if crawler_metadata['har_file'] %} + button + {% endif %} @@ -464,7 +468,7 @@
- diff --git a/var/www/templates/crawler/crawler_splash/showDomain.html b/var/www/templates/crawler/crawler_splash/showDomain.html index 29a8aa34..ad2fa307 100644 --- a/var/www/templates/crawler/crawler_splash/showDomain.html +++ b/var/www/templates/crawler/crawler_splash/showDomain.html @@ -370,7 +370,7 @@
- @@ -379,8 +379,12 @@
-