Skip to main content

CTI tool to extract and hash images from websites

Project description

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
--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.

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

pixhash-1.2.0.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pixhash-1.2.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file pixhash-1.2.0.tar.gz.

File metadata

  • Download URL: pixhash-1.2.0.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pixhash-1.2.0.tar.gz
Algorithm Hash digest
SHA256 8a086c4f813abadc8ce8dcd10be562d4a278a176acb9cbf760fdc449a1c5b03a
MD5 376362bbac61b2a621b3cc8a738b9487
BLAKE2b-256 ed6a67031efe1ec217f2d035f51bbcec95ae1c8b0b03ef815de9561c2e326266

See more details on using hashes here.

File details

Details for the file pixhash-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: pixhash-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pixhash-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 762f8477c1da5eceb0fbe309a21f960047f5167550209cd759224b168130e300
MD5 466aff238af9dab3d97c1f8612ef53bc
BLAKE2b-256 c4b3ccebd9ed4848e41505b1c5287e33042018261fd6805c45661b09f1323668

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page