From ba6c9c9601136d2b4aaa34b398c0bd9db0a77f16 Mon Sep 17 00:00:00 2001 From: terrtia Date: Tue, 8 Oct 2024 10:36:11 +0200 Subject: [PATCH] chg: [show domain] show titles content + fix item tags --- var/www/blueprints/crawler_splash.py | 20 +++++++++++-- .../crawler/crawler_splash/showDomain.html | 28 ++++++++++++++----- var/www/templates/objects/item/show_item.html | 2 +- .../templates/objects/item/show_item_min.html | 2 +- 4 files changed, 40 insertions(+), 12 deletions(-) diff --git a/var/www/blueprints/crawler_splash.py b/var/www/blueprints/crawler_splash.py index ab8ea152..e13e622b 100644 --- a/var/www/blueprints/crawler_splash.py +++ b/var/www/blueprints/crawler_splash.py @@ -29,6 +29,7 @@ from lib import Language from lib.objects import Domains from lib.objects.Items import Item +from lib.objects.Titles import Title from lib import Tag from packages import Date @@ -372,9 +373,22 @@ def showDomain(): dict_domain = domain.get_meta(options=['last_origin', 'languages']) dict_domain['domain'] = domain.id if domain.was_up(): - dict_domain = {**dict_domain, **domain.get_correlations(unpack=True)} - dict_domain['correlation_nb'] = len(dict_domain['decoded']) + len(dict_domain['username']) + len( - dict_domain['pgp']) + len(dict_domain['cryptocurrency']) + len(dict_domain['screenshot']) + dict_domain = {**dict_domain, **domain.get_correlations(filter_types=['cryptocurrency', 'decoded', 'pgp', 'screenshot', 'title'], unpack=True)} + + titles = [] + # for t in domain.get_correlation('title').get('title', []): + # title = Title(t[1:]) + # titles.append(title.get_content()) + for t in dict_domain['title']: + title = Title(t[1]) + titles.append({'id': title.id, 'content': title.get_content()}) + dict_domain['title'] = titles + + dict_domain['correlations_nb'] = domain.get_nb_correlations() + nb = 0 + for correl_type in dict_domain['correlations_nb']: + nb += dict_domain['correlations_nb'][correl_type] + dict_domain['correlation_nb'] = nb dict_domain['tags_safe'] = Tag.is_tags_safe(dict_domain['tags']) dict_domain['history'] = domain.get_history(status=True) curr_epoch = None diff --git a/var/www/templates/crawler/crawler_splash/showDomain.html b/var/www/templates/crawler/crawler_splash/showDomain.html index 10b48257..617bc944 100644 --- a/var/www/templates/crawler/crawler_splash/showDomain.html +++ b/var/www/templates/crawler/crawler_splash/showDomain.html @@ -64,7 +64,6 @@

{{ dict_domain['domain'] }}

First Seen Last Check - Ports Languages @@ -72,7 +71,6 @@

{{ dict_domain['domain'] }}

{%if "first_seen" in dict_domain%}{{ dict_domain['first_seen'] }}{%endif%} {%if "last_check" in dict_domain%}{{ dict_domain['last_check'] }}{%endif%} - {%if dict_domain["ports"]%}{{ dict_domain["ports"] }}{%endif%} {% for languages in dict_domain['languages'] %} {{languages}} @@ -105,7 +103,7 @@

{{ dict_domain['domain'] }}

{% if 'last_origin' in dict_domain %} - {% if dict_domain['last_origin']=='manual' or dict_domain['last_origin']=='auto' %} + {% if dict_domain['last_origin']['item']=='manual' or dict_domain['last_origin']['item']=='auto' %} {{ dict_domain['last_origin']['item'] }} @@ -161,6 +159,20 @@

{{ dict_domain['domain'] }}

+ {% for obj_type in dict_domain['correlations_nb'] %} + {% if dict_domain['correlations_nb'][obj_type] %} + {% if obj_type not in ['cryptocurrency', 'decoded', 'pgp', 'screenshot', 'title'] %} +
+
+ {{ obj_type }} +
+
+ {{ dict_domain['correlations_nb'][obj_type] }} +
+
+ {% endif %} + {% endif %} + {% endfor %} {% if 'decoded' in dict_domain%}
@@ -376,7 +388,7 @@

{{ dict_domain['domain'] }}

{% for title in dict_domain['title']%} - {{ title[1] }} + {{ title['content'] }} {% endfor %} @@ -417,9 +429,11 @@
Capture {% if not dict_domain["crawler_history_items"] %}: Domain DOWN{% end
{% for tag in item["tags"] %} - - {{ tag["min_tag"] }} - + {% if tag != 'infoleak:submission="crawler"' %} + + {{ tag }} + + {% endif %} {% endfor %}
diff --git a/var/www/templates/objects/item/show_item.html b/var/www/templates/objects/item/show_item.html index 979d6a00..2486348b 100644 --- a/var/www/templates/objects/item/show_item.html +++ b/var/www/templates/objects/item/show_item.html @@ -415,7 +415,7 @@
- {{ meta['father'] }} + {{ meta['father'] }} diff --git a/var/www/templates/objects/item/show_item_min.html b/var/www/templates/objects/item/show_item_min.html index 50c2e619..94da48fe 100644 --- a/var/www/templates/objects/item/show_item_min.html +++ b/var/www/templates/objects/item/show_item_min.html @@ -1,7 +1,7 @@ - Paste information - AIL + Item - AIL