From d6a24c035778333f6d31bb42d125716d30d00f27 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Thu, 29 Jun 2023 08:48:50 +0200 Subject: [PATCH] fix: [hunter + misp export] fix misp event json export + retro hunt date search and description --- bin/lib/Tracker.py | 4 ++-- var/www/blueprints/hunters.py | 2 +- var/www/blueprints/import_export.py | 1 + var/www/templates/hunter/trackersManagement.html | 10 +++++++++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/bin/lib/Tracker.py b/bin/lib/Tracker.py index 2a5336ad..b7ca5e77 100755 --- a/bin/lib/Tracker.py +++ b/bin/lib/Tracker.py @@ -650,14 +650,14 @@ def get_user_trackers_meta(user_id, tracker_type=None): metas = [] for tracker_uuid in get_user_trackers(user_id, tracker_type=tracker_type): tracker = Tracker(tracker_uuid) - metas.append(tracker.get_meta(options={'mails', 'sparkline', 'tags'})) + metas.append(tracker.get_meta(options={'description', 'mails', 'sparkline', 'tags'})) return metas def get_global_trackers_meta(tracker_type=None): metas = [] for tracker_uuid in get_global_trackers(tracker_type=tracker_type): tracker = Tracker(tracker_uuid) - metas.append(tracker.get_meta(options={'mails', 'sparkline', 'tags'})) + metas.append(tracker.get_meta(options={'description', 'mails', 'sparkline', 'tags'})) return metas def get_users_trackers_meta(): diff --git a/var/www/blueprints/hunters.py b/var/www/blueprints/hunters.py index b2a2e30b..9a2b6c3e 100644 --- a/var/www/blueprints/hunters.py +++ b/var/www/blueprints/hunters.py @@ -172,7 +172,7 @@ def show_tracker(): typo_squatting = set() if date_from: - date_from, date_to = Date.sanitise_daterange(meta['first_seen'], meta['last_seen']) + date_from, date_to = Date.sanitise_daterange(date_from, date_to) objs = tracker.get_objs_by_daterange(date_from, date_to) meta['objs'] = ail_objects.get_objects_meta(objs, flask_context=True) else: diff --git a/var/www/blueprints/import_export.py b/var/www/blueprints/import_export.py index 312fe0be..bb28d080 100644 --- a/var/www/blueprints/import_export.py +++ b/var/www/blueprints/import_export.py @@ -163,6 +163,7 @@ def objects_misp_export_post(): MISPExporter.delete_user_misp_objects_to_export(user_id) if not export: event_uuid = event[10:46] + event = f'{{"Event": {event}}}' # TODO ADD JAVASCRIPT REFRESH PAGE IF RESP == 200 return send_file(io.BytesIO(event.encode()), as_attachment=True, download_name=f'ail_export_{event_uuid}.json') diff --git a/var/www/templates/hunter/trackersManagement.html b/var/www/templates/hunter/trackersManagement.html index 6bd1cfe4..89407245 100644 --- a/var/www/templates/hunter/trackersManagement.html +++ b/var/www/templates/hunter/trackersManagement.html @@ -60,7 +60,7 @@ Tracker First seen Last seen - Email notification + Emails sparkline @@ -80,6 +80,10 @@ {% endif %} + {% if dict_uuid['description'] %} +
{{ dict_uuid['description'] }}
+ {% endif %} +
{% for tag in dict_uuid['tags'] %} @@ -145,6 +149,10 @@ {% endif %} + {% if dict_uuid['description'] %} +
{{ dict_uuid['description'] }}
+ {% endif %} +
{% for tag in dict_uuid['tags'] %}