diff options
author | Timo Trinks <ttrinks@fedoraproject.org> | 2023-06-01 15:00:41 +1000 |
---|---|---|
committer | Timo Trinks <ttrinks@fedoraproject.org> | 2023-06-01 15:00:41 +1000 |
commit | 249cf305ef87c29d8cf9ce47f72be8d64da68f7c (patch) | |
tree | 69a3e99a8b2e3f18977fb51da94da05c9d05d3dd | |
parent | 80c31462a3ebcc136f5b589483dd8fd5cc7ccec8 (diff) | |
download | containers-249cf305ef87c29d8cf9ce47f72be8d64da68f7c.tar.gz containers-249cf305ef87c29d8cf9ce47f72be8d64da68f7c.tar.xz containers-249cf305ef87c29d8cf9ce47f72be8d64da68f7c.zip |
- add script to calc mmh3 favicon hashes
Signed-off-by: Timo Trinks <ttrinks@fedoraproject.org>
-rw-r--r-- | shodan/Dockerfile | 3 | ||||
-rw-r--r-- | shodan/README.md | 4 | ||||
-rw-r--r-- | shodan/icon.py | 12 |
3 files changed, 18 insertions, 1 deletions
diff --git a/shodan/Dockerfile b/shodan/Dockerfile index 12a87c4..d26eb35 100644 --- a/shodan/Dockerfile +++ b/shodan/Dockerfile @@ -4,8 +4,11 @@ LABEL maintainer="Timo Trinks" RUN dnf upgrade -y --refresh RUN dnf install -y git curl yara wget tar pip bind-utils whois RUN dnf clean all +RUN pip install mmh3 RUN pip install -U --user shodan +COPY icon.py /usr/local/bin/icon.py +RUN ["chmod", "0755", "/usr/local/bin/icon.py"] COPY shodaninit.sh /usr/local/bin/shodaninit.sh RUN ["chmod", "0755", "/usr/local/bin/shodaninit.sh"] ENTRYPOINT ["/usr/local/bin/shodaninit.sh"] diff --git a/shodan/README.md b/shodan/README.md index dd65a0c..496c9d1 100644 --- a/shodan/README.md +++ b/shodan/README.md @@ -23,7 +23,7 @@ Building: ``` cd shodan -buildah bud -t shodan . +buildah bud -t shodan . && podman image prune -f ``` Running: @@ -31,6 +31,8 @@ Running: podman run -it --secret source=shodanapikey,type=env --rm shodan ``` +Another tool that comes with it is icon.py to murmur hash a website's favourite icon. + License ------- diff --git a/shodan/icon.py b/shodan/icon.py new file mode 100644 index 0000000..0bebab6 --- /dev/null +++ b/shodan/icon.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" mmh3 favicon hash """ + +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) |