From 8a974eac6c8ba763383aa6c0275efdb65ef3394a Mon Sep 17 00:00:00 2001 From: Terrtia Date: Wed, 20 Nov 2019 13:10:01 +0100 Subject: [PATCH 1/7] fix: [showDomain UI] fix template --- var/www/templates/crawler/crawler_splash/showDomain.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/www/templates/crawler/crawler_splash/showDomain.html b/var/www/templates/crawler/crawler_splash/showDomain.html index 5784e8e3..da2bfadf 100644 --- a/var/www/templates/crawler/crawler_splash/showDomain.html +++ b/var/www/templates/crawler/crawler_splash/showDomain.html @@ -98,7 +98,7 @@ Last Origin: {{ dict_domain['origin_item'] }} {%endif%} - {% if dict_domain['correlation_nb'] > 0 %} + {% if 'correlation_nb' in dict_domain %}
From d573dfde1ac4656eb6f4115f26bd27adcc4561a7 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Wed, 20 Nov 2019 13:16:09 +0100 Subject: [PATCH 2/7] fix: [showDomain UI] fix template --- var/www/templates/crawler/crawler_splash/showDomain.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/www/templates/crawler/crawler_splash/showDomain.html b/var/www/templates/crawler/crawler_splash/showDomain.html index da2bfadf..9cd92dc8 100644 --- a/var/www/templates/crawler/crawler_splash/showDomain.html +++ b/var/www/templates/crawler/crawler_splash/showDomain.html @@ -98,7 +98,7 @@ Last Origin: {{ dict_domain['origin_item'] }} {%endif%} - {% if 'correlation_nb' in dict_domain %} + {% if in dict_domain.get('correlation_nb', 0) > 0 %}
From 00c2b139c64c243c7bb313e6321e6617d8e0c836 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Thu, 21 Nov 2019 10:32:51 +0100 Subject: [PATCH 4/7] fix: [Correlation UI] fix decoded file type + exist_correlation_id --- bin/lib/Correlate_object.py | 2 +- bin/lib/Decoded.py | 4 +++- bin/packages/Correlation.py | 2 +- var/www/templates/correlation/metadata_card_decoded.html | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/lib/Correlate_object.py b/bin/lib/Correlate_object.py index e8e8b975..e3f21bd1 100755 --- a/bin/lib/Correlate_object.py +++ b/bin/lib/Correlate_object.py @@ -54,7 +54,7 @@ def get_object_metadata(object_type, correlation_id, type_id=None): elif object_type == 'paste': return Item.get_item({"id": correlation_id, "date": True, "tags": True})[0] elif object_type == 'decoded': - return Decoded.get_decoded_metadata(correlation_id, nb_seen=True, size=True) + return Decoded.get_decoded_metadata(correlation_id, nb_seen=True, size=True, file_type=True) elif object_type == 'pgp': return Pgp.pgp.get_metadata(type_id, correlation_id) elif object_type == 'cryptocurrency': diff --git a/bin/lib/Decoded.py b/bin/lib/Decoded.py index ce619fb5..0f5d65dc 100755 --- a/bin/lib/Decoded.py +++ b/bin/lib/Decoded.py @@ -42,7 +42,7 @@ def nb_decoded_item_size(sha1_string): def exist_decoded(sha1_string): return r_serv_metadata.exists('metadata_hash:{}'.format(sha1_string)) -def get_decoded_metadata(sha1_string, nb_seen=False, size=False): +def get_decoded_metadata(sha1_string, nb_seen=False, size=False, file_type=False): metadata_dict = {} metadata_dict['first_seen'] = r_serv_metadata.hget('metadata_hash:{}'.format(sha1_string), 'first_seen') metadata_dict['last_seen'] = r_serv_metadata.hget('metadata_hash:{}'.format(sha1_string), 'last_seen') @@ -50,6 +50,8 @@ def get_decoded_metadata(sha1_string, nb_seen=False, size=False): metadata_dict['nb_seen'] = nb_decoded_seen_in_item(sha1_string) if size: metadata_dict['size'] = nb_decoded_item_size(sha1_string) + if file_type: + metadata_dict['file_type'] = get_decoded_item_type(sha1_string) return metadata_dict def get_list_nb_previous_hash(sha1_string, num_day): diff --git a/bin/packages/Correlation.py b/bin/packages/Correlation.py index 1f27b9a2..67a3dbf4 100755 --- a/bin/packages/Correlation.py +++ b/bin/packages/Correlation.py @@ -22,7 +22,7 @@ class Correlation(object): self.all_correlation_types = all_correlation_types def _exist_corelation_field(self, correlation_type, field_name, item_type='paste'): - if type=='paste': + if item_type=='paste': return r_serv_metadata.exists('set_{}_{}:{}'.format(self.correlation_name, correlation_type, field_name)) else: return r_serv_metadata.exists('set_domain_{}_{}:{}'.format(self.correlation_name, correlation_type, field_name)) diff --git a/var/www/templates/correlation/metadata_card_decoded.html b/var/www/templates/correlation/metadata_card_decoded.html index fe19bb51..3a070784 100644 --- a/var/www/templates/correlation/metadata_card_decoded.html +++ b/var/www/templates/correlation/metadata_card_decoded.html @@ -26,7 +26,7 @@ {{ dict_object["metadata_card"]["icon"]["icon_text"] }} - {{ dict_object["metadata"]["type_id"] }} + {{ dict_object["metadata"]["file_type"] }} {{ dict_object["metadata"]['first_seen'] }} {{ dict_object["metadata"]['last_seen'] }} From e42bfae7996f28bee4703cc354e233147de53b99 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Thu, 21 Nov 2019 14:29:42 +0100 Subject: [PATCH 5/7] fix: [show paste min UI] fix correlation url --- var/www/modules/showpaste/templates/show_saved_item_min.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/www/modules/showpaste/templates/show_saved_item_min.html b/var/www/modules/showpaste/templates/show_saved_item_min.html index ef9fa465..feaff95a 100644 --- a/var/www/modules/showpaste/templates/show_saved_item_min.html +++ b/var/www/modules/showpaste/templates/show_saved_item_min.html @@ -132,7 +132,7 @@ {% for b64 in l_64 %}   {{ b64[1] }} - {{ b64[2] }} ({{ b64[4] }}) + ({{ b64[4] }}) {% endfor %} From f56e25e1d99676a4762200d7fa4531fad52f58c5 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Thu, 21 Nov 2019 14:32:20 +0100 Subject: [PATCH 6/7] fix: [show paste min UI] fix correlation url --- var/www/modules/showpaste/templates/show_saved_item_min.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/www/modules/showpaste/templates/show_saved_item_min.html b/var/www/modules/showpaste/templates/show_saved_item_min.html index feaff95a..3da1f8ce 100644 --- a/var/www/modules/showpaste/templates/show_saved_item_min.html +++ b/var/www/modules/showpaste/templates/show_saved_item_min.html @@ -132,7 +132,7 @@ {% for b64 in l_64 %}   {{ b64[1] }} - ({{ b64[4] }}) + ({{ b64[2] }}) {% endfor %} From 1ae43d5b310b017fdc370c2ade2a5187ebe991a2 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Thu, 21 Nov 2019 14:33:57 +0100 Subject: [PATCH 7/7] fix: [show paste min UI] typo --- var/www/modules/showpaste/templates/show_saved_item_min.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/www/modules/showpaste/templates/show_saved_item_min.html b/var/www/modules/showpaste/templates/show_saved_item_min.html index 3da1f8ce..3d3da3fc 100644 --- a/var/www/modules/showpaste/templates/show_saved_item_min.html +++ b/var/www/modules/showpaste/templates/show_saved_item_min.html @@ -132,7 +132,7 @@ {% for b64 in l_64 %}   {{ b64[1] }} - ({{ b64[2] }}) + {{b64[2]}} ({{ b64[4] }}) {% endfor %}