lookyloo/website/web/templates/hostname_popup.html

198 lines
9.1 KiB
HTML
Raw Normal View History

2020-05-18 18:35:20 +02:00
{% extends "main.html" %}
2020-07-12 01:56:29 +02:00
{% from "macros.html" import sanejs_details %}
{% from "macros.html" import indexed_hash %}
{% from "macros.html" import indexed_cookies %}
2020-07-15 13:51:45 +02:00
{% from "macros.html" import popup_icons %}
2020-07-15 18:04:34 +02:00
{% from "macros.html" import shorten_string %}
2020-05-18 18:35:20 +02:00
{% block title %}Details for {{ hostname }} {% endblock %}
2020-05-18 18:35:20 +02:00
{% block scripts %}
2020-05-27 12:38:25 +02:00
{{ super() }}
2020-05-18 18:35:20 +02:00
<script>
2020-06-04 18:23:36 +02:00
function whereAmI(hostname_uuid) {
window.opener.ProcessChildMessage(hostname_uuid);
2020-05-18 18:35:20 +02:00
};
</script>
2020-05-27 12:38:25 +02:00
<script>
// Source: https://codepen.io/nathanlong/pen/ZpAmjv
function copyToClipboard(text, el) {
var elOriginalText = el.attr('data-original-title');
var copyTextArea = document.createElement("textarea");
copyTextArea.value = text;
document.body.appendChild(copyTextArea);
copyTextArea.select();
var successful = document.execCommand('copy');
var msg = successful ? 'Copied!' : 'Whoops, not copied!';
el.attr('data-original-title', msg).tooltip('show');
document.body.removeChild(copyTextArea);
el.attr('data-original-title', elOriginalText);
}
$(document).ready(function() {
// Copy to clipboard
// Grab any text in the attribute 'data-copy' and pass it to the copy function
$('.js-copy').tooltip();
2020-05-27 12:38:25 +02:00
$('.js-copy').click(function() {
var text = $(this).attr('data-copy');
var el = $(this);
copyToClipboard(text, el);
});
});
</script>
2020-05-18 18:35:20 +02:00
{% endblock %}
{% block content %}
2020-07-12 01:56:29 +02:00
{# Headers #}
<center>
<h3>{{ hostname }}</h3>
2020-06-04 18:23:36 +02:00
<button type="button" class="btn btn-info" onclick="whereAmI('{{ hostname_uuid }}')">Locate node on tree</button>
2020-05-20 19:11:15 +02:00
<a href="{{ url_for('hostnode_details_text', tree_uuid=tree_uuid, node_uuid=hostname_uuid) }}" class="btn btn-info" role="button">Get URLs as text</a>
</center>
2020-07-12 01:56:29 +02:00
{# Start list of URLs #}
2020-05-22 17:36:22 +02:00
<ul class="list-group-flush">
2020-06-04 18:23:36 +02:00
{% for url in urls %}
2020-07-12 01:56:29 +02:00
{# URL Display #}
2020-05-23 03:37:24 +02:00
<li class="list-group-item">
2020-05-27 12:38:25 +02:00
<div class="h3">
2020-07-12 01:56:29 +02:00
{# Copy full URL to clipbard #}
2020-05-27 12:38:25 +02:00
<button type="button" class="btn btn-default btn-copy js-copy"
2020-06-04 18:23:36 +02:00
data-toggle="tooltip" data-placement="bottom" data-copy="{{ url['url_object'].name }}" title="Copy to clipboard">
2020-05-27 12:38:25 +02:00
<svg class="bi bi-clipboard" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z"/>
<path fill-rule="evenodd" d="M9.5 1h-3a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z"/>
</svg>
</button>
2020-07-12 01:56:29 +02:00
{# HTTPs or not #}
2020-06-04 18:23:36 +02:00
{% if url['encrypted'] %}
2020-05-27 12:38:25 +02:00
<svg class="bi bi-lock" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M11.5 8h-7a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1V9a1 1 0 0 0-1-1zm-7-1a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h7a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-7zm0-3a3.5 3.5 0 1 1 7 0v3h-1V4a2.5 2.5 0 0 0-5 0v3h-1V4z"/>
</svg>
{% else %}
<svg class="bi bi-unlock" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M9.655 8H2.333c-.264 0-.398.068-.471.121a.73.73 0 0 0-.224.296 1.626 1.626 0 0 0-.138.59V14c0 .342.076.531.14.635.064.106.151.18.256.237a1.122 1.122 0 0 0 .436.127l.013.001h7.322c.264 0 .398-.068.471-.121a.73.73 0 0 0 .224-.296 1.627 1.627 0 0 0 .138-.59V9c0-.342-.076-.531-.14-.635a.658.658 0 0 0-.255-.237A1.122 1.122 0 0 0 9.655 8zm.012-1H2.333C.5 7 .5 9 .5 9v5c0 2 1.833 2 1.833 2h7.334c1.833 0 1.833-2 1.833-2V9c0-2-1.833-2-1.833-2zM8.5 4a3.5 3.5 0 1 1 7 0v3h-1V4a2.5 2.5 0 0 0-5 0v3h-1V4z"/>
</svg>
{%endif%}
2020-07-12 01:56:29 +02:00
{# URL #}
2020-07-15 18:04:34 +02:00
... /{{ shorten_string(url['url_path'], 50)}}
2020-05-27 12:38:25 +02:00
</div>
2020-05-23 03:37:24 +02:00
<ul class="list-group">
<li class="list-group-item">
{# Details of the response #}
2020-05-23 03:37:24 +02:00
<p class="h4">Response</p>
2020-07-15 13:51:45 +02:00
{{ popup_icons(keys_response, url['url_object'], tree_uuid) }}
2020-05-28 17:33:43 +02:00
2020-07-12 01:56:29 +02:00
{# Response content block #}
2020-05-23 03:37:24 +02:00
<div>
2020-06-04 18:23:36 +02:00
{% if not url['url_object'].empty_response %}
2020-07-12 01:56:29 +02:00
{# Download content #}
2020-06-04 18:23:36 +02:00
<a href="{{ url_for('urlnode_details', tree_uuid=tree_uuid, node_uuid=url['url_object'].uuid) }}">
2020-05-23 03:37:24 +02:00
Download response body.
</a></br>
2020-06-04 18:23:36 +02:00
Body size: {{ sizeof_fmt(url['url_object'].body.getbuffer().nbytes) }}
2020-05-23 03:37:24 +02:00
{% else %}
Empty body.
2020-05-22 17:36:22 +02:00
{%endif%}
2020-05-27 12:38:25 +02:00
</div>
2020-05-28 17:33:43 +02:00
2020-07-12 01:56:29 +02:00
{# Status code of the response #}
2020-05-27 12:38:25 +02:00
<div>
2020-06-04 18:23:36 +02:00
Status Code: {{ url['url_object'].response['status'] }}
2020-05-27 12:38:25 +02:00
</div>
{% if url['sane_js'] %}
2020-07-12 01:56:29 +02:00
{# Result from SaneJS for the response #}
{{ sanejs_details(url['sane_js']) }}
{% endif %}
2020-07-12 01:56:29 +02:00
{# Everything we know about the response content #}
2020-07-15 01:35:55 +02:00
{% if url['body_hash_details'] and url['body_hash_details']['hash_freq'] %}
<div>
This file can be found <b>{{ url['body_hash_details']['hash_freq'] }}</b> times
across all the captures on this lookyloo instance, in <b>{{ url['body_hash_details']['hash_domains_freq'] }}</b> unique domains.
</br>
2020-07-12 01:56:29 +02:00
{# other captures related wit the same dontent #}
2020-07-11 02:10:56 +02:00
{% if 'other_captures' in url['body_hash_details'] %}
2020-07-12 01:56:29 +02:00
{{ indexed_hash(url['body_hash_details']['other_captures'], url['url_object'].uuid) }}
{% endif %}
2020-07-12 01:56:29 +02:00
{# Link to list of captures with the same hash #}
<p>
<a href="{{ url_for('body_hash_details', body_hash=url['url_object'].body_hash) }}">
Show more information about this response body.
2020-07-12 01:56:29 +02:00
</a>
</p>
<div>
{% endif %}
2020-05-28 17:33:43 +02:00
{% if url['embedded_ressources'] %}
2020-07-12 01:56:29 +02:00
{# Details on embedded resources #}
<div><b>This response contains embedded ressources</b></div>
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#embedded_full_list_{{ url['url_object'].uuid }}" aria-expanded="false" aria-controls="collapseExample">
Toggle list of embedded resources.
</button>
<div class="collapse" id="embedded_full_list_{{ url['url_object'].uuid }}">
<div class="card card-body">
{% for hash, details in url['embedded_ressources'].items() %}
{% if details['sane_js'] %}
2020-07-12 01:56:29 +02:00
{# Result from SaneJS for the embedded ressources #}
{{ sanejs_details(details['sane_js']) }}
{% endif %}
<div>
This file (<b>{{ details['type'] }}</b>) can be found <b>{{ details['hash_freq'] }}</b> times
across all the captures on this lookyloo instance, in <b>{{ details['hash_domains_freq'] }}</b> unique domains.
2020-07-11 02:10:56 +02:00
<form method="post" action="{{ url_for('get_embedded_ressource', tree_uuid=tree_uuid, node_uuid=url['url_object'].uuid) }}">
<button class="btn btn-primary" name="ressource_hash" value="{{ hash }}">Download the embedded ressource</button>
</form>
</br>
2020-07-11 02:10:56 +02:00
{% if 'other_captures' in details %}
2020-07-12 01:56:29 +02:00
{{ indexed_hash(details['other_captures'], hash) }}
{% endif %}
<p><a href="{{ url_for('body_hash_details', body_hash=url['url_object'].body_hash) }}">
Show more information about this embedded content.
</a></p>
<div>
{% endfor %}
</div>
</div>
{% endif %}
2020-06-04 18:23:36 +02:00
{% if url['cookies_received'] %}
2020-06-11 15:13:31 +02:00
<div>
<p class="h5">Cookies</p>
{{ indexed_cookies("This response contains 3rd party cookies:", "Show node sending this cookie", url['cookies_received']['3rd_party']) }}
{{ indexed_cookies("Other cookies sent somewhere else in the capture", "Show node sending this cookie", url['cookies_received']['sent']) }}
{{ indexed_cookies("Other cookies, but never sent", "", url['cookies_received']['not_sent']) }}
2020-06-11 15:13:31 +02:00
<div>
2020-06-04 18:23:36 +02:00
{% endif %}
2020-05-23 03:37:24 +02:00
</li>
2020-05-28 17:33:43 +02:00
2020-05-23 03:37:24 +02:00
<li class="list-group-item">
<p class="h4">Request</p>
2020-07-15 13:51:45 +02:00
{{ popup_icons(keys_request, url['url_object'], tree_uuid) }}
2020-06-04 18:23:36 +02:00
{% if url['url_object'].posted_data %}
<a href="{{ url_for('urlnode_post_request', tree_uuid=tree_uuid, node_uuid=url['url_object'].uuid) }}">
2020-05-23 03:37:24 +02:00
Download posted data
</a></br>
2020-06-04 18:23:36 +02:00
Posted data size: {{ sizeof_fmt(url['url_object'].posted_data|length) }}
{% endif %}
{% if url['cookies_sent'] %}
2020-06-11 15:13:31 +02:00
<div>
<p class="h5">Cookies</p>
{{ indexed_cookies("List of cookies sent in the request", "Show on tree node setting this cookie", url['cookies_sent']) }}
2020-06-11 15:13:31 +02:00
</div>
2020-05-23 03:37:24 +02:00
{% endif %}
2020-06-09 15:06:35 +02:00
</li>
</ul>
2020-05-23 03:37:24 +02:00
</li>
{% endfor %}
2020-05-22 17:36:22 +02:00
</ul>
2020-05-18 18:35:20 +02:00
{% endblock %}