diff --git a/lookyloo/lookyloo.py b/lookyloo/lookyloo.py index e7e43271..026f3514 100644 --- a/lookyloo/lookyloo.py +++ b/lookyloo/lookyloo.py @@ -989,15 +989,16 @@ class Lookyloo(): def get_hhh_investigator(self, hhh: str, /) -> Tuple[List[Tuple[str, str, str, str]], List[Tuple[str, str]]]: '''Returns all the captures related to a cookie name entry, used in the web interface.''' all_captures = dict(self.indexing.get_http_headers_hashes_captures(hhh)) - cached_captures = self.sorted_capture_cache([entry for entry in all_captures]) - captures = [(cache.uuid, - self.get_urlnode_from_tree(cache.uuid, all_captures[cache.uuid]).hostnode_uuid, - self.get_urlnode_from_tree(cache.uuid, all_captures[cache.uuid]).name, - cache.title) for cache in cached_captures] - # get the headers and format them as they were in the response - urlnode = self.get_urlnode_from_tree(cached_captures[0].uuid, all_captures[cached_captures[0].uuid]) - headers = [(header["name"], header["value"]) for header in urlnode.response['headers']] - return captures, headers + if cached_captures := self.sorted_capture_cache([entry for entry in all_captures]): + captures = [(cache.uuid, + self.get_urlnode_from_tree(cache.uuid, all_captures[cache.uuid]).hostnode_uuid, + self.get_urlnode_from_tree(cache.uuid, all_captures[cache.uuid]).name, + cache.title) for cache in cached_captures] + # get the headers and format them as they were in the response + urlnode = self.get_urlnode_from_tree(cached_captures[0].uuid, all_captures[cached_captures[0].uuid]) + headers = [(header["name"], header["value"]) for header in urlnode.response['headers']] + return captures, headers + return [], [] def hash_lookup(self, blob_hash: str, url: str, capture_uuid: str) -> Tuple[int, Dict[str, List[Tuple[str, str, str, str, str]]]]: '''Search all the captures a specific hash was seen.