> For the complete documentation index, see [llms.txt](https://www.iblue.team/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.iblue.team/general-notes-1/favicon-hashing-and-hunting-with-shodan.md).

# 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}
