chg: Fix a bunch of views, make icons clickable.

pull/78/head
Raphaël Vinot 2020-07-16 01:08:39 +02:00
parent c7db7829a7
commit b4e5d1be08
3 changed files with 41 additions and 29 deletions

View File

@ -164,10 +164,14 @@ def hostnode_popup(tree_uuid: str, node_uuid: str):
'font': "/static/font.png",
'html': "/static/html.png",
'json': "/static/json.png",
'text': "/static/json.png", # FIXME: Need new icon
'iframe': "/static/ifr.png",
'image': "/static/img.png",
'unset_mimetype': "/static/wtf.png",
'octet-stream': "/static/wtf.png",
'unknown_mimetype': "/static/wtf.png",
'video': "/static/video.png",
'livestream': "/static/video.png",
'response_cookie': "/static/cookie_received.png",
'redirect': "/static/redirect.png",
'redirect_to_nothing': "/static/cookie_in_url.png"

View File

@ -83,26 +83,14 @@
<ul class="list-group">
<li class="list-group-item">
{# Details of the response #}
<p class="h4">Response</p>
<p class="h4">Response <small>(Status code: {{ url['url_object'].response['status'] }})</small></p>
{{ popup_icons(keys_response, url['url_object'], tree_uuid) }}
{# Response content block #}
<div>
{% if not url['url_object'].empty_response %}
{# Download content #}
<a href="{{ url_for('urlnode_details', tree_uuid=tree_uuid, node_uuid=url['url_object'].uuid) }}">
Download response body.
</a></br>
Body size: {{ sizeof_fmt(url['url_object'].body.getbuffer().nbytes) }}
{% if url['url_object'].empty_response %}
Empty body.
{% else %}
Empty body.
Body size: {{ sizeof_fmt(url['url_object'].body.getbuffer().nbytes) }}
{%endif%}
</div>
{# Status code of the response #}
<div>
Status Code: {{ url['url_object'].response['status'] }}
</div>
{% if url['sane_js'] %}
{# Result from SaneJS for the response #}
@ -126,7 +114,7 @@
Show more information about this response body.
</a>
</p>
<div>
</div>
{% endif %}
{% if url['embedded_ressources'] %}
@ -156,7 +144,7 @@
<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>
</div>
{% endfor %}
</div>
</div>
@ -164,11 +152,19 @@
{% if url['cookies_received'] %}
<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']) }}
<div>
<p class="h5">This response contains cookies.
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#response_cookies_full_list_{{ url['url_object'].uuid }}" aria-expanded="false" aria-controls="collapseExample">
Show all cookies received.
</button>
</p>
<div class="collapse" id="response_cookies_full_list_{{ url['url_object'].uuid }}">
<div class="card card-body">
{{ indexed_cookies("This response contains 3rd party cookies:", "Show node sending this cookie", url['cookies_received']['3rd_party']) }}
{{ indexed_cookies("Cookies, sent somewhere in the capture", "Show node sending this cookie", url['cookies_received']['sent']) }}
{{ indexed_cookies("Cookies, never sent", "", url['cookies_received']['not_sent']) }}
</div>
</div>
</div>
{% endif %}
</li>
@ -185,8 +181,16 @@
{% if url['cookies_sent'] %}
<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']) }}
<p class="h5">This request contains cookies.
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#request_cookies_full_list_{{ url['url_object'].uuid }}" aria-expanded="false" aria-controls="collapseExample">
Show all cookies sent.
</button>
</p>
<div class="collapse" id="request_cookies_full_list_{{ url['url_object'].uuid }}">
<div class="card card-body">
{{ indexed_cookies("List of cookies sent in the request", "Show on tree node setting this cookie", url['cookies_sent']) }}
</div>
</div>
</div>
{% endif %}
</li>

View File

@ -17,7 +17,7 @@
{# Only show details if the hits are in an other capture #}
{% if total_captures > 0 %}
<p>
The same file was seen in <b>{{ total_captures }}</b> other captures.
The same file was seen in <b>{{ total_captures }}</b> other captures.
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#captureslist_{{ identifier_for_toggle }}" aria-expanded="false" aria-controls="collapseExample">
Toggle list.
</button>
@ -51,8 +51,8 @@ The same file was seen in <b>{{ total_captures }}</b> other captures.
{% endfor %}
</ul>
</div>
{% endif %}
</div>
{% endif %}
</div>
{% else %}
<p>This file is loaded multiple times in this capture.</p>
@ -89,13 +89,17 @@ The same file was seen in <b>{{ total_captures }}</b> other captures.
{% for key, path in lookup_dict.items() %}
{% if urlnode[key] %}
{% if key == "request_cookie" %}
<a href="{{ url_for('urlnode_request_cookies', tree_uuid=tree_uuid, node_uuid=urlnode.uuid) }}">
<a href="{{ url_for('urlnode_request_cookies', tree_uuid=tree_uuid, node_uuid=urlnode.uuid) }}" title="Download all the cookies in the request to the server">
<img src="{{ path }}" alt="{{ key }}" width="21" height="21"/>
</a>
{% elif key == "response_cookie"%}
<a href="{{ url_for('urlnode_response_cookies', tree_uuid=tree_uuid, node_uuid=urlnode.uuid) }}">
<a href="{{ url_for('urlnode_response_cookies', tree_uuid=tree_uuid, node_uuid=urlnode.uuid) }}" title="Download all the cookies in the response from the server">
<img src="{{ path }}" alt="{{ key }}" width="21" height="21"/>
</a>
{% elif key in ["js", "exe", "css", "font", "html", "json", "image", "video", "unknown_mimetype", "text", "unset_mimetype", "octet-stream", "livestream"] and not urlnode.empty_response %}
<a href="{{ url_for('urlnode_details', tree_uuid=tree_uuid, node_uuid=urlnode.uuid) }}" title="Download the content of the response">
<img src="{{ path }}" alt="{{ key }}" width="21" height="21"/>
</a>
{% else %}
<img src="{{ path }}" alt="{{ key }}" width="21" height="21"/>
{%endif%}