Skip to content

NTFS MFT

Turn a collected NTFS $MFT into a SQL forensic timeline with full paths, timestomp flags, deleted records, and data streams

Connector software
Free and open source
Service credentials
Not needed
Use with an agent

Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.

npx skills add Query-farm/vgi-skills --skill orchard

Copy this request into your coding agent to get started.

Use https://query.farm/products/orchard/connectors/mft/index.md to help me query NTFS MFT with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.

See what you can query

Example output · captured
Connector release
v0.5.0
Engine
2.0.1
VGI protocol
3.4.0
SET VARIABLE mft_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-mft/v0.2.0/data/sample.mft'));
SELECT entry, full_path, is_deleted FROM mft.main.read_mft(getvariable('mft_sample'))
Result · first 5 rows
entry full_path is_deleted
0 $MFT false
5 . false
11 Windows false
12 Windows\System32 false
20 Windows\System32\cmd.exe false

Quick start

Choose where to run NTFS MFT, then follow the steps below.

The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.

1. Install the vgi extension

Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.

setup.sql
SET allow_extension_repositories = 'allowed';

CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
    WITH PREFIX 'https://duckdb-extensions.query.farm';

INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;

2. Attach the connector

Attach the release directly

Downloads the latest release for your platform and caches it locally.

ATTACH 'mft' AS mft (
  TYPE vgi,
  LOCATION 'github-auto://Query-farm/vgi-mft'
);

3. Run a query

query.sql
SET VARIABLE mft_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-mft/v0.2.0/data/sample.mft'));
SELECT entry, full_path, is_deleted FROM mft.main.read_mft(getvariable('mft_sample'))
More example queries →
Technical details
Verified connector release
v0.5.0
Engine
2.0.1
VGI protocol
3.4.0
Verified on
December 1, 2026
Release notes on GitHub
Pin a version for production

When running the connector yourself, keep a specific release until you’re ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.

Attach the release directly

Uses the verified release each time you attach the connector.

ATTACH 'mft' AS mft (
  TYPE vgi,
  LOCATION 'github-auto://Query-farm/[email protected]'
);

Overview

Parse the NTFS $MFT into a forensic filesystem timeline: path reconstruction, the SI/FN MACB timestamp pair, timestomp detection, deleted-record recovery, and alternate data streams — straight into SQL.

Catalog

Everything mft exposes once attached — read straight from the worker's released build.

mft 1 schema
main 1 view · 8 functions

NTFS $MFT forensics: a filesystem timeline, per-record decode and validation, the timestomp heuristic, and attribute / $DATA-stream fan-out.

Schema examples (6)
Examples (6)

The headline forensic timeline: one row per FILE record with its reconstructed path and deleted flag.

SET VARIABLE mft_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-mft/v0.2.0/data/sample.mft'));
SELECT entry, full_path, is_deleted FROM mft.main.read_mft(getvariable('mft_sample'));
Result · first 5 rows
entry full_path is_deleted
0 $MFT false
5 . false
11 Windows false
12 Windows\System32 false
20 Windows\System32\cmd.exe false

Hunt for timestomped records — the SI-vs-FN heuristic exposed as a plain WHERE clause.

SET VARIABLE mft_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-mft/v0.2.0/data/sample.mft'));
SELECT full_path FROM mft.main.read_mft(getvariable('mft_sample')) WHERE is_timestomp_suspect;

Surface every alternate data stream (a classic malware hiding spot) via streams mode.

SET VARIABLE mft_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-mft/v0.2.0/data/sample.mft'));
SELECT full_path, ads_name FROM mft.main.read_mft(getvariable('mft_sample'), mode := 'streams') WHERE ads_name IS NOT NULL;

Profile the attribute makeup of a whole $MFT: feed every record entry from the read_mft timeline into attributes(), label each attribute type with its purpose from the ntfs_attribute_types reference view, and count the records and attribute instances per type.

SET VARIABLE mft_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-mft/v0.2.0/data/sample.mft'));
SELECT a.type_id, t.type_name, t.purpose, count(DISTINCT a.entry) AS records, count(*) AS instances FROM mft.main.attributes((FROM (SELECT getvariable('mft_sample') AS blob, entry FROM mft.main.read_mft(getvariable('mft_sample'))))) AS a JOIN mft.main.ntfs_attribute_types AS t ON t.type_id = a.type_id GROUP BY ALL ORDER BY a.type_id;
2 more examples

Explain each timestomp suspect in the read_mft timeline: re-score its $STANDARD_INFORMATION and $FILE_NAME MACB columns with timestomp() to list which heuristic reasons fired (the timeline itself only carries the is_timestomp_suspect flag).

SET VARIABLE mft_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-mft/v0.2.0/data/sample.mft'));
SELECT full_path, si_created, fn_created, mft.main.timestomp({'created': si_created, 'modified': si_modified, 'accessed': si_accessed, 'mft_modified': si_mft_modified}, {'created': fn_created, 'modified': fn_modified, 'accessed': fn_accessed, 'mft_modified': fn_mft_modified}).reasons AS reasons FROM mft.main.read_mft(getvariable('mft_sample')) WHERE is_timestomp_suspect ORDER BY full_path;

Pair each path in the read_mft timeline with its DOS 8.3 short name, unnesting the full $FILE_NAME list that mft_record() decodes for the entry (the timeline keeps only the primary Win32 name).

SET VARIABLE mft_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-mft/v0.2.0/data/sample.mft'));
SELECT t.full_path, f.name AS short_name FROM mft.main.read_mft(getvariable('mft_sample')) AS t, unnest(mft.main.mft_record(getvariable('mft_sample'), t.entry).fn) AS u(f) WHERE f.namespace = 'DOS' ORDER BY t.full_path;
Views
ntfs_attribute_types 2 examples3 cols

Reference registry mapping each NTFS attribute type code to its canonical name and purpose — the vocabulary behind the type_id / type_name columns of the attributes() function. A static, credential-free lookup you can browse or join.

Columns
type_id UINTEGER
The on-disk NTFS attribute type code (the same value the attributes() function reports in its `type_id` column), e.g. 128 = $DATA.
type_name VARCHAR
The canonical attribute name, e.g. $STANDARD_INFORMATION, $FILE_NAME, $DATA.
purpose VARCHAR
What the attribute stores and what it is used for in NTFS.
Examples (2)

Browse the whole NTFS attribute-type registry, lowest code first.

SELECT type_id, type_name, purpose
FROM mft.main.ntfs_attribute_types
ORDER BY type_id;

Look up the name and purpose of attribute type 128 (the $DATA attribute).

SELECT type_name, purpose
FROM mft.main.ntfs_attribute_types
WHERE type_id = 128;
Link
Scalar functions
full_path (blob BLOB, entry UBIGINT) 1 example

Reconstruct one $MFT entry's full path from parent references

Arguments
blob BLOB
The raw $MFT bytes to parse.
entry UBIGINT
The MFT record number (index) whose path to reconstruct.
ReturnsVARCHAR
Example

Reconstruct the full filesystem path of one record (entry 20) in the sample $MFT.

SELECT mft.main.full_path((SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-mft/v0.2.0/data/sample.mft')), 20) AS full_path;
Link
mft_record (blob BLOB, entry UBIGINT) 2 examples

Fully decode one $MFT record into a lossless STRUCT view

Arguments
blob BLOB
The raw $MFT bytes to parse.
entry UBIGINT
The MFT record number (index) to decode.
ReturnsSTRUCT of 12 fields
STRUCT 12 fields
  • entryUBIGINT
  • sequenceUSMALLINT
  • in_useBOOLEAN
  • is_dirBOOLEAN
  • base_refUBIGINT
  • lsnUBIGINT
  • hard_linksUSMALLINT
  • siSTRUCT
    STRUCT 6 fields
    • createdTIMESTAMP
    • modifiedTIMESTAMP
    • accessedTIMESTAMP
    • mft_modifiedTIMESTAMP
    • dos_attrUINTEGER
    • usnUBIGINT
  • fnSTRUCT[]
    STRUCT[] 10 fields
    • nameVARCHAR
    • namespaceVARCHAR
    • parent_entryUBIGINT
    • parent_seqUSMALLINT
    • createdTIMESTAMP
    • modifiedTIMESTAMP
    • accessedTIMESTAMP
    • mft_modifiedTIMESTAMP
    • logical_sizeUBIGINT
    • physical_sizeUBIGINT
  • dataSTRUCT
    STRUCT 4 fields
    • residentBOOLEAN
    • logical_sizeUBIGINT
    • physical_sizeUBIGINT
    • resident_bytesBLOB
  • adsSTRUCT[]
    STRUCT[] 3 fields
    • nameVARCHAR
    • logical_sizeUBIGINT
    • residentBOOLEAN
  • attributesSTRUCT[]
    STRUCT[] 4 fields
    • type_idUINTEGER
    • type_nameVARCHAR
    • residentBOOLEAN
    • nameVARCHAR
Examples (2)

Fully decode one sample $MFT record, exposing its primary name and how many alternate data streams it carries.

SELECT r.fn[1].name AS primary_name, len(r.ads) AS ads_count
FROM (SELECT mft.main.mft_record((SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-mft/v0.2.0/data/sample.mft')), 22) AS r);

Pair each path in the read_mft timeline with its DOS 8.3 short name, unnesting the full $FILE_NAME list that mft_record() decodes for the entry (the timeline keeps only the primary Win32 name).

SET VARIABLE mft_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-mft/v0.2.0/data/sample.mft'));
SELECT t.full_path, f.name AS short_name FROM mft.main.read_mft(getvariable('mft_sample')) AS t, unnest(mft.main.mft_record(getvariable('mft_sample'), t.entry).fn) AS u(f) WHERE f.namespace = 'DOS' ORDER BY t.full_path;
Link
record_header (blob BLOB, entry UBIGINT) 1 example

Probe one $MFT record's FILE header without decoding attributes

Arguments
blob BLOB
The raw $MFT bytes to parse.
entry UBIGINT
The MFT record number (index) to probe.
ReturnsSTRUCT of 8 fields
STRUCT 8 fields
  • signatureVARCHAR
  • sequenceUSMALLINT
  • in_useBOOLEAN
  • is_dirBOOLEAN
  • base_refUBIGINT
  • lsnUBIGINT
  • used_sizeUINTEGER
  • allocated_sizeUINTEGER
Example

Probe just the FILE-record header of one sample record (entry 12): signature, directory flag, and sequence number.

SELECT h.signature, h.is_dir, h.sequence
FROM (SELECT mft.main.record_header((SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-mft/v0.2.0/data/sample.mft')), 12) AS h);
Link
timestomp (si STRUCT of 4 fields, fn STRUCT of 4 fields) 2 examples

Score the SI-vs-FN timestomp heuristic over two MACB quads

Arguments
si STRUCT of 4 fields
The $STANDARD_INFORMATION MACB quad — its created / modified / accessed / mft_modified fields (e.g. built from the read_mft si_* columns).
STRUCT 4 fields
  • createdTIMESTAMP
  • modifiedTIMESTAMP
  • accessedTIMESTAMP
  • mft_modifiedTIMESTAMP
fn STRUCT of 4 fields
The $FILE_NAME MACB quad — its created / modified / accessed / mft_modified fields (e.g. built from the read_mft fn_* columns).
STRUCT 4 fields
  • createdTIMESTAMP
  • modifiedTIMESTAMP
  • accessedTIMESTAMP
  • mft_modifiedTIMESTAMP
ReturnsSTRUCT(suspect BOOLEAN, reasons VARCHAR[])
Examples (2)

Flag a record whose $STANDARD_INFORMATION quad predates its $FILE_NAME quad — the naturally-impossible ordering timestomping produces.

SELECT mft.main.timestomp({'created': TIMESTAMP '2009-01-01', 'modified': TIMESTAMP '2009-01-01', 'accessed': TIMESTAMP '2009-01-01', 'mft_modified': TIMESTAMP '2009-01-01'}, {'created': TIMESTAMP '2020-01-01', 'modified': TIMESTAMP '2020-01-01', 'accessed': TIMESTAMP '2020-01-01', 'mft_modified': TIMESTAMP '2020-01-01'}).suspect AS suspect;

Explain each timestomp suspect in the read_mft timeline: re-score its $STANDARD_INFORMATION and $FILE_NAME MACB columns with timestomp() to list which heuristic reasons fired (the timeline itself only carries the is_timestomp_suspect flag).

SET VARIABLE mft_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-mft/v0.2.0/data/sample.mft'));
SELECT full_path, si_created, fn_created, mft.main.timestomp({'created': si_created, 'modified': si_modified, 'accessed': si_accessed, 'mft_modified': si_mft_modified}, {'created': fn_created, 'modified': fn_modified, 'accessed': fn_accessed, 'mft_modified': fn_mft_modified}).reasons AS reasons FROM mft.main.read_mft(getvariable('mft_sample')) WHERE is_timestomp_suspect ORDER BY full_path;
Link
well_formed (blob BLOB, entry UBIGINT) 1 example

Validate one $MFT record; never panics on corrupt input

Arguments
blob BLOB
The raw $MFT bytes to parse.
entry UBIGINT
The MFT record number (index) to validate.
ReturnsSTRUCT(ok BOOLEAN, "error" VARCHAR, kind VARCHAR)
Example

Validate one sample record (entry 20) — a clean record reports ok = true with kind 'ok'.

SELECT w.ok, w.kind
FROM (SELECT mft.main.well_formed((SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-mft/v0.2.0/data/sample.mft')), 20) AS w);
Link
Table functions
read_mft (glob_or_blob ANY, host := VARCHAR, mode := VARCHAR) 3 examples

Parse a collected NTFS $MFT into a forensic filesystem timeline

Positional arguments
glob_or_blob ANY
The $MFT source. Either a filesystem path to one collected $MFT file (for example a path like '/cases/IR-2026/host01/$MFT') or a shell-style glob that expands to many collected files scanned in sorted order (a pattern such as '/cases/*/$MFT'); or the raw $MFT bytes supplied inline as a literal BLOB, e.g. from read_blob(...).content. This is a free-form path/pattern/BLOB, not a fixed vocabulary.
Named arguments
host := VARCHAR
Collection scope: supply the source host id so paths and parents do not collide across hosts, and to populate the `host` column. When omitted it defaults to the source filename (or NULL for an inline BLOB).
mode := VARCHAR
Emission mode. 'files' emits one row per record using the primary stream (the default); 'streams' emits one row per $DATA stream, the primary plus each ADS, each independently joinable; 'allocated' emits live/undeleted files only. · default "files"
Returns columns
host VARCHAR
Collection scope — the source host id supplied via `host :=` (or derived from `filename` under a glob); keeps paths and parents from colliding across hosts.
entry UBIGINT
MFT record number (index into the table).
sequence USMALLINT
Record sequence (reuse counter); with `entry` forms the file reference.
parent_entry UBIGINT
Parent directory's MFT entry, from the primary $FILE_NAME.
full_path VARCHAR
Reconstructed path; `\$Orphan\…` / `\$Cycle\…` when unresolved.
file_name VARCHAR
Primary (Win32) name component.
is_dir BOOLEAN
Header DIRECTORY flag (0x02).
is_allocated BOOLEAN
Header IN_USE flag (0x01) set — a live file.
is_deleted BOOLEAN
NOT is_allocated — resident but slot freed (recoverable artifact).
si_created TIMESTAMP
$STANDARD_INFORMATION Born (created).
si_modified TIMESTAMP
$STANDARD_INFORMATION Modified.
si_accessed TIMESTAMP
$STANDARD_INFORMATION Accessed.
si_mft_modified TIMESTAMP
$STANDARD_INFORMATION Changed (MFT-modified).
fn_created TIMESTAMP
$FILE_NAME Born (created).
fn_modified TIMESTAMP
$FILE_NAME Modified.
fn_accessed TIMESTAMP
$FILE_NAME Accessed.
fn_mft_modified TIMESTAMP
$FILE_NAME Changed (MFT-modified).
logical_size UBIGINT
Actual data size (unnamed $DATA logical length).
physical_size UBIGINT
Allocated/on-disk size (cluster-rounded).
hard_link_count USMALLINT
Header hard-link count; >1 ⇒ multiple names/links.
dos_attributes UINTEGER
SI DOS file-attribute bitmask (hidden/system/readonly/…).
ads_name VARCHAR
Name of a non-default $DATA stream (ADS); NULL for the primary stream.
resident_data BLOB
Inline content when the unnamed $DATA is resident; NULL if non-resident.
is_timestomp_suspect BOOLEAN
Convenience flag = timestomp(si, fn).suspect (§A.6).
diagnostics VARCHAR
NULL on a clean parse; else fixup-mismatch, baad, orphan-parent, cycle, attr-overflow, attr-overrun, truncated, decode-error:<detail>.
Examples (3)
SET VARIABLE mft_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-mft/v0.2.0/data/sample.mft'));
SELECT entry, full_path, is_deleted FROM mft.main.read_mft(getvariable('mft_sample')) ORDER BY entry;
SET VARIABLE mft_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-mft/v0.2.0/data/sample.mft'));
SELECT full_path FROM mft.main.read_mft(getvariable('mft_sample')) WHERE is_timestomp_suspect ORDER BY full_path;
SET VARIABLE mft_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-mft/v0.2.0/data/sample.mft'));
SELECT full_path, ads_name FROM mft.main.read_mft(getvariable('mft_sample'), mode := 'streams') WHERE ads_name IS NOT NULL ORDER BY full_path;
Link
Table in-out functions
attributes (relation TABLE) 3 examples

Fan each MFT record's attributes into rows (relation in/out)

Arguments
relation TABLE
A relation carrying a `blob` column of $MFT bytes and an `entry` column of record indexes to expand.
Returns columns
entry UBIGINT
MFT record number this attribute belongs to.
attribute_id USMALLINT
The attribute instance id within the record.
type_id UINTEGER
NTFS attribute type code (e.g. 0x10, 0x30, 0x80).
type_name VARCHAR
Canonical attribute name (e.g. $STANDARD_INFORMATION, $FILE_NAME, $DATA).
resident BOOLEAN
Whether the attribute value is stored inside the record (resident).
name VARCHAR
The attribute name (e.g. an ADS name); NULL when unnamed.
logical_size UBIGINT
The attribute's logical (data) size in bytes.
physical_size UBIGINT
The attribute's allocated/on-disk size in bytes.
flags UINTEGER
Attribute data flags (compressed/encrypted/sparse bits).
Examples (3)

List every attribute (type, residency, ADS name, size) of one sample $MFT record.

SELECT entry, type_name, resident, name, logical_size
FROM mft.main.attributes((FROM (SELECT content AS blob, 22::UBIGINT AS entry FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-mft/v0.2.0/data/sample.mft'))));

Profile the attribute makeup of a whole $MFT: feed every record entry from the read_mft timeline into attributes(), label each attribute type with its purpose from the ntfs_attribute_types reference view, and count the records and attribute instances per type.

SET VARIABLE mft_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-mft/v0.2.0/data/sample.mft'));
SELECT a.type_id, t.type_name, t.purpose, count(DISTINCT a.entry) AS records, count(*) AS instances FROM mft.main.attributes((FROM (SELECT getvariable('mft_sample') AS blob, entry FROM mft.main.read_mft(getvariable('mft_sample'))))) AS a JOIN mft.main.ntfs_attribute_types AS t ON t.type_id = a.type_id GROUP BY ALL ORDER BY a.type_id;
SELECT type_name, resident, name, logical_size
FROM mft.main.attributes((FROM (SELECT content AS blob, 22::UBIGINT AS entry FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-mft/v0.2.0/data/sample.mft'))))
ORDER BY attribute_id;
Link
streams (relation TABLE) 2 examples

Fan each MFT record's $DATA streams into rows (relation in/out)

Arguments
relation TABLE
A relation carrying a `blob` column of $MFT bytes and an `entry` column of record indexes to expand.
Returns columns
entry UBIGINT
MFT record number this $DATA stream belongs to.
name VARCHAR
Stream name: NULL for the primary unnamed $DATA, set for an ADS.
logical_size UBIGINT
The stream's logical (data) size in bytes.
physical_size UBIGINT
The stream's allocated/on-disk size in bytes.
resident BOOLEAN
Whether the stream's bytes are stored inside the record (resident).
data BLOB
The resident stream bytes when resident; NULL when non-resident.
Examples (2)

List the $DATA streams (primary + each ADS) of one sample $MFT record.

SELECT entry, name, logical_size, resident
FROM mft.main.streams((FROM (SELECT content AS blob, 22::UBIGINT AS entry FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-mft/v0.2.0/data/sample.mft'))));
SELECT name, logical_size, resident
FROM mft.main.streams((FROM (SELECT content AS blob, 22::UBIGINT AS entry FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-mft/v0.2.0/data/sample.mft'))))
ORDER BY name NULLS FIRST;
Link

Try these queries

Hunt for timestomped records — the SI-vs-FN heuristic exposed as a plain WHERE clause.

SET VARIABLE mft_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-mft/v0.2.0/data/sample.mft'));
SELECT full_path FROM mft.main.read_mft(getvariable('mft_sample')) WHERE is_timestomp_suspect

Uses read_mft

Profile the attribute makeup of a whole $MFT: feed every record entry from the read_mft timeline into attributes(), label each attribute type with its purpose from the ntfs_attribute_types reference view, and count the records and attribute instances per type.

SET VARIABLE mft_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-mft/v0.2.0/data/sample.mft'));
SELECT a.type_id, t.type_name, t.purpose, count(DISTINCT a.entry) AS records, count(*) AS instances FROM mft.main.attributes((FROM (SELECT getvariable('mft_sample') AS blob, entry FROM mft.main.read_mft(getvariable('mft_sample'))))) AS a JOIN mft.main.ntfs_attribute_types AS t ON t.type_id = a.type_id GROUP BY ALL ORDER BY a.type_id

Uses attributesread_mftntfs_attribute_types

Explain each timestomp suspect in the read_mft timeline: re-score its $STANDARD_INFORMATION and $FILE_NAME MACB columns with timestomp() to list which heuristic reasons fired (the timeline itself only carries the is_timestomp_suspect flag).

SET VARIABLE mft_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-mft/v0.2.0/data/sample.mft'));
SELECT full_path, si_created, fn_created, mft.main.timestomp({'created': si_created, 'modified': si_modified, 'accessed': si_accessed, 'mft_modified': si_mft_modified}, {'created': fn_created, 'modified': fn_modified, 'accessed': fn_accessed, 'mft_modified': fn_mft_modified}).reasons AS reasons FROM mft.main.read_mft(getvariable('mft_sample')) WHERE is_timestomp_suspect ORDER BY full_path

Uses timestompread_mft

Browse the whole NTFS attribute-type registry, lowest code first.

SELECT type_id, type_name, purpose
FROM mft.main.ntfs_attribute_types
ORDER BY type_id

Uses ntfs_attribute_types

List the $DATA streams (primary + each ADS) of one sample $MFT record.

SELECT entry, name, logical_size, resident
FROM mft.main.streams((FROM (SELECT content AS blob, 22::UBIGINT AS entry FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-mft/v0.2.0/data/sample.mft'))))

Uses streams

Probe just the FILE-record header of one sample record (entry 12): signature, directory flag, and sequence number.

SELECT h.signature, h.is_dir, h.sequence
FROM (SELECT mft.main.record_header((SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-mft/v0.2.0/data/sample.mft')), 12) AS h)

Uses record_header

13 more examples in the Catalog, each listed under the table or function it uses.

NTFS MFT is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.