chg: [show domain] show titles content + fix item tags

pull/607/merge
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 import Language
from lib.objects import Domains from lib.objects import Domains
from lib.objects.Items import Item from lib.objects.Items import Item
from lib.objects.Titles import Title
from lib import Tag from lib import Tag
from packages import Date from packages import Date
@ -372,9 +373,22 @@ def showDomain():
dict_domain = domain.get_meta(options=['last_origin', 'languages']) dict_domain = domain.get_meta(options=['last_origin', 'languages'])
dict_domain['domain'] = domain.id dict_domain['domain'] = domain.id
if domain.was_up(): if domain.was_up():
dict_domain = {**dict_domain, **domain.get_correlations(unpack=True)} dict_domain = {**dict_domain, **domain.get_correlations(filter_types=['cryptocurrency', 'decoded', 'pgp', 'screenshot', 'title'], 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']) 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['tags_safe'] = Tag.is_tags_safe(dict_domain['tags'])
dict_domain['history'] = domain.get_history(status=True) dict_domain['history'] = domain.get_history(status=True)
curr_epoch = None curr_epoch = None

View File

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

View File

@ -415,7 +415,7 @@
<tr> <tr>
<td><i class="far fa-file"></i></td> <td><i class="far fa-file"></i></td>
<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> </td>
</tr> </tr>
<tr> <tr>

View File

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