ひよこメモ

自分が調べたこととか試したこととか書いていきます

NTFSのトンネリングとLocalFileMove(前編)

はじめに

こんにちは、iria_piyo🐣です。

削除済みのファイル名と同じファイル名でファイルを作成したら、$SIの作成時間が引き継がれたため、 LocalFileMoveで検証してみることにしました。

環境

Windows10 バージョン1803

検証内容

/test01/pomu_test01.txtを削除し、15秒以内に/test01/test02/pomu_test01.txtを/test01に移動すると削除されたpomu_test01.txtの作成時間が引き継がれるのか。

f:id:iria_piyo:20180921194852p:plain
ディレクトリ構成

/test01/pomu_test01.txtのタイムスタンプ

>istat \\.\C: 58652-128-1
MFT Entry Header Values:
Entry: 58652        Sequence: 46
$LogFile Sequence Number: 75722774793
Allocated File
Links: 2

$STANDARD_INFORMATION Attribute Values:
Flags: Archive
Owner ID: 0
Security ID: 3318  (S-1-5-21-3763767945-1047358448-4033639875-8282)
Last User Journal Update Sequence Number: 16328365728
Created:        2018-09-21 18:03:06.764304200 (
File Modified:   2018-09-21 18:03:06.765301300 (
MFT Modified: 2018-09-21 18:03:15.946931800 (
Accessed:        2018-09-21 18:03:06.764304200 (
$FILE_NAME Attribute Values:
Flags: Archive
Name: POMU_T~1.TXT
Parent MFT Entry: 21923         Sequence: 245
Allocated Size: 0       Actual Size: 0
Created:        2018-09-21 18:03:06.764304200 (
File Modified:   2018-09-21 18:03:06.765301300 (
MFT Modified: 2018-09-21 18:03:06.765301300 (
Accessed:        2018-09-21 18:03:06.764304200 (
$FILE_NAME Attribute Values:
Flags: Archive
Name: pomu_test01.txt
Parent MFT Entry: 21923         Sequence: 245
Allocated Size: 0       Actual Size: 0
Created:        2018-09-21 18:03:06.764304200 (
File Modified:   2018-09-21 18:03:06.765301300 (
MFT Modified: 2018-09-21 18:03:06.765301300 (
Accessed:        2018-09-21 18:03:06.764304200 (
$OBJECT_ID Attribute Values:
Object Id: d1c03db5-bd7a-11e8-84da-a81374942b83

Attributes:
Type: $STANDARD_INFORMATION (16-0)   Name: N/A   Resident   size: 72
Type: $FILE_NAME (48-5)   Name: N/A   Resident   size: 90
Type: $FILE_NAME (48-4)   Name: N/A   Resident   size: 96
Type: $OBJECT_ID (64-6)   Name: N/A   Resident   size: 16
Type: $DATA (128-1)   Name: N/A   Resident   size: 0

/test02/pomu_test01.txtのタイムスタンプ

>istat \\.\C: 17067-128-1
MFT Entry Header Values:
Entry: 17067        Sequence: 96
$LogFile Sequence Number: 75722783398
Allocated File
Links: 2

$STANDARD_INFORMATION Attribute Values:
Flags: Archive
Owner ID: 0
Security ID: 3318  (S-1-5-21-3763767945-1047358448-4033639875-8282)
Last User Journal Update Sequence Number: 16328369760
Created:        2018-09-21 18:03:24.405986700 (
File Modified:   2018-09-21 18:03:24.405986700 (
MFT Modified: 2018-09-21 18:03:29.739141900 (
Accessed:        2018-09-21 18:03:24.405986700 (
$FILE_NAME Attribute Values:
Flags: Archive
Name: POMU_T~1.TXT
Parent MFT Entry: 434092        Sequence: 31
Allocated Size: 0       Actual Size: 0
Created:        2018-09-21 18:03:24.405986700 (
File Modified:   2018-09-21 18:03:24.405986700 (
MFT Modified: 2018-09-21 18:03:24.405986700 (
Accessed:        2018-09-21 18:03:24.405986700 (
$FILE_NAME Attribute Values:
Flags: Archive
Name: pomu_test01.txt
Parent MFT Entry: 434092        Sequence: 31
Allocated Size: 0       Actual Size: 0
Created:        2018-09-21 18:03:24.405986700 (
File Modified:   2018-09-21 18:03:24.405986700 (
MFT Modified: 2018-09-21 18:03:24.405986700 (
Accessed:        2018-09-21 18:03:24.405986700 (
$OBJECT_ID Attribute Values:
Object Id: d1c03dbe-bd7a-11e8-84da-a81374942b83

Attributes:
Type: $STANDARD_INFORMATION (16-0)   Name: N/A   Resident   size: 72
Type: $FILE_NAME (48-5)   Name: N/A   Resident   size: 90
Type: $FILE_NAME (48-4)   Name: N/A   Resident   size: 96
Type: $OBJECT_ID (64-6)   Name: N/A   Resident   size: 16
Type: $DATA (128-1)   Name: N/A   Resident   size: 0

ファイル削除後/test01/test02から/test01へ移動したpomu_test01.txtのタイムスタンプ

>istat \\.\C: 17067-128-1
MFT Entry Header Values:
Entry: 17067        Sequence: 96
$LogFile Sequence Number: 75723187786
Allocated File
Links: 2

$STANDARD_INFORMATION Attribute Values:
Flags: Archive
Owner ID: 0
Security ID: 3318  (S-1-5-21-3763767945-1047358448-4033639875-8282)
Last User Journal Update Sequence Number: 16328487328
Created:        2018-09-21 18:03:06.764304200 (
File Modified:   2018-09-21 18:03:24.405986700 (
MFT Modified: 2018-09-21 18:15:43.299740200 (
Accessed:        2018-09-21 18:03:24.405986700 (
$FILE_NAME Attribute Values:
Flags: Archive
Name: POMU_T~1.TXT
Parent MFT Entry: 21923         Sequence: 245
Allocated Size: 0       Actual Size: 0
Created:        2018-09-21 18:03:24.405986700 
(File Modified:   2018-09-21 18:03:24.405986700 (
MFT Modified: 2018-09-21 18:03:29.739141900 (
Accessed:        2018-09-21 18:03:24.405986700 (
$FILE_NAME Attribute Values:
Flags: Archive
Name: pomu_test01.txt
Parent MFT Entry: 21923         Sequence: 245
Allocated Size: 0       Actual Size: 0
Created:        2018-09-21 18:03:24.405986700 (
File Modified:   2018-09-21 18:03:24.405986700 (
MFT Modified: 2018-09-21 18:03:29.739141900 (
Accessed:        2018-09-21 18:03:24.405986700 (
$OBJECT_ID Attribute Values:
Object Id: d1c03dbe-bd7a-11e8-84da-a81374942b83

Attributes:
Type: $STANDARD_INFORMATION (16-0)   Name: N/A   Resident   size: 72
Type: $FILE_NAME (48-8)   Name: N/A   Resident   size: 90
Type: $FILE_NAME (48-7)   Name: N/A   Resident   size: 96
Type: $OBJECT_ID (64-6)   Name: N/A   Resident   size: 16
Type: $DATA (128-1)   Name: N/A   Resident   size: 0

結果

ファイルの作成時間が引き継がれました。
この動きには、NTFS/FATのトンネリング*1が関係しているようです。
ファイル名で判断しているから、その前の動きは特に関係ないのかな。
ちょっと気になることができて、検証したいことが増えたから前編にしました。
すぐに後編も出します。

参考資料

A Fistful of Dongles: Microsoft Windows File System Tunneling

*1:ファイルがディレクトリから削除またはリネームされると、SFN/LFNと作成時間が短時間(デフォルトで15秒間)キャッシュに保存されます。このキャッシュは、ディレクトリごとに分けられています。 削除されたファイル名がキーとなり、新しいファイルがディレクトリに追加されると、キャッシュを検索し、復元できる情報があるか確認されます。 ディレクトリが削除されてしまうと、そのディレクトリのキャッシュも削除されてしまいます。