Git Product home page Git Product logo

Comments (4)

obsidianforensics avatar obsidianforensics commented on August 26, 2024

Thanks for the detailed bug report! I'll take a look.

from hindsight.

Rivers-dev avatar Rivers-dev commented on August 26, 2024

This bug can be fixed by changing the format of artifact_url and artifact.url. in webbrowser.py and chrome.py:

In webbrowser.py:

    def build_md5_hash_list_of_origins(self):
        for artifact in self.parsed_artifacts:
            if isinstance(artifact, self.HistoryItem):
                # Bug here - does not work due to URL parsing - PATCHED
                if type(artifact.url) is not str:
                    return
                domain = urllib.parse.urlparse(artifact.url).hostname
                # Some URLs don't have a domain, like local PDF files
                if domain:
                    self.origin_hashes[hashlib.md5(domain.encode()).hexdigest()] = domain

In chrome.py:

    def build_hsts_domain_hashes(self):
        domains = set()
        for artifact in self.parsed_artifacts:
            if isinstance(artifact, self.HistoryItem):
                artifact_url = artifact.url

                if not artifact_url:
                    continue

                # Cookie artifact's "URLs" will be in the form ".example.com",
                # which won't parse, so modify it so it will
                if artifact_url and artifact_url.startswith('.'):
                    for i in range(len(artifact_url)):
                        if artifact_url[i] == '*':
                            artifact_url[i] = ''
                    artifact_url = 'http://' + artifact_url[1:]
                if type(artifact_url) == str:
                    artifact_url_cleaned = artifact_url.split('*')
                    #domain = urllib.parse.urlparse(url_list, scheme='https').hostname 
                # Same URL problem - PATCHED
                # Some URLs don't have a domain, like local PDF files
                if artifact_url_cleaned:
                    #domains.add(artifact_url_cleaned)
                    for url in artifact_url_cleaned:
                        domains.add(url)

I am not sure if this fix retains all functionality, but it at least lets it run and produces correct output on my end.

from hindsight.

obsidianforensics avatar obsidianforensics commented on August 26, 2024

Thanks again for the report and the comments! Should be fixed now.

from hindsight.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.