Skip to main content

ntfsfind

MIT License PyPI Version

ntfsfind logo

A command-line tool for efficiently searching files, directories, and alternate data streams directly from NTFS image files.

Overview

ntfsfind allows digital forensic investigators and incident responders to search NTFS file system records in disk images using regular expressions, without mounting the images. Beside regex queries, it can narrow results by file metadata such as extension, path prefix, size, timestamps, entry state (allocated/deleted, file/directory, ADS) and file attributes, and render the matches in several output formats. By leveraging powerful backend libraries, it supports common forensic image formats such as RAW, E01, VHD/VHDX, and VMDK, and reliably parses NTFS structures. It can also read a VMware VM directory, VMX or VMSD directly, including snapshots and multiple virtual disks, without converting them first.

Features

  • Direct Search: Search files directly from NTFS partitions without mounting the image.
  • Multiple Image Formats: Read RAW, E01, VHD, VHDX, and VMDK images, and automatically detects the format by signature.
  • VMware Support: Read a VMware VM directory, VMX or VMSD directly, including snapshots and multiple virtual disks.
  • Regex Queries: Search file paths with regular expressions. Partial matching is used by default, similar to grep.
  • Metadata Filtering: Narrow the search by extension, path prefix, size, timestamps, entry state (allocated/deleted, file/directory, ADS) and file attributes. Filters combine with the regex query and each other using AND.
  • Output Formats: Render matches as pipe-friendly text, JSON Lines, CSV, or a human-readable table.
  • Alternate Data Streams (ADS): Find hidden alternate data streams.
  • CLI and Python Module: Use it from the command line or integrate it into your own automation tools.

Execution Environment

  • Python: Compatible with Python 3.13+.
  • Precompiled Binaries: Available for both Windows and Linux in the GitHub releases section.

Installation

# From PyPI
pip install ntfsfind

# From GitHub Releases (Precompiled Binaries)
chmod +x ./ntfsfind
./ntfsfind --help

# On Windows
ntfsfind.exe --help

Supported Input

  • Image formats: RAW, E01, VHD, VHDX, VMDK (auto-detected), plus VMware VM directories, VMX and VMSD.
  • File system: NTFS.
  • Partition tables: GPT and MBR are both supported.

Usage

Command Line Interface

You can pass arguments directly to the CLI. Search queries are matched against normalized NTFS paths using forward slashes (/).

ntfsfind [OPTIONS] <SOURCE> [SEARCH_QUERY]

SOURCE may be an image file, a VMware VM directory, a VMX or a VMSD:

disk.raw
evidence.E01
disk.vhd
disk.vhdx
disk.vmdk
vm.vmsd
/path/to/vm/

Options:

  • --help, -h: Show help message.
  • --version, -V: Display program version.
  • --volume, -n: Target specific NTFS volume number (default: auto-detects main OS volume).
  • --image-format: Force the image format instead of auto-detection. Options: raw, e01, vhd, vhdx, vmdk.
  • --snapshot, -s: Read the NTFS as it was at the given VMware snapshot UID (see --list-snapshots).
  • --disk, -d: Read a specific VMware virtual disk by ID (see --list-disks; auto-selected when unique).
  • --list-snapshots: List VMware snapshots (ID/NAME/CREATED/PARENT) and exit.
  • --list-disks: List VMware virtual disks (ID/NODE/SIZE/VMDK) and exit.
  • --ignore-case, -i: Enable case-insensitive search.
  • --fixed-strings, -F: Interpret search query as a literal fixed string instead of a regular expression.
  • --extension, -e: Only files whose final path element extension matches one of the comma-separated values (case-insensitive; with or without a leading dot). For example -e evtx,exe or -e .evtx. For alternate data streams, the base path is judged.
  • --path: Only records whose path starts with the given prefix (case-insensitive; / and \ are normalized).
  • --size: Size filter using $FILE_NAME.logical_size (falling back to the $MFT file size). Syntax: >=10MB, <1KB, 4KB..10MB. Units B/KB/MB/GB/TB are 2-based (1KB = 1024). A bare value is an exact match.
  • --created, --modified, --accessed: Timestamp filters. Syntax: 2024-01-01..2024-12-31, >=2025-04-01, 2025-04-01T09:00... Naive timestamps are treated as UTC, and a date-only upper bound covers the whole day.
  • --timestamp-source: Which timestamps to compare: si (default, $STANDARD_INFORMATION) or fn ($FILE_NAME).
  • --deleted-only / --allocated-only: Restrict to deleted or allocated entries (mutually exclusive).
  • --files-only / --dirs-only: Restrict to files or directories (mutually exclusive).
  • --ads-only / --no-ads: Restrict to records with or without alternate data streams (mutually exclusive).
  • --attributes: Comma-separated FILE_ATTRIBUTE_* names such as hidden,system,readonly; all listed attributes must be present (AND).
  • --output-format: text (default; one path per line, pipe-friendly), json (JSON Lines), csv, or table (human-readable, sorted by entry id).
  • --multiprocess, -m: Enable multiprocessing for the operation.
  • --out-mft: Export the parsed $MFT raw bytes to the specified file path.

All filters combine with the regex search query and with each other using AND. Filters can be used without a search query (e.g. ntfsfind evidence.raw -e evtx).

Examples

Find Eventlogs:

$ ntfsfind ./path/to/your/image.raw '.*\.evtx'
/Windows/System32/winevt/Logs/Setup.evtx
/Windows/System32/winevt/Logs/Microsoft-Windows-All-User-Install-Agent%4Admin.evtx
/Logs/Windows PowerShell.evtx
/Logs/Microsoft-Windows-Winlogon%4Operational.evtx
/Logs/Microsoft-Windows-WinINet-Config%4ProxyConfigChanged.evtx
...

Find the original $MFT file and files in its path:

$ ntfsfind ./path/to/your/image.raw '\$MFT'
/$MFT
/$MFTMirr

Find alternate data streams:

$ ntfsfind ./path/to/your/image.raw '.*:.*'

Filter by metadata (extension, path, size, timestamps, entry state, attributes):

# Executables and event logs larger than 1MB, created in 2025 or later.
ntfsfind evidence.raw -e evtx,exe --size '>=1MB' --created '>=2025-01-01'

# Deleted records under System32.
ntfsfind evidence.raw --path /Windows/System32 --deleted-only

# PowerShell scripts as JSON Lines for post-processing.
ntfsfind evidence.raw '.*\.ps1' --output-format json

# Executables of 10MB or more as a human-readable table.
ntfsfind evidence.raw -e exe --size '>=10MB' --output-format table

table is intended for human review and is sorted by entry id, while text/json/csv are intended for piping and post-processing. Searching with filters alone works without a regex query (e.g. ntfsfind evidence.raw -e evtx).

Export $MFT and search it directly for faster repeated queries: A dumped $MFT file can also be used as input for faster repeated searches.

# 1. Export MFT from the image (search query can be omitted)
$ ntfsfind --out-mft /tmp/my_mft.bin ./path/to/your/image.raw

# 2. Later you can query the dumped MFT file instead of the heavy image!
$ ntfsfind /tmp/my_mft.bin '.evtx'

The image format is auto-detected by signature. Force it with --image-format when the signature is not recognizable:

$ ntfsfind evidence.E01 '.*\.evtx'
$ ntfsfind evidence.bin --image-format raw '.*\.evtx'

VMware Snapshots and Disks

ntfsfind can search a VMware VM directory, VMX or VMSD directly, including a specific snapshot and virtual disk.

List the snapshots and disks first:

$ ntfsfind ./WindowsVM --list-snapshots
ID  NAME          CREATED              PARENT
1   Initialized   2026-09-01 12:33:43  -
5   NetConnect    2026-09-02 02:25:08  1
6   PrepareTools  2026-09-10 17:46:35  5

$ ntfsfind ./WindowsVM --list-disks
ID  NODE     SIZE     VMDK
0   nvme0:0  100 GiB  Windows10_22H2(x64).vmdk
1   scsi0:1  500 GiB  Data.vmdk

Then search the NTFS as it was at a snapshot, optionally selecting a disk:

# Search snapshot 5 (auto-selects the disk when unique).
$ ntfsfind ./WindowsVM -s 5 '.*\.evtx'

# Search snapshot 5, second virtual disk.
$ ntfsfind ./WindowsVM -s 5 -d 1 '.*\.evtx'

Working with ntfsdump

When combined with ntfsdump, matching files can be dumped directly from the image via standard input. The two tools share the same piped path format, so they remain compatible even when their version numbers differ (e.g. ntfsfind 3.3.x works with ntfsdump 3.3.x).

$ ntfsfind ./path/to/imagefile.raw '.*\.evtx' | ntfsdump -o ./dump ./path/to/imagefile.raw

Piping requires the default --output-format text (one path per line). The json, csv and table formats are not valid ntfsdump input.

Python Module

You can incorporate ntfsfind logic into your own scripts.

from ntfsfind import ntfsfind

# source: Union[str, Path]
# search_query: Optional[str] = None
# volume: Optional[int] = None
# image_format: Optional[str] = None   # None = auto-detect
# snapshot: Optional[str] = None       # VMware snapshot UID
# disk: Optional[int] = None           # VMware virtual disk ID
# multiprocess: bool = False
# ignore_case: bool = False
# fixed_strings: bool = False
# out_mft: Optional[str] = None
# extension: Optional[str] = None      # comma-separated, e.g. "evtx,exe"
# path: Optional[str] = None           # path prefix filter
# size: Optional[str] = None           # e.g. ">=10MB", "4KB..10MB"
# created: Optional[str] = None        # e.g. "2025-01-01..2025-12-31"
# modified: Optional[str] = None
# accessed: Optional[str] = None
# timestamp_source: str = "si"         # "si" or "fn"
# allocated_only: bool = False
# deleted_only: bool = False
# files_only: bool = False
# dirs_only: bool = False
# ads_only: bool = False
# no_ads: bool = False
# attributes: Optional[str] = None     # comma-separated, e.g. "hidden,system"
# output_format: str = "text"          # "text", "json", "csv" or "table"
# -> List[str]

records = ntfsfind(
    source='./path/to/your/imagefile.raw',
    search_query=r".*\.evtx",
    volume=2,
    image_format=None,
    multiprocess=False,
    ignore_case=True,
    fixed_strings=False,
    out_mft='/tmp/dumped_mft.bin'
)

# VMware VM directory, snapshot and disk selection.
records = ntfsfind(
    source='./WindowsVM',
    search_query=r".*\.evtx",
    snapshot='5',
    disk=1,
)

# Metadata filtering with JSON Lines output.
records = ntfsfind(
    source='./path/to/your/imagefile.raw',
    extension='evtx,exe',
    size='>=1MB',
    created='>=2025-01-01',
    output_format='json',
)

for record in records:
    print(record)

Contributing

We welcome bug reports, issues, and feature requests. Please do so on the GitHub repository. 🍣 🍣 🍣

License

Released under the MIT License.

Powered by:

Third-party licenses

The standalone binaries distributed via GitHub Releases bundle the following third-party libraries. The libyal libraries (libewf, libvhdi, libvmdk) and pytsk3 are pulled in transitively via ntfsdump, but they are physically bundled inside the ntfsfind binary, so their notices are reproduced here as well.

LGPL-3.0-or-later

The following libyal libraries are licensed under the GNU Lesser General Public License v3.0 or later (LGPL-3.0-or-later). You may obtain, modify, and rebuild them from their upstream sources in accordance with the LGPL.

Apache-2.0

MIT

Metadata

Release files for ntfsfind 3.2.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 ntfsfind 3.2.0
File Size Uploaded
ntfsfind-3.2.0.tar.gz 61.2 kB Details

Built distribution (wheel)

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

Total release size: 81.3 kB

Release files / ntfsfind-3.2.0.tar.gz

Download URL ntfsfind-3.2.0.tar.gz
Size 61.2 kB
Tags Source
SHA-256 checksum
How to use checksums
741d3a36e10950050474fec095dbec7ca0c9dcbec701d2c43cb5a422bef2f110
BLAKE2b-256 checksum
How to use checksums
3ed361f7a0a476298219cc69f2ab3603dd80a4cd608ba4be4b1e01ca50bcd35a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / ntfsfind-3.2.0-py3-none-any.whl

Download URL ntfsfind-3.2.0-py3-none-any.whl
Size 20.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
68da8418105f16228f5aba6f8646368608137b12f278e98ddeb1e1809148b130
BLAKE2b-256 checksum
How to use checksums
94a950e251dccd6c62499708a55e3b434f3d1677ee9f5547e3c1132e9f041ceb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

3.3.1

2 release files

3.3.0

2 release files

This release

3.2.0 This release

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.3

2 release files

3.0.2

2 release files

2.5.0

2 release files

2.4.1

2 release files

2.4.0

2 release files

2.3.4

2 release files

2.3.3

2 release files

2.3.2

2 release files

2.3.0

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.0.0

2 release files

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