local/tools
dev / Native app / v1.0.4

File Type Detector

Detect real file types from magic bytes and flag extension/MIME mismatches, macros and polyglot files across folders.

Install

  • install
    irm https://raw.githubusercontent.com/chayprabs/localtools/main/file-type-detector/install.ps1 | iex
  • update
    localtools-file-type-detector update
  • remove
    localtools-file-type-detector uninstall

Opens at http://127.0.0.1:47101 in your browser. Run localtools-file-type-detector --help for the command line. Set LOCALTOOLS_NO_OPEN=1 to install without opening it.

Direct download

PlatformFileSize
Linux ARM64file-type-detector-1.0.4-linux-arm64.zip2.9 MB
Linux x64file-type-detector-1.0.4-linux-x64.zip3.2 MB
macOS Apple Siliconfile-type-detector-1.0.4-macos-arm64.zip3.0 MB
macOS Intelfile-type-detector-1.0.4-macos-x64.zip3.2 MB
Windows x64file-type-detector-1.0.4-windows-x64.zip3.2 MB

SHA-256 checksums are in the release notes; the install scripts verify them for you.

See it

How to use

  1. Open File Type Detector (it starts at http://127.0.0.1:47101).
  2. Drop one or more files on the page, or press "Choose a folder" to scan a whole folder.
  3. Press Scan. Risky files are listed first, with the reason for each flag.
  4. Download the results as JSON or CSV.
  5. From a terminal or CI job: localtools-file-type-detector scan <folder> --fail-on risk exits with code 2 when a risky file is found.

FAQ

How does it know the real type if the extension is wrong?

It matches about 200 content signatures with the mimetype library, then inspects ZIP and OLE containers. PDF is the primary type only when its header starts the file, optionally after a UTF-8 BOM and line breaks. An internal PDF header keeps the primary type and gets a possible-polyglot warning; this does not validate a PDF.

What counts as a risky file?

An executable disguised as a document or image, Office VBA macros, disguised runnable archive entries, a polyglot signature, double extensions such as photo.jpg.exe (including invisible padding), or right-to-left override characters. Ordinary runnable archive entries and possible internal PDF headers are warnings; scripts disguised under another extension are warnings too. Signature checks are not a malware scan or full file validation.

Can I use it in CI to block uploads?

Yes. Run localtools-file-type-detector scan <path> --fail-on risk (or --fail-on warn). It exits with code 2 when a file reaches that level, and --json or --csv gives machine-readable output.

Are my files uploaded anywhere?

No. The page talks only to the local server on 127.0.0.1, and the tool makes no network requests. Uploaded files are deleted when the request finishes.

Why not Google Magika?

Magika needs the ONNX Runtime library, which would turn a single small static binary into a large native bundle, and it is strongest at text and source-code types. The risky formats here (executables, Office containers, archives) have exact byte signatures, so signature matching is faster and explains its answer.