ひよこメモ

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

NTFSのトンネリングとFileRecovery

はじめに

こんにちは、iria_piyo🐣です。

今回は削除ファイルとファイルシステムのトンネリング*1の影響を受けていない)同名のファイルが存在する状況で、ファイルを削除した際、削除ファイルを復元するとタイムスタンプはどうなるのか検証してみることにしました。 復元に使用したツールはFTK Imagerです。

環境

Windows10 バージョン1803

検証内容

削除ファイル/test01/test01.txtと/test01/test01.txtがある状態で/test01/test01.txtを削除し、キャッシュに保存させる。 その後、キャッシュが消えるまで(15秒以内)に削除ファイルの/test01/test01.txtを/test01に復元すると作成時間は引き継がれるのか。

削除ファイルの/test01/test01.txt

>istat \\.\C: 291605-128-1
MFT Entry Header Values:
Entry: 291605        Sequence: 31
$LogFile Sequence Number: 85061196630
Not Allocated File
Links: 1

$STANDARD_INFORMATION Attribute Values:
Flags: Archive
Owner ID: 0
Security ID: 3669  (S-1-5-21-3763767945-1047358448-4033639875-8282)
Last User Journal Update Sequence Number: 17795086768
Created:        2018-09-30 01:23:31.588880700 (  
File Modified:   2018-09-30 01:23:31.589477300 (  
MFT Modified:    2018-09-30 01:23:33.356222400 (  
Accessed:     2018-09-30 01:23:31.588880700 (  
$FILE_NAME Attribute Values:
Flags: Archive
Name: test01.txt
Parent MFT Entry: 454284        Sequence: 269
Allocated Size: 0       Actual Size: 0
Created:        2018-09-30 01:23:31.588880700 (  
File Modified:   2018-09-30 01:23:31.589477300 (  
MFT Modified:    2018-09-30 01:23:31.589477300 (  
Accessed:     2018-09-30 01:23:31.588880700 (  
$OBJECT_ID Attribute Values:
Object Id: 38d9f439-c2f8-11e8-84e0-a81374942b83

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

/test01/test01.txt(キャッシュに保存させるファイル)

>istat \\.\C: 255230-128-1
MFT Entry Header Values:
Entry: 255230        Sequence: 251
$LogFile Sequence Number: 85063071559
Allocated File
Links: 1

$STANDARD_INFORMATION Attribute Values:
Flags: Archive
Owner ID: 0
Security ID: 3669  (S-1-5-21-3763767945-1047358448-4033639875-8282)
Last User Journal Update Sequence Number: 18057391744
Created:        2018-10-03 14:08:39.408589900 (  
File Modified:   2018-10-03 14:08:39.408589900 (  
MFT Modified:    2018-10-03 14:08:41.824790900 (  
Accessed:     2018-10-03 14:08:39.408589900 (  
$FILE_NAME Attribute Values:
Flags: Archive
Name: test01.txt
Parent MFT Entry: 454284        Sequence: 269
Allocated Size: 0       Actual Size: 0
Created:        2018-10-03 14:08:39.408589900 (  
File Modified:   2018-10-03 14:08:39.408589900 (  
MFT Modified:    2018-10-03 14:08:39.408589900 (  
Accessed:     2018-10-03 14:08:39.408589900 (  
$OBJECT_ID Attribute Values:
Object Id: 7dc85748-c64f-11e8-84e1-a81374942b83

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

ファイルの削除後、キャッシュが残っている時間内(デフォルトで15秒以内)に 最初の削除ファイルの/test01/test01.txtを復元します。

削除ファイル/test01/test01.txtの復元後(トンネリングの影響あり)

>istat \\.\C: 255056-128-2
MFT Entry Header Values:
Entry: 255056        Sequence: 20
$LogFile Sequence Number: 85063520070
Allocated File
Links: 1

$STANDARD_INFORMATION Attribute Values:
Flags: Archive
Owner ID: 0
Security ID: 6172  (S-1-5-32-544)
Last User Journal Update Sequence Number: 18057633792
Created:        2018-09-30 01:23:31.000000000 (  
File Modified:   2018-09-30 01:23:31.000000000 (  
MFT Modified:    2018-10-03 14:19:03.729618200 (  
Accessed:     2018-09-30 01:23:31.000000000 (  
$FILE_NAME Attribute Values:
Flags: Archive
Name: test01.txt
Parent MFT Entry: 454284        Sequence: 269
Allocated Size: 0       Actual Size: 0
Created:        2018-10-03 14:08:39.408589900 (  
File Modified:   2018-10-03 14:19:03.729618200 (  
MFT Modified:    2018-10-03 14:19:03.729618200 (  
Accessed:     2018-10-03 14:19:03.729618200 (  
$OBJECT_ID Attribute Values:
Object Id: 7dc85748-c64f-11e8-84e1-a81374942b83

Attributes:
Type: $STANDARD_INFORMATION (16-1)   Name: N/A   Resident   size: 72
Type: $FILE_NAME (48-3)   Name: N/A   Resident   size: 86
Type: $OBJECT_ID (64-0)   Name: N/A   Resident   size: 16
Type: $DATA (128-2)   Name: N/A   Resident   size: 0

比較としてトンネリングの影響を受けないように削除、復元を行った場合のファイルの タイムスタンプも載せておきます。

ファイル復元後(トンネリングの影響なし)

>istat \\.\C: 29428-128-1
MFT Entry Header Values:
Entry: 29428        Sequence: 44
$LogFile Sequence Number: 85065412077
Allocated File
Links: 1

$STANDARD_INFORMATION Attribute Values:
Flags: Archive
Owner ID: 0
Security ID: 5093  (S-1-5-32-544)
Last User Journal Update Sequence Number: 18058576032
Created:        2018-09-29 01:44:39.000000000 (  
File Modified:   2018-09-29 01:44:39.000000000 (  
MFT Modified:    2018-10-03 14:54:59.251745600 (  
Accessed:     2018-09-29 01:44:39.000000000 (  
$FILE_NAME Attribute Values:
Flags: Archive
Name: test01.txt
Parent MFT Entry: 517790        Sequence: 20
Allocated Size: 0       Actual Size: 0
Created:        2018-10-03 14:54:59.250748000 (  
File Modified:   2018-10-03 14:54:59.250748000 (  
MFT Modified:    2018-10-03 14:54:59.250748000 (  
Accessed:     2018-10-03 14:54:59.250748000 (  

Attributes:
Type: $STANDARD_INFORMATION (16-0)   Name: N/A   Resident   size: 72
Type: $FILE_NAME (48-2)   Name: N/A   Resident   size: 86
Type: $DATA (128-1)   Name: N/A   Resident   size: 0

結果

キャッシュに保存させた/test01/test01.txtの作成時間が$FNの作成時間に引き継がれました。
今までの記事では$SIの作成にキャッシュされた作成時間が引き継がれていたので意外な結果でした。
そのほかのタイムスタンプは普通に復元したときと変わりませんでした。

注意

FTK Imagerは復元の際にタイムスタンプを戻す特徴があります。そのため、他のツールを用いた復元では、異なる結果になる可能性があります。

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

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

はじめに

こんにちは、iria_piyo🐣です。

前編ではファイル削除とファイル移動の操作で作成時間が引き継がれることを確認しました。 今回はファイルの削除、リネームの操作をせず、ファイル移動だけで作成時間が引き継がれるのか気になったので検証してみることにしました。

前編はこちら

NTFSのトンネリングとLocalFileMove(前編) - ひよこメモ

環境

Windows10 バージョン1803

検証内容

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

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

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

>istat \\.\C: 296339-128-1
MFT Entry Header Values:
Entry: 296339        Sequence: 54
$LogFile Sequence Number: 75950503896
Allocated File
Links: 1

$STANDARD_INFORMATION Attribute Values:
Flags: Archive
Owner ID: 0
Security ID: 2836  (S-1-5-21-3763767945-1047358448-4033639875-8282)
Last User Journal Update Sequence Number: 16369357392
Created:        2018-09-25 09:26:05.266683300 (
File Modified:   2018-09-25 09:26:05.266888700 (
MFT Modified: 2018-09-25 09:26:08.181408600 (
Accessed:        2018-09-25 09:26:05.266683300 (
$FILE_NAME Attribute Values:
Flags: Archive
Name: test01.txt
Parent MFT Entry: 11853         Sequence: 96
Allocated Size: 0       Actual Size: 0
Created:        2018-09-25 09:26:05.266683300 (
File Modified:   2018-09-25 09:26:05.266888700 (
MFT Modified: 2018-09-25 09:26:05.266888700 (
Accessed:        2018-09-25 09:26:05.266683300 (
$OBJECT_ID Attribute Values:
Object Id: 33955469-c057-11e8-84dd-a81374942b83

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

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

>istat \\.\C: 296987-128-1
MFT Entry Header Values:
Entry: 296987        Sequence: 13
$LogFile Sequence Number: 75950543246
Allocated File
Links: 1

$STANDARD_INFORMATION Attribute Values:
Flags: Archive
Owner ID: 0
Security ID: 2836  (S-1-5-21-3763767945-1047358448-4033639875-8282)
Last User Journal Update Sequence Number: 16369378424
Created:        2018-09-25 09:26:16.854957200 (
File Modified:   2018-09-25 09:26:16.854957200 (
MFT Modified: 2018-09-25 09:26:20.747500700 (
Accessed:        2018-09-25 09:26:16.854957200 (
$FILE_NAME Attribute Values:
Flags: Archive
Name: test01.txt
Parent MFT Entry: 295794        Sequence: 27
Allocated Size: 0       Actual Size: 0
Created:        2018-09-25 09:26:16.854957200 (
File Modified:   2018-09-25 09:26:16.854957200 (
MFT Modified: 2018-09-25 09:26:16.854957200 (
Accessed:        2018-09-25 09:26:16.854957200 (
$OBJECT_ID Attribute Values:
Object Id: 339554af-c057-11e8-84dd-a81374942b83

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

/test01/test01.txtを/test03へ移動させ、/test01/test02/test01.txtを/test01へ移動させます。 /test01/test02/から移動した/test01/test01.txtのタイムスタンプを確認します。

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

>istat \\.\C: 296987-128-1
MFT Entry Header Values:
Entry: 296987        Sequence: 13
$LogFile Sequence Number: 75951797368
Allocated File
Links: 1

$STANDARD_INFORMATION Attribute Values:
Flags: Archive
Owner ID: 0
Security ID: 2836  (S-1-5-21-3763767945-1047358448-4033639875-8282)
Last User Journal Update Sequence Number: 16370028064
Created:        2018-09-25 09:26:05.266683300 (
File Modified:   2018-09-25 09:26:16.854957200 (
MFT Modified: 2018-09-25 09:34:24.635576100 (
Accessed:        2018-09-25 09:26:16.854957200 (
$FILE_NAME Attribute Values:
Flags: Archive
Name: test01.txt
Parent MFT Entry: 11853         Sequence: 96
Allocated Size: 0       Actual Size: 0
Created:        2018-09-25 09:26:16.854957200 (
File Modified:   2018-09-25 09:26:16.854957200 (
MFT Modified: 2018-09-25 09:26:20.747500700 (
Accessed:        2018-09-25 09:26:16.854957200 (
$OBJECT_ID Attribute Values:
Object Id: 339554af-c057-11e8-84dd-a81374942b83

Attributes:
Type: $STANDARD_INFORMATION (16-0)   Name: N/A   Resident   size: 72
Type: $FILE_NAME (48-6)   Name: N/A   Resident   size: 86
Type: $OBJECT_ID (64-5)   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秒間)キャッシュに保存されます。このキャッシュは、ディレクトリごとに分けられています。 削除されたファイル名がキーとなり、新しいファイルがディレクトリに追加されると、キャッシュを検索し、復元できる情報があるか確認されます。 ディレクトリが削除されてしまうと、そのディレクトリのキャッシュも削除されてしまいます。

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秒間)キャッシュに保存されます。このキャッシュは、ディレクトリごとに分けられています。 削除されたファイル名がキーとなり、新しいファイルがディレクトリに追加されると、キャッシュを検索し、復元できる情報があるか確認されます。 ディレクトリが削除されてしまうと、そのディレクトリのキャッシュも削除されてしまいます。

ファイルアクセスでタイムスタンプが更新された件

はじめに

こんにちは、iria_piyo🐣です。

コマンドによるファイル作成後のファイルアクセスとエクスプローラー上でのファイル作成後のファイルアクセスで結果が違ったため、メモをすることにしました。

使用したツールはThe Sleuth Kitです。
詳細はこちら
https://www.sleuthkit.org/sleuthkit/

環境

Windows10 バージョン1803

エクスプローラーで右クリックしてファイル作成

ファイル作成時のタイムスタンプ

> istat \\.\C: 71520-128-1
MFT Entry Header Values:
Entry: 71520        Sequence: 33
$LogFile Sequence Number: 74460574771
Allocated File
Links: 2

$STANDARD_INFORMATION Attribute Values:
Flags: Archive
Owner ID: 0
Security ID: 2836  (S-1-5-21-3763767945-1047358448-4033639875-8282)
Last User Journal Update Sequence Number: 16024806192
Created:        2018-09-12 16:12:26.624456200 (  
File Modified:   2018-09-12 16:12:26.624456200 (  
MFT Modified:    2018-09-12 16:12:36.463228600 (
Accessed:     2018-09-12 16:12:26.624456200 (
$FILE_NAME Attribute Values:
Flags: Archive
Name: POMU_P~1.TXT
Parent MFT Entry: 53759         Sequence: 9
Allocated Size: 0       Actual Size: 0
Created:        2018-09-12 16:12:26.624456200 (
File Modified:   2018-09-12 16:12:26.624456200 (
MFT Modified:    2018-09-12 16:12:26.624456200 (
Accessed:     2018-09-12 16:12:26.624456200 (
$FILE_NAME Attribute Values:
Flags: Archive
Name: pomu_piyo_access.txt
Parent MFT Entry: 53759         Sequence: 9
Allocated Size: 0       Actual Size: 0
Created:        2018-09-12 16:12:26.624456200 (
File Modified:   2018-09-12 16:12:26.624456200 (
MFT Modified:    2018-09-12 16:12:26.624456200 (
Accessed:     2018-09-12 16:12:26.624456200 (
$OBJECT_ID Attribute Values:
Object Id: 4f61379b-b659-11e8-84d1-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: 106
Type: $OBJECT_ID (64-6)   Name: N/A   Resident   size: 16
Type: $DATA (128-1)   Name: N/A   Resident   size: 0

アクセス後のタイムスタンプ

> istat \\.\C: 71520-128-1
MFT Entry Header Values:
Entry: 71520        Sequence: 33
$LogFile Sequence Number: 74460574771
Allocated File
Links: 2

$STANDARD_INFORMATION Attribute Values:
Flags: Archive
Owner ID: 0
Security ID: 2836  (S-1-5-21-3763767945-1047358448-4033639875-8282)
Last User Journal Update Sequence Number: 16024806192
Created:        2018-09-12 16:12:26.624456200 (
File Modified:   2018-09-12 16:12:26.624456200 (
MFT Modified:    2018-09-12 16:12:36.463228600 (
Accessed:     2018-09-12 16:12:26.624456200 (
$FILE_NAME Attribute Values:
Flags: Archive
Name: POMU_P~1.TXT
Parent MFT Entry: 53759         Sequence: 9
Allocated Size: 0       Actual Size: 0
Created:        2018-09-12 16:12:26.624456200 (
File Modified:   2018-09-12 16:12:26.624456200 (
MFT Modified:    2018-09-12 16:12:26.624456200 (
Accessed:     2018-09-12 16:12:26.624456200 (
$FILE_NAME Attribute Values:
Flags: Archive
Name: pomu_piyo_access.txt
Parent MFT Entry: 53759         Sequence: 9
Allocated Size: 0       Actual Size: 0
Created:        2018-09-12 16:12:26.624456200 (
File Modified:   2018-09-12 16:12:26.624456200 (
MFT Modified:    2018-09-12 16:12:26.624456200 (
Accessed:     2018-09-12 16:12:26.624456200 (
$OBJECT_ID Attribute Values:
Object Id: 4f61379b-b659-11e8-84d1-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: 106
Type: $OBJECT_ID (64-6)   Name: N/A   Resident   size: 16
Type: $DATA (128-1)   Name: N/A   Resident   size: 0

fsutilコマンドでファイル作成

ファイル作成時のタイムスタンプ

> istat \\.\C: 455157-128-1
MFT Entry Header Values:
Entry: 455157        Sequence: 18
$LogFile Sequence Number: 74458591244
Allocated File
Links: 2

$STANDARD_INFORMATION Attribute Values:
Flags: Archive
Owner ID: 0
Security ID: 2836  (S-1-5-21-3763767945-1047358448-4033639875-8282)
Last User Journal Update Sequence Number: 16023692008
Created:        2018-09-12 16:02:31.240774600 (
File Modified:   2018-09-12 16:02:31.240774600 (
MFT Modified:    2018-09-12 16:02:31.240774600 (
Accessed:     2018-09-12 16:02:31.240774600 (
$FILE_NAME Attribute Values:
Flags: Archive
Name: POMU_A~1.TXT
Parent MFT Entry: 53759         Sequence: 9
Allocated Size: 0       Actual Size: 0
Created:        2018-09-12 16:02:31.240774600 (
File Modified:   2018-09-12 16:02:31.240774600 (
MFT Modified:    2018-09-12 16:02:31.240774600 (
Accessed:     2018-09-12 16:02:31.240774600 (
$FILE_NAME Attribute Values:
Flags: Archive
Name: pomu_access.txt
Parent MFT Entry: 53759         Sequence: 9
Allocated Size: 0       Actual Size: 0
Created:        2018-09-12 16:02:31.240774600 (
File Modified:   2018-09-12 16:02:31.240774600 (
MFT Modified:    2018-09-12 16:02:31.240774600 (
Accessed:     2018-09-12 16:02:31.240774600 (
Attributes:
Type: $STANDARD_INFORMATION (16-0)   Name: N/A   Resident   size: 72
Type: $FILE_NAME (48-3)   Name: N/A   Resident   size: 90
Type: $FILE_NAME (48-2)   Name: N/A   Resident   size: 96
Type: $DATA (128-1)   Name: N/A   Resident   size: 0

アクセス後のタイムスタンプ

> istat \\.\C: 455157-128-1
MFT Entry Header Values:
Entry: 455157        Sequence: 18
$LogFile Sequence Number: 74460111064
Allocated File
Links: 2

$STANDARD_INFORMATION Attribute Values:
Flags: Archive
Owner ID: 0
Security ID: 2836  (S-1-5-21-3763767945-1047358448-4033639875-8282)
Last User Journal Update Sequence Number: 16024537296
Created:        2018-09-12 16:02:31.240774600 (
File Modified:   2018-09-12 16:02:31.240774600 (
MFT Modified:    2018-09-12 16:09:54.066031100 (
Accessed:     2018-09-12 16:02:31.240774600 (
$FILE_NAME Attribute Values:
Flags: Archive
Name: POMU_A~1.TXT
Parent MFT Entry: 53759         Sequence: 9
Allocated Size: 0       Actual Size: 0
Created:        2018-09-12 16:02:31.240774600 (
File Modified:   2018-09-12 16:02:31.240774600 (
MFT Modified:    2018-09-12 16:02:31.240774600 (
Accessed:     2018-09-12 16:02:31.240774600 (
$FILE_NAME Attribute Values:
Flags: Archive
Name: pomu_access.txt
Parent MFT Entry: 53759         Sequence: 9
Allocated Size: 0       Actual Size: 0
Created:        2018-09-12 16:02:31.240774600 (
File Modified:   2018-09-12 16:02:31.240774600 (
MFT Modified:    2018-09-12 16:02:31.240774600 (
Accessed:     2018-09-12 16:02:31.240774600 (
$OBJECT_ID Attribute Values:
Object Id: 4f613088-b659-11e8-84d1-a81374942b83

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

エクスプローラー上でファイル作成をした場合、ファイルアクセスを行っても タイムスタンプは更新されません。

ですが、コマンドによるファイル作成を行った場合、ファイルアクセスを行うと 初回アクセス時のみ$SIのMFT Modifiedのタイムスタンプが更新されます。 その後、再びファイルアクセスを行っても、タイムスタンプは更新されません。

どうしてタイムスタンプが更新されたのか

理由は、コマンドによるファイル作成ではObjectIDがファイルに付与されず、 初回アクセス時にObjectID*1が付与されたことだと考えられます。

エクスプローラ上で右クリックをしてファイル作成を行うとRecentフォルダに作成したファイルのショートカットファイルが作成されます。 ファイル作成時にObjectID が付与されるため、その後ファイルアクセスを行っても、 $SIのMFT Modifiedは更新されません。

※ObjectIDはショートカットファイル作成時にファイルとショートカットファイル内に付与され、両方のファイルを紐づけする役割を果たします。 これによりファイル移動を行ってもショートカットファイルからファイルの実行が可能となっています。

さいごに

前に、コマンドによるファイル作成ではショートカットファイルが作成されないと聞いたので試してみました。これからも積極的にメモしていこうと思います。

*1:ObjectIDはショートカットファイル作成時にファイルとショートカットファイル内に付与され、両方のファイルを紐づけする役割を果たします。 これによりファイル移動を行ってもショートカットファイルからファイルの実行が可能となっています。