chg: More improvements in body hash display

pull/78/head
Raphaël Vinot 2020-06-24 11:37:54 +02:00
parent bfa39223c8
commit 4851436999
2 changed files with 12 additions and 6 deletions

View File

@ -756,13 +756,16 @@ class Lookyloo():
to_append['body_hash_details'] = freq
captures_list: Dict[str, List[Tuple[str, str, str, str]]] = {'same_url': [], 'different_url': []}
for capture_uuid, url_uuid, url_hostname, same_url in self.indexing.get_body_hash_captures(url.body_hash, url.name):
cache = self.capture_cache(capture_uuid)
for h_capture_uuid, url_uuid, url_hostname, same_url in self.indexing.get_body_hash_captures(url.body_hash, url.name):
if h_capture_uuid == capture_uuid:
# Skip self.
continue
cache = self.capture_cache(h_capture_uuid)
if cache:
if same_url:
captures_list['same_url'].append((capture_uuid, url_uuid, cache['title'], url_hostname))
captures_list['same_url'].append((h_capture_uuid, url_uuid, cache['title'], url_hostname))
else:
captures_list['different_url'].append((capture_uuid, url_uuid, cache['title'], url_hostname))
captures_list['different_url'].append((h_capture_uuid, url_uuid, cache['title'], url_hostname))
to_append['body_hash_details']['other_captures'] = captures_list

View File

@ -122,9 +122,12 @@
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>
{% if url['body_hash_details']['other_captures'] %}
{% set total_captures = url['body_hash_details']['other_captures']['different_url']|length + url['body_hash_details']['other_captures']['same_url']|length %}
{% if total_captures > 0 %}
<p>
The same file was seen in <b>{{ url['body_hash_details']['other_captures']|length }}</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_{{ url['url_object'].uuid }}" aria-expanded="false" aria-controls="collapseExample">
Toggle list.
</button>