# Favicon hashing and hunting with Shodan

Use the following python script/s to pull a website's favourite icon and hash it using MurmurHash3.

Shodan uses mmh3 to hash favicons and these are indexed during their periodic crawls.

```
-----------------------------
# python 2
import mmh3
import requests
 
response = requests.get('https://domain.com/favicon.ico')
favicon = response.content.encode('base64')
hash = mmh3.hash(favicon)
print hash

-----------------------------

# python 3

import mmh3
import requests
import codecs
 
response = requests.get('https://domain.com/favicon.ico')
favicon = codecs.encode(response.content,"base64")
hash = mmh3.hash(favicon)
print(hash)
```

Shodan search query;

http.favicon.hash:{hash}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.iblue.team/general-notes-1/favicon-hashing-and-hunting-with-shodan.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
