chg: [show domain] show titles content + fix item tags
Some checks are pending
CI / ail_test (3.10) (push) Waiting to run
CI / ail_test (3.7) (push) Waiting to run
CI / ail_test (3.8) (push) Waiting to run
CI / ail_test (3.9) (push) Waiting to run

This commit is contained in:
terrtia 2024-10-08 10:36:11 +02:00
parent 554897e1d8
commit ba6c9c9601
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0
4 changed files with 40 additions and 12 deletions

View file

@ -29,6 +29,7 @@ from lib import crawlers
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

View file

@ -64,7 +64,6 @@
<tr>
<th>First Seen</th>
<th>Last Check</th>
<th>Ports</th>
<th>Languages</th>
</tr>
</thead>
@ -72,7 +71,6 @@
<tr>
<td class="panelText">{%if "first_seen" in dict_domain%}{{ dict_domain['first_seen'] }}{%endif%}</td>
<td class="panelText">{%if "last_check" in dict_domain%}{{ dict_domain['last_check'] }}{%endif%}</td>
<td class="panelText">{%if dict_domain["ports"]%}{{ dict_domain["ports"] }}{%endif%}</td>
<td class="panelText">
{% for languages in dict_domain['languages'] %}
{{languages}}
@ -105,7 +103,7 @@
</thead>
<tbody>
{% 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' %}
<tr>
<td></td>
<td><span class="badge badge-dark">{{ dict_domain['last_origin']['item'] }}</span></td>
@ -161,6 +159,20 @@
</div>
</div>
{% 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'] %}
<div class="row">
<div class="col-8">
{{ obj_type }}
</div>
<div class="col-4">
<span class="badge badge-primary">{{ dict_domain['correlations_nb'][obj_type] }}</span>
</div>
</div>
{% endif %}
{% endif %}
{% endfor %}
{% if 'decoded' in dict_domain%}
<div id="accordiondecoded" class="mt-3">
@ -376,7 +388,7 @@
<tbody>
{% for title in dict_domain['title']%}
<tr>
<td><a target="_blank" href="{{ url_for('correlation.show_correlation') }}?type=title&id={{ title[1] }}">{{ title[1] }}</a></td>
<td><a target="_blank" href="{{ url_for('correlation.show_correlation') }}?type=title&id={{ title['id'] }}">{{ title['content'] }}</a></td>
</tr>
{% endfor %}
</tbody>
@ -417,9 +429,11 @@
</a>
<div>
{% for tag in item["tags"] %}
<a href="{{ url_for('tags_ui.get_obj_by_tags') }}?object_type=item&ltags={{ tag["tag"] }}">
<span class="badge badge-{{ bootstrap_label[loop.index0 % 5] }} pull-left">{{ tag["min_tag"] }}</span>
{% if tag != 'infoleak:submission="crawler"' %}
<a href="{{ url_for('tags_ui.get_obj_by_tags') }}?object_type=item&ltags={{ tag }}">
<small class="badge badge-{{ bootstrap_label[loop.index0 % 5] }} pull-left">{{ tag }}</small>
</a>
{% endif %}
{% endfor %}
</div>
</td>

View file

@ -415,7 +415,7 @@
<tr>
<td><i class="far fa-file"></i></td>
<td>
<a class="badge" target="_blank" href="{{ url_for('objects_item.showItem', paste=meta['father']) }}">{{ meta['father'] }}</a>
<a class="badge" target="_blank" href="{{ url_for('objects_item.showItem', id=meta['father']) }}">{{ meta['father'] }}</a>
</td>
</tr>
<tr>

View file

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Paste information - AIL</title>
<title>Item - AIL</title>
<link rel="icon" href="{{ url_for('static', filename='image/ail-icon.png') }}">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">