Skip to content

Commit

Permalink
chg: [show domain] show titles content + fix item tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrtia committed Oct 8, 2024
1 parent 554897e commit ba6c9c9
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 12 deletions.
20 changes: 17 additions & 3 deletions var/www/blueprints/crawler_splash.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
28 changes: 21 additions & 7 deletions var/www/templates/crawler/crawler_splash/showDomain.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,13 @@ <h3 class="card-title text-white">{{ dict_domain['domain'] }}</h3>
<tr>
<th>First Seen</th>
<th>Last Check</th>
<th>Ports</th>
<th>Languages</th>
</tr>
</thead>
<tbody>
<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}}
Expand Down Expand Up @@ -105,7 +103,7 @@ <h3 class="card-title text-white">{{ dict_domain['domain'] }}</h3>
</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>
Expand Down Expand Up @@ -161,6 +159,20 @@ <h3 class="card-title text-white">{{ dict_domain['domain'] }}</h3>
</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">
Expand Down Expand Up @@ -376,7 +388,7 @@ <h3 class="card-title text-white">{{ dict_domain['domain'] }}</h3>
<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>
Expand Down Expand Up @@ -417,9 +429,11 @@ <h5>Capture {% if not dict_domain["crawler_history_items"] %}: Domain DOWN{% end
</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>
</a>
{% 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>
Expand Down
2 changes: 1 addition & 1 deletion var/www/templates/objects/item/show_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ <h5>
<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>
Expand Down
2 changes: 1 addition & 1 deletion var/www/templates/objects/item/show_item_min.html
Original file line number Diff line number Diff line change
@@ -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">
Expand Down

0 comments on commit ba6c9c9

Please sign in to comment.