Skip to content

Commit

Permalink
Update built list of HSTS host hashes to include domains from cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
obsidianforensics committed Dec 19, 2021
1 parent 43cc007 commit 10f36ba
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pyhindsight/browsers/chrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -2141,7 +2141,14 @@ def build_hsts_domain_hashes(self):
domains = set()
for artifact in self.parsed_artifacts:
if isinstance(artifact, self.HistoryItem):
domain = urllib.parse.urlparse(artifact.url).hostname
artifact_url = artifact.url

# Cookie artifact's "URLs" will be in the form ".example.com",
# which won't parse, so modify it so it will
if artifact_url.startswith('.'):
artifact_url = 'http://' + artifact_url[1:]

domain = urllib.parse.urlparse(artifact_url).hostname
# Some URLs don't have a domain, like local PDF files
if domain:
domains.add(domain)
Expand Down

0 comments on commit 10f36ba

Please sign in to comment.