Skip to main content

An efficient tool for extracting files, directories, and alternate data streams directly from NTFS image files.

Project description

ntfsdump

LGPLv3+ License PyPI version Python Versions pytest

ntfsdump logo

An efficient tool for extracting files, directories, and alternate data streams directly from NTFS image files.

🚀 Overview

ntfsdump allows digital forensic investigators and incident responders to seamlessly extract records from disk images without needing to mount them. By leveraging powerful backend libraries like pytsk3 and libyal, it supports reading from standard disk image formats (RAW, E01, VHD(x), VMDK) and reliably dumps NTFS structures.

📦 Features

  • Direct Extraction: Avoid mounting overhead by extracting files directly from NTFS partitions.
  • Support Multiple Formats: Read from .raw, .e01, .vhd, .vhdx, and .vmdk.
  • Recursive Directory Dumping: Extract entire folders seamlessly.
  • Alternate Data Stream (ADS): Supports extracting hidden alternate data streams.
  • Intelligent Path Reconstruction: When outputting single files embedded deep in directories with an absolute path (e.g. \Windows\System32...), ntfsdump reconstructs the directory structure in the output destination folder to keep artifacts perfectly organized.
  • Glob & Wildcard Queries: Basic support for extracting matched artifacts (e.g. .*).
  • 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 ntfsdump

# Form GitHub Releases (Precompiled Binaries)
chmod +x ./ntfsdump
./ntfsdump --help

🛠️ Requirements & File Prerequisites

The image file must meet the following conditions:

  • Formats: raw, e01, vhd, vhdx, vmdk.
  • File System: NTFS.
  • Partition Table: GPT (MBR will usually be auto-detected, but GPT is officially supported).

💻 Usage

Command Line Interface

You can pass arguments directly into the CLI. Output paths can be either file paths or directory paths.

ntfsdump [OPTIONS] <IMAGE> [PATHS...]

Options:

  • --help, -h: Show help message.
  • --version, -V: Display program version.
  • --quiet, -q: Suppress stdout output.
  • --no-log: Prevent log file creation.
  • --flat: Extract all artifacts purely into a single folder without reconstructing directories.
  • --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.
  • --output, -o: Directory or file to save exported outputs.

Examples

Dump a single file:

ntfsdump -o ./dump ./path/to/your/image.raw /$MFT

Dump an entire directory recursively:

ntfsdump -o ./dump ./path/to/your/image.raw /Windows/System32/winevt/Logs

Extracting from split E01 images (Provide the starting segment .E01):

ntfsdump --format=e01 -o ./dump ./path/to/your/image.E01 /Windows/System32/winevt/Logs

Using with ntfsfind over standard input (pipe):

ntfsfind '.*\.evtx' ./image.raw | ntfsdump -o ./dump ./image.raw

Note: Any absolute path (starting with / or \) passed over stdin via tools like ntfsfind will automatically be cleaned, and the folder hierarchy will be rebuilt faithfully inside your local output directory (./dump/Windows/System32/winevt/Logs/System.evtx).

Python Module

You can incorporate ntfsdump logic into your own scripts.

from ntfsdump import ntfsdump

ntfsdump(
    image='./path/to/your/image.raw',
    paths=['/Windows/System32/winevt/Logs'],
    output='./dump',
    volume=2,
    format='raw'
)

🔍 Query Syntax

ntfsdump utilizes UNIX-like path separators (/) for queries. Paths are case-sensitive relative to the target volume structure.

  • File: /$MFT -> extracts $MFT
  • ADS: /$Extend/$UsnJrnl:$J -> extracts the $J ADS file from $UsnJrnl.
  • Directory: /Windows/System32/winevt/Logs -> extracts all event logs recursively.
  • Prefix Expansion: /Windows/Prefetch/.* -> extracts all files located in the Prefetch dir.

📝 Logs

By default, an execution log (e.g. ntfsdump_20240101_153205_1234.log) is generated in the current directory to safely record which files were successfully dumped or failed. To disable logging entirely, append the --no-log flag.

🤝 Contributing

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

📜 License

Released under the LGPLv3+ License.

Powered by:

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

ntfsdump-3.0.3.tar.gz (43.7 kB view details)

Uploaded Source

Built Distribution

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

ntfsdump-3.0.3-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

Details for the file ntfsdump-3.0.3.tar.gz.

File metadata

  • Download URL: ntfsdump-3.0.3.tar.gz
  • Upload date:
  • Size: 43.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","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 ntfsdump-3.0.3.tar.gz
Algorithm Hash digest
SHA256 d07ccc6d0c8e1a81db74701fe4206e8214e0d592349908f36d70b6ab8a54f610
MD5 6a6443fb83c9e6e307a969c0f572ce88
BLAKE2b-256 58cca7c00245599c9e52b0411277a8d7e26902010e66bf2cb024585663cafd3f

See more details on using hashes here.

File details

Details for the file ntfsdump-3.0.3-py3-none-any.whl.

File metadata

  • Download URL: ntfsdump-3.0.3-py3-none-any.whl
  • Upload date:
  • Size: 27.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","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 ntfsdump-3.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e1556d20f0706b21ffb0089e63eaaa9d1af18a61cfda39b6e83007d5205a7262
MD5 a6cfb499fae1e38c2f1d45f22d154f65
BLAKE2b-256 083188bb4d3db8e078498250f34fe931c7229622a053bff9de525b3e5daaed52

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