HHHash library is calculate HHHash from HTTP servers.
Project description
HTTP Headers Hashing (HHHash)
HTTP Headers Hashing (HHHash) is a technique used to create a fingerprint of an HTTP server based on the headers it returns. HHHash employs one-way hashing to generate a hash value for the set of header keys returned by the server
Calculation of the HHHash
To calculate the HHHash, we concatenate the list of headers returned by the HTTP server. This list is ordered according to the sequence in which the headers appear in the server's response. Each header value is separated with :
.
The HHHash value is the SHA256 of the list.
HHHash format
hhh
:1
:20247663b5c63bf1291fe5350010dafb6d5e845e4c0daaf7dc9c0f646e947c29
prefix
:version
:SHA 256 value
Example
Calculating HHHash from a curl command
$ curl -s -D - https://www.circl.lu/ -o /dev/null | awk 'NR != 1' | cut -f1 -d: | sed '/^[[:space:]]*$/d' | sed -z 's/\n/:/g' | sed 's/.$//' | sha256sum | cut -f1 -d " " | awk {'print "hhh:1:"$1'}
Output value
hhh:1:78f7ef0651bac1a5ea42ed9d22242ed8725f07815091032a34ab4e30d3c3cefc
Python Library
In [1]: import hhhash
In [2]: hhhash.buildhash(url="https://www.misp-lea.org", debug=False)
Out[2]: 'hhh:1:adca8a87f2a537dbbf07ba6d8cba6db53fde257ae2da4dad6f3ee6b47080c53f'
In [3]: hhhash.buildhash(url="https://www.misp-project.org", debug=False)
Out[3]: 'hhh:1:adca8a87f2a537dbbf07ba6d8cba6db53fde257ae2da4dad6f3ee6b47080c53f'
In [4]: hhhash.buildhash(url="https://www.circl.lu", debug=False)
Out[4]: 'hhh:1:334d8ab68f9e935f3af7c4a91220612f980f2d9168324530c03d28c9429e1299'
In [5]:
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file hhhash-0.1.tar.gz
.
File metadata
- Download URL: hhhash-0.1.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.0 CPython/3.10.6 Linux/5.19.0-45-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e237c92556c1873826d08cc428c0e1bc7dc3e0b7fac33fc1a6fae2e602f2397 |
|
MD5 | f79749d4cbf73042d10613b8fb46a8c1 |
|
BLAKE2b-256 | 8a2122198aee1c603deaa2f9e124da6a1b4989e8a20a0f6630d16b5f7f5cc689 |
File details
Details for the file hhhash-0.1-py3-none-any.whl
.
File metadata
- Download URL: hhhash-0.1-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.0 CPython/3.10.6 Linux/5.19.0-45-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e245279a14d60c6804772b91ed9a464ee75acd3d8835b564d8a05a72ff3170db |
|
MD5 | 7ebb44ea9d2f0365db476d672ca6fa15 |
|
BLAKE2b-256 | e69da3d58225dd947b5c0df079b96a98d3db2596c3f49e8cd54e50c1a0dc05ac |