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

This commit is contained in:
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 }}">