Skip to main content

CLI tool to detect real file types using magic numbers, with JSON output, directory scanning, and extension mismatch detection

Project description

File Identifier

A command-line tool to detect the real file type using magic numbers (file signatures), instead of relying on file extensions.

Works even when extensions are incorrect or intentionally misleading (e.g., .pdf.exe).


Installation

pip install file-identifier

Usage

file-identifier <file_or_directory> [options]

Examples

file-identifier file.pdf
file-identifier file.pdf --json
file-identifier suspicious.pdf.exe
file-identifier ./folder
file-identifier file.zip --verbose

Features

  • Detects file types using binary signatures (magic numbers)
  • Works with incorrect or spoofed extensions
  • JSON output for automation
  • Directory scanning support
  • Verbose mode for detailed inspection
  • Fast and lightweight

Output

  • File type
  • Likely extension
  • File size
  • Confidence level
  • Hex header

How it works

The tool reads the initial bytes of a file and compares them with known magic signatures to determine its actual type.


License

MIT

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

file_identifier-1.0.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

file_identifier-1.0.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file file_identifier-1.0.0.tar.gz.

File metadata

  • Download URL: file_identifier-1.0.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for file_identifier-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5f5cabe78ec104b12671cdcd25c4b163a8125fe155a0617df5c103e321f825c4
MD5 fcb1b662f55aa963e3d58f3ba00833f6
BLAKE2b-256 77dabe03e61ad031979fa76d81f38bc1c052a7eb600b26b8df3e0dd16a68efed

See more details on using hashes here.

File details

Details for the file file_identifier-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for file_identifier-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 76f0f5db6ae7fd6e9575c95c7f1b7f94a12162fb8da61216e8a731411fa0135a
MD5 15cd2bf0cdac89dee3ad57d635618c28
BLAKE2b-256 8ea4896c463392926d58f184f95dcd5191799d96da949bd0672587bee7031c72

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