Skip to content

Instantly share code, notes, and snippets.

@faisalfs10x
Last active January 3, 2024 04:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save faisalfs10x/8f36f8f89a41bd2d464ccf46a542056c to your computer and use it in GitHub Desktop.
Save faisalfs10x/8f36f8f89a41bd2d464ccf46a542056c to your computer and use it in GitHub Desktop.
Process a favicon.ico and calculate its hash based on https://twitter.com/brsn76945860/status/1171233054951501824
#!/usr/bin/python3
import mmh3
import requests
import argparse
import codecs
requests.packages.urllib3.disable_warnings()
parser = argparse.ArgumentParser(description='Process a favicon.ico and calculate its hash')
parser.add_argument('url', help='The URL path to favicon.ico')
args = parser.parse_args()
response = requests.get(args.url, verify=False, timeout=5)
favicon = codecs.encode(response.content, "base64")
hash = mmh3.hash(favicon)
print(hash)
# python3 favicon-hash.py http://site.com/img/favicon.ico
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment