summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--shodan/icon.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/shodan/icon.py b/shodan/icon.py
index 0bebab6..040702b 100644
--- a/shodan/icon.py
+++ b/shodan/icon.py
@@ -1,12 +1,16 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" mmh3 favicon hash """
-
-import mmh3
-import requests
+
import codecs
-
-response = requests.get('https://domain.com/favicon.ico')
+import requests
+import mmh3
+
+print('Please enter the favicon site to hash (e.g. www.google.com): ')
+fav = input()
+URL = "https://"+f"{fav}"+"/favicon.ico"
+print('The hash for ' + str(URL) + ' is: ')
+response = requests.get(URL, data=None, headers={'User-Agent': 'Mozilla/5.0 (X11; Linux; rv:113.0) Gecko/20100101 Firefox/113.0'}, timeout=10)
favicon = codecs.encode(response.content,"base64")
-hash = mmh3.hash(favicon)
-print(hash)
+favhash = mmh3.hash(favicon)
+print(favhash)