diff --git a/bin/lib/objects/Items.py b/bin/lib/objects/Items.py index e20fa501..43221284 100755 --- a/bin/lib/objects/Items.py +++ b/bin/lib/objects/Items.py @@ -283,6 +283,8 @@ class Item(AbstractObject): if 'mimetype' in options: content = meta.get('content') meta['mimetype'] = self.get_mimetype(content=content) + if 'investigations' in options: + meta['investigations'] = self.get_investigations() # meta['encoding'] = None return meta diff --git a/var/www/blueprints/objects_item.py b/var/www/blueprints/objects_item.py index d83b1866..e3ae8d18 100644 --- a/var/www/blueprints/objects_item.py +++ b/var/www/blueprints/objects_item.py @@ -25,6 +25,7 @@ from lib.objects.Items import Item from lib.objects.Screenshots import Screenshot from lib import Tag +from lib import Investigations from lib import module_extractor @@ -66,7 +67,7 @@ def showItem(): # # TODO: support post abort(404) item = Item(item_id) - meta = item.get_meta(options={'content', 'crawler', 'duplicates', 'lines', 'size'}) + meta = item.get_meta(options={'content', 'crawler', 'duplicates', 'investigations', 'lines', 'size'}) meta['name'] = meta['id'].replace('/', ' / ') meta['father'] = item_basic.get_item_parent(item_id) @@ -75,6 +76,15 @@ def showItem(): # # TODO: support post # meta['hive_case'] = Export.get_item_hive_cases(item_id) meta['hive_case'] = None + if meta.get('investigations'): + invests = [] + for investigation_uuid in meta['investigations']: + inv = Investigations.Investigation(investigation_uuid) + invests.append(inv.get_metadata(r_str=True)) + meta['investigations'] = invests + else: + meta['investigations'] = [] + extracted = module_extractor.extract(item.id, content=meta['content']) extracted_matches = module_extractor.get_extracted_by_match(extracted) diff --git a/var/www/templates/objects/item/show_item.html b/var/www/templates/objects/item/show_item.html index 1b65ee97..5758a12e 100644 --- a/var/www/templates/objects/item/show_item.html +++ b/var/www/templates/objects/item/show_item.html @@ -145,7 +145,117 @@ {% endif %} - {% if meta['duplicates'] != 0 %} + {% if meta['investigations'] %} +
+
+
+
+
+
+ Investigations   +
{{meta['investigations']|length}}
+
+
+
+ +
+
+
+ +
+
+ + + + + + + + + + + + + {% for dict_investigation in meta['investigations'] %} + + + + + + + + {% endfor %} + +
NameDatelast modifiedInfoNb Objects
+ + {{ dict_investigation['info']}} +
+ {% for tag in dict_investigation['tags'] %} + {{ tag }} + {% endfor %} +
+
+
{{ dict_investigation['date']}}{{ dict_investigation['last_change']}}{{ dict_investigation['info']}}{{ dict_investigation['nb_objects']}}
+ +
+
+ +
+
+ {% endif %} + + + {% if l_64|length != 0 %} +
+
+
+
+
+
+ Decoded Files   +
{{l_64|length}}
+
+
+
+ +
+
+
+ +
+
+ + + + + + + + + + {% for b64 in l_64 %} + + + + + {% endfor %} + +
estimated typehash
  {{ b64[1] }} {{b64[2]}} ({{ b64[4] }})
+ +
+
+ + +
+
+ + {% endif %} + + {% if meta['duplicates'] %}
@@ -219,52 +329,52 @@ {% endif %} - {% if l_64|length != 0 %} -
-
-
-
-
-
- Decoded Files   -
{{l_64|length}}
-
-
-
- -
-
-
- -
-
- - - - - - - - - - {% for b64 in l_64 %} - - - - - {% endfor %} - -
estimated typehash
  {{ b64[1] }} {{b64[2]}} ({{ b64[4] }})
- -
-
- - -
-
- {% endif %} +{# {% if l_64|length != 0 %}#} +{#
#} +{#
#} +{#
#} +{#
#} +{#
#} +{#
#} +{# Decoded Files  #} +{#
{{l_64|length}}
#} +{#
#} +{#
#} +{#
#} +{# #} +{#
#} +{#
#} +{#
#} +{##} +{#
#} +{#
#} +{##} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# {% for b64 in l_64 %}#} +{# #} +{# #} +{# #} +{# #} +{# {% endfor %}#} +{# #} +{#
estimated typehash
  {{ b64[1] }} {{b64[2]}} ({{ b64[4] }})
#} +{##} +{#
#} +{#
#} +{##} +{##} +{#
#} +{#
#} +{# {% endif %}#} {% if meta['crawler'] %}