Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collect Murmur Hash of Favicon #344

Open
0xdade opened this issue Jul 8, 2020 · 0 comments
Open

Collect Murmur Hash of Favicon #344

0xdade opened this issue Jul 8, 2020 · 0 comments
Labels
agent affecting natlas-agent enhancement New feature or request

Comments

@0xdade
Copy link
Member

0xdade commented Jul 8, 2020

Is your feature request related to a problem?
The Nmap http-favicon script is pretty unreliable and doesn't produce a result that is easily searchable. Instead it produces a text output based on whether or not that favicon is known in the nse.

Describe the feature you'd like
Build support for the agent to fetch favicons for each http service and store their mmh3 value.

Have you considered alternative ways to get this feature
If I were writing this capability (which I probably will be), I'd do it something like this:

  1. Getting the favicon from <link> tag:
    1. If web_screenshot is enabled then get raw html data from web_screenshot
    2. If web_screenshot is not enabled, requests.get(target)
  2. Look for link tags with rel="icon" attribute. If found:
    1. r = requests.get(href_from_link)
  3. If no link tag, try to fetch default favicon
    1. r = requests.get(f"{target}/favicon.ico")
  4. If r.status_code == 200:
    1. favicon = codecs.encode(r.content, "base64")
    2. hash = mmh3.hash(favicon)

Additional context
This will provide the ability to look for hashes that you might already see in public services such as shodan, and favicons are small enough that a cryptographic hash such as md5 or sha256 would be overkill.

@0xdade 0xdade added enhancement New feature or request agent affecting natlas-agent labels Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent affecting natlas-agent enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant