Skip to main content

Pixhash

PyPI version License: MIT

Pixhash is a simple Cyber Threat Intelligence (CTI) tool that extracts all images from a webpage (including those referenced in CSS), calculate their hashes, and optionally download them.

Disclaimer

Pixhash is provided solely for legitimate security research, threat intelligence, and defensive purposes. The author and contributors are not responsible for any damage, legal liability, or other consequences arising from improper or malicious use of this tool.

Installation

Install from PyPI:

pip install pixhash

Or install directly from Github:

pip install git+https://github.com/fwalbuloushi/pixhash.git

Usage

After installation, the pixhash command is available:

pixhash [OPTIONS] URL

Options

Flag Description Default
-t, --timeout <sec> Network timeout in seconds 10
--algo {sha256,sha1,md5} Hash algorithm to use sha256
-U, --user-agent <string> Custom User-Agent header for all HTTP requests Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:115.0) Gecko/20100101 Firefox/115.0
--delay <sec> Seconds to wait between each HTTP request 0
--max-images <n> Maximum number of images to process per run 500
--max-size <MB> Maximum response size per request in MB 50
--version Show the version number and exit
--download Download each image to disk and hash it (requires -o/--output-dir) disabled
-o, --output-dir <path> Directory to save images (when using --download) and/or write the timestamped log file (pixhash_YYYYMMDD_HHMMSS.txt) none

Examples

1) Basic usage with default settings. Just hash & print the results (no downloads, no log):

pixhash https://example.com

2) Hash & write a log file (no images downloaded):

pixhash https://example.com -o ./hash-logs

3) Download each image, hash it, AND write log:

pixhash https://example.com --download -o ./downloaded-images

4) Custom User-Agent:

pixhash https://example.com -U "CustomUA/1.2" --download -o ./my-images

5) Customizing everything (Spaghetti):

pixhash https://example.com -U "CustomUA/1.2" -t 4 --algo md5 --delay 3 --download -o ./Org-1

[!IMPORTANT] If your URL’s query string uses the & separator, wrap it in single quotes so your shell doesn’t treat & as the background operator.

pixhash 'https://example.com/page?foo=1&bar=2' --delay 5

Sample Log File

When you run with -o ./logs, you will get a file named like pixhash_20250519_153012.txt containing:

Pixhash Run Log
================
Target URL:    https://example.com
Date:          2025-05-19
Time:          15:30:12
Algorithm:     sha256
User-Agent:    Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:115.0) Gecko/20100101 Firefox/115.0
Output Dir:    ./logs

Results
-------
https://example.com/img/logo.png >> d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2
https://example.com/css/bg.jpg     >> a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1
https://example.com/svg/icon.svg   >> b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3

Hash results and log file saved into:
./logs

License

This project is licensed under the MIT License.

Metadata

Release files for pixhash 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pixhash 1.3.0
File Size Uploaded Provenance Actions
pixhash-1.3.0.tar.gz 14.2 kB Without provenance Details for pixhash-1.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pixhash 1.3.0
File Interpreter ABI Platform Actions
pixhash-1.3.0-py3-none-any.whl Python 3 none any Details for pixhash-1.3.0-py3-none-any.whl

Total release size: 25.7 kB

Release files / pixhash-1.3.0.tar.gz

Download URL pixhash-1.3.0.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ad9d5d12a1ff6679bfc97e339f5bc5d057335a7badd7f0b3c10dac16f086c5c2
BLAKE2b-256 checksum
How to use checksums
be661f8583d1986c6b7270f3cdd6a0ef8fd6c3b61c96e5b31258659ca6eca386
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / pixhash-1.3.0-py3-none-any.whl

Download URL pixhash-1.3.0-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
01722d337796b5bc76454415d7f395a4ad6c469ec093a0de58cc0d31a593572b
BLAKE2b-256 checksum
How to use checksums
65fb80dadd8761806bf9a44dbbb8d722187fa04acbd602db4778459d4b837ca6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Security for pixhash 1.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page