fix: [hunter + misp export] fix misp event json export + retro hunt date search and description

pull/604/head
Terrtia 2023-06-29 08:48:50 +02:00
parent b4d536f174
commit d6a24c0357
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
4 changed files with 13 additions and 4 deletions

View File

@ -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():

View File

@ -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:

View File

@ -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')

View File

@ -60,7 +60,7 @@
<th>Tracker</th>
<th>First seen</th>
<th>Last seen</th>
<th>Email notification</th>
<th>Emails</th>
<th>sparkline</th>
</tr>
</thead>
@ -80,6 +80,10 @@
{% endif %}
</a>
</span>
{% if dict_uuid['description'] %}
<div><i>{{ dict_uuid['description'] }}</i></div>
{% endif %}
<div>
{% for tag in dict_uuid['tags'] %}
<a href="{{ url_for('tags_ui.get_obj_by_tags') }}?object_type=item&ltags={{ tag }}">
@ -145,6 +149,10 @@
{% endif %}
</a>
</span>
{% if dict_uuid['description'] %}
<div><i>{{ dict_uuid['description'] }}</i></div>
{% endif %}
<div>
{% for tag in dict_uuid['tags'] %}
<a href="{{ url_for('tags_ui.get_obj_by_tags') }}?object_type=item&ltags={{ tag }}">