From f8588ecf629035de02daca6776fe46f48350ff3e Mon Sep 17 00:00:00 2001 From: Oren Isacson Date: Wed, 21 Sep 2022 11:14:38 -0300 Subject: [PATCH] Fixing tags in unpacker.py, related to #820 --- src/unpacker/unpack.py | 6 ++---- src/web_interface/templates/analysis_plugins/unpacker.html | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/unpacker/unpack.py b/src/unpacker/unpack.py index cf5090ea3..43b18b5ad 100644 --- a/src/unpacker/unpack.py +++ b/src/unpacker/unpack.py @@ -53,18 +53,16 @@ def _store_unpacking_error_skip_info(file_object: FileObject): file_object.processed_analysis['unpacker'] = { 'plugin_used': 'None', 'number_of_unpacked_files': 0, 'plugin_version': '0.0', 'analysis_date': time(), 'info': 'Unpacking stopped because extractor raised a exception (possible timeout)', + 'tags': {'extractor error': {'value': 'possible extractor timeout', 'color': TagColor.ORANGE, 'propagate': False}}, } - tag_dict = {'unpacker': {'extractor error': {'value': 'possible extractor timeout', 'color': TagColor.ORANGE, 'propagate': False}}} - file_object.analysis_tags.update(tag_dict) @staticmethod def _store_unpacking_depth_skip_info(file_object: FileObject): file_object.processed_analysis['unpacker'] = { 'plugin_used': 'None', 'number_of_unpacked_files': 0, 'plugin_version': '0.0', 'analysis_date': time(), 'info': 'Unpacking stopped because maximum unpacking depth was reached', + 'tags': {'depth reached': {'value': 'unpacking depth reached', 'color': TagColor.ORANGE, 'propagate': False}}, } - tag_dict = {'unpacker': {'depth reached': {'value': 'unpacking depth reached', 'color': TagColor.ORANGE, 'propagate': False}}} - file_object.analysis_tags.update(tag_dict) def cleanup(self, tmp_dir): try: diff --git a/src/web_interface/templates/analysis_plugins/unpacker.html b/src/web_interface/templates/analysis_plugins/unpacker.html index a5a28a1e0..249998b4f 100644 --- a/src/web_interface/templates/analysis_plugins/unpacker.html +++ b/src/web_interface/templates/analysis_plugins/unpacker.html @@ -27,7 +27,7 @@ {% endif %} {% for unpacker_meta_field in firmware.processed_analysis[selected_analysis].keys() %} - {% if unpacker_meta_field not in ['plugin_used', 'number_of_unpacked_files', 'output', 'analysis_date', 'plugin_version', 'summary'] %} + {% if unpacker_meta_field not in ['tags', 'plugin_used', 'number_of_unpacked_files', 'output', 'analysis_date', 'plugin_version', 'summary'] %} {{ unpacker_meta_field | replace_underscore }}
{{ firmware.processed_analysis[selected_analysis][unpacker_meta_field] | nice_generic | safe }}
@@ -35,4 +35,4 @@ {% endif %} {% endfor %} -{% endblock %} \ No newline at end of file +{% endblock %}