Skip to main content

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

Project description

ntfsfind

MIT License PyPI version Python Versions

ntfsfind logo

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

Overview

ntfsfind allows digital forensic investigators and incident responders to seamlessly search for records from disk images using regular expressions without needing to mount them. By leveraging powerful backend libraries, it supports reading from standard disk image formats (RAW, E01, VHD(x), VMDK) and reliably parses NTFS structures.

Features

  • Direct Search: Avoid mounting overhead by searching files directly from NTFS partitions.
  • Multiple Image Formats: Read from RAW, E01, VHD, VHDX, and VMDK images.
  • Regex Queries: Search file paths with regular expressions. Partial matching is used by default, similar to grep.
  • Alternate Data Stream (ADS): Supports finding hidden alternate data streams.
  • Use as a CLI or Python Module: Highly flexible to integrate into other automated 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

# execution via bat on Windows
ntfsfind.exe --help

Supported Input

  • Image formats: RAW, E01, VHD, VHDX, VMDK
  • File system: NTFS
  • Partition tables: GPT is supported; MBR may be auto-detected depending on the image

Usage

Command Line Interface

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

ntfsfind [OPTIONS] <IMAGE> [SEARCH_QUERY]

Options:

  • --help, -h: Show help message.
  • --version, -V: Display program version.
  • --volume, -n: Target specific NTFS volume number (default: auto-detects main OS volume).
  • --format, -f: Image file format (default: raw). Options: raw, e01, vhd, vhdx, vmdk.
  • --ignore-case, -i: Enable case-insensitive search.
  • --fixed-strings, -F: Interpret search query as a literal fixed string instead of a regular expression.
  • --multiprocess, -m: Enable multiprocessing for the operation.
  • --out-mft: Export the parsed $MFT raw bytes to the specified file path.

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 '.*:.*'

Export MFT and search directly from it (faster caching): A dumped $MFT file can also be used as the input image 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'

Working with ntfsdump

When combined with ntfsdump, the retrieved files can be directly dumped from the image file over standard input (pipe). ntfsfind and ntfsdump are compatible if they share the same major and minor versions (e.g. they can be used together if both are version 3.0.x).

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

Python Module

You can incorporate ntfsfind logic into your own scripts.

from ntfsfind import ntfsfind

# image: str
# search_query: str
# volume: Optional[int] = None
# format: Literal['raw', 'e01', 'vhd', 'vhdx', 'vmdk'] = 'raw'
# multiprocess: bool = False
# ignore_case: bool = False
# fixed_strings: bool = False
# out_mft: Optional[str] = None
#
# -> List[str]

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

for record in records:
    print(record)

Contributing

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

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

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

ntfsfind-3.1.0.tar.gz (34.8 kB view details)

Uploaded Source

Built Distribution

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

ntfsfind-3.1.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file ntfsfind-3.1.0.tar.gz.

File metadata

  • Download URL: ntfsfind-3.1.0.tar.gz
  • Upload date:
  • Size: 34.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.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}

File hashes

Hashes for ntfsfind-3.1.0.tar.gz
Algorithm Hash digest
SHA256 c78a6f5a5674d72e1a8ce31d47460cebdf0dee74231bab5fd778e12c121869a6
MD5 75e7261e74aacf3dbfb6164d731cb8cc
BLAKE2b-256 00ea690360dda4a643b677cd18dab8f0f83af5532d6174d1aeb09972e45bb6a2

See more details on using hashes here.

File details

Details for the file ntfsfind-3.1.0-py3-none-any.whl.

File metadata

  • Download URL: ntfsfind-3.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.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}

File hashes

Hashes for ntfsfind-3.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a9ee876845a94b7505d76d6d7818e87783c7c4148e495e79b6b28f84fb7b35f6
MD5 2339a7a2a72c2c8b23b4b7165a18e760
BLAKE2b-256 9f05f32e490adf8f95c2ca41c35d20b889c9b01c92c4787f8042c5d7cff34eb7

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