File Type Detector
Detect real file types from magic bytes and flag extension/MIME mismatches, macros and polyglot files across folders.
Install
irm https://raw.githubusercontent.com/chayprabs/localtools/main/file-type-detector/install.ps1 | iexlocaltools-file-type-detector updatelocaltools-file-type-detector uninstall
curl -fsSL https://raw.githubusercontent.com/chayprabs/localtools/main/file-type-detector/install.sh | bashlocaltools-file-type-detector updatelocaltools-file-type-detector uninstall
brew install chayprabs/localtools/localtools-file-type-detectorbrew upgrade localtools-file-type-detectorbrew uninstall localtools-file-type-detector
scoop bucket add localtools https://github.com/chayprabs/homebrew-localtools; scoop install localtools-file-type-detectorscoop update localtools-file-type-detectorscoop uninstall localtools-file-type-detector
winget install localtools.FileTypeDetectorwinget upgrade localtools.FileTypeDetectorwinget uninstall localtools.FileTypeDetector
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
| Platform | File | Size |
|---|---|---|
| Linux ARM64 | file-type-detector-1.0.4-linux-arm64.zip | 2.9 MB |
| Linux x64 | file-type-detector-1.0.4-linux-x64.zip | 3.2 MB |
| macOS Apple Silicon | file-type-detector-1.0.4-macos-arm64.zip | 3.0 MB |
| macOS Intel | file-type-detector-1.0.4-macos-x64.zip | 3.2 MB |
| Windows x64 | file-type-detector-1.0.4-windows-x64.zip | 3.2 MB |
SHA-256 checksums are in the release notes; the install scripts verify them for you.
See it
How to use
- Open File Type Detector (it starts at http://127.0.0.1:47101).
- Drop one or more files on the page, or press "Choose a folder" to scan a whole folder.
- Press Scan. Risky files are listed first, with the reason for each flag.
- Download the results as JSON or CSV.
- 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.