eCDFP Module (5) File System Analysis (Part-10) (NTFS File System Analysis)

 Resident Attribute Header

အခုပုံက Resident Attribute Header Structure ဖြစ်ပါတယ်။ Structure တစ်ခုချင်းစီးကိုအောက်မှာတစ်ခုခြင်း ရှင်းလင်းသွားပါမယ် -  

 Resident Attribute Header

Attribute Length 

Attribute Length ( 4 Bytes) = (0x48) = 72 Bytes
 
Attribute Length ဆိုတာက Attribute တစ်ခုက ဘယ်လောက် Size ရှိတယ်ဆိုတာကို ညွှန်ပြတာဖြစ်ပါတယ်။

အခု Attribute က 72 Bytes ရှိပါတယ်။ 




Offset To The Attribute Data 

Offset To The Attribute Data =  (0x18) = 24

Attribute ရှိတဲ့ Offset ကိုပြောတာဖြစ်ပါတယ်။ အပေါ်မှာဖော်ပြခဲ့တဲ့ Length Of Attribute 
( Attribute Header အပါ) ကိုပြန်ကြည့်မယ်ဆိုရင် 96 Bytes ရှိပါတယ်။ 
Attribute Length = 72 Bytes ရှိတဲ့အတွက် 24+72 = 96 Bytes ရပါတယ်။ 




Index Flag = 0

Padding = 0

The Attribute Name If It Exits

(Attribute မှာ နာမည်ရှိမယ်ဆိုရင် Name အတွက် 8 Bytes နေရာယူပါတယ်။ )




Data Structure For Resident Attribute

အနှစ်ချုပ်ရမယ်ဆိုရင်  Attribute General Header ဖြစ်တဲ့ 

(0-3) 16 Bytes ထဲက ပထမ  (4 Bytes)   (0x10) = $STANDARD_INFORMATION

(4-7)  (4 Bytes)  (0x60) = Length Of Attribute (Include Header) = 96 Bytes 

(8) =  (0x00) = Resident Attribute 

(9) = (0x0) = 0 = Name Of Length 

(10-11) = (0x00) = 0 = Name Of Offset 

(12-13) = (0x00) = Flag

(14-15) = (0x00) = Attribute ID 

(16-19) = (0x48) = 72 =  Length Of The Attribute 

(20-21) = (0x18) = 24 = Offset To The Attribute Data  


 Non-Resident Attribute 


Data Structure For Non-Resident Attribute 

General Header (Common Attribute Header) 

General Header (Common Attribute Header)  ကတော့ Attributes တိုင်းမှာတူညီပါတယ်။ 

(0-3) = (4 Bytes) (0x80) = Attribute Type = $DATA

(4-7)  (4 Bytes)  (0x48) = Length Of Attribute (Include Header) = 72 Bytes 

(8) =  (0x01) = 1=  Non- Resident Attribute 

(9) = (0x0) = 0 = Name Of Length 

(10-11) = (0x00) = 0 = Name Of Offset 

(12-13) = (0x00) = Flag

(14-15) = (0x01) = 1 =  Attribute ID 

================================================

Starting Virtual Cluster Number (VCN) Of The Run List = 0

(16-23) = (8 Bytes) = (0x00)= 0 

Ending Virtual Cluster (VCN) Of The Run List = 188

(24-31) = ( 8 Bytes) = (0xBC) = 188
 
(32-33) = Offset To The Run List  (Data Run Offset) = (0x40) = 64

Data Run အတွက် 60 Bytes နေရာကနေစတင်မယ်လို့ ညွှန်ပြတာဖြစ်ပါတယ်။ 

(34-35) = Compression Unit Size = (0x00) = 0

0= Compressed Or Encrypted လုပ်မထားဘူးလိုပြောတာဖြစ်ပါတယ်။ 

(36-39) = Unused

(40-47) = (8 Bytes) =Allocated Size Of The Attribute Content  

(0x 00D00B000000) = 774,144 (Size On Disk ) 

(48-55) = (8 Bytes) = Actual Size Of The Attribute Content  

(0x C9C00B0000000000) = 770,249 (PDF File Size) 

(56-63) = Initialized Size Of The Attribute Content (Data Size Of The Stream) 

(0x C9C00B0000000000) = 770,249

(64-71 ) = $DATA

               (64)   = (0x22) = Size 

            (65-66) = (0xBD00) = Cluster Count = 189

            (67-68) = (0x4606) =  First Cluster = 1606

End Maker = (0xFFFFFFFF)  

ဒီနေရာမှာ  အချို့  Definition တွေကို English လိုပဲထားလိုက်ပါတယ်။ မြန်မာလိုဆိုရင် ပိုမို ရှုပ်ထွေး မှာဖြစ်တာကြောင့်ဖြစ်ပါတယ်။ 

Virtual Cluster Number (VCN)

Virtual Cluster Number (VCN) (Logical File Address) ဆိုတာက  File System ထဲမှာရှိတဲ့ File, Attribute တွေရှိတဲ့ Cluster နေရာတွေကို ပြသတာဖြစ်ပါတယ်။  

Each cluster of a non-resident stream is given a sequential number. This is its Virtual Cluster Number. VCN 0 (zero) refers to the first cluster of the stream. 

To locate the stream on disk, it's necessary to convert from a VCN to an LCN. This is done with the help of data runs.

Logical Cluster Number (LCN)

Logical Cluster Number (LCN) ဆိုတာက Volume ထဲမှာရှိတဲ့ Cluster တိုင်းကို Sequential Number တွေပေးထားပါတယ်။ အဲဒီနံပတ်က LCN ပဲဖြစ်ပါတယ်။ LCN 0 ဆိုတာက Disk Editor တွေမှာမြင်ရတဲ့ Cluster 0 (Boot Sector) ကိုပြတာဖြစ်ပါတယ်။ 

LCN ကနေ  Physical Offset ရဖို့ဆိုရင်  

Physical Offset = (Logical Cluster Number) x ( Cluster Size) 

ဥပမာ PDF File က  LCN Number  1606 အတွက် Physical Offset လိုချင်တယ်ဆိုရင် Cluster Size ဖြစ်တဲ့ 4096 နဲ့မြှောက်ပါမယ်။  Cluster Size က ကိုယ်အသုံးပြုတဲ့ Size အပေါ်မူတည်ပြီး ပြောင်းလဲနိုင်ပါတယ်။ 

 1606 x 4096 = 6,578,176


Data Runs

Each contiguous block of LCNs is given a Data Run, which contains a VCN, an LCN, and a length. When NTFS needs to find an object on a disk, it looks up the VCN in the Data Runs to get the LCN.

Starting VCN, Ending VCN တွေကိုဘယ်နေရာမှာ အသုံးပြုသလဲဆိုရင် MFT Entry Record တွေကို Attribute တစ်ခုထဲမှာ ဖော်ပြဖို့ လိုအပ်လာတဲ့အခါမှာ အသုံးပြုပါတယ်။ 

ဥပမာ PDF File က Cluster Number  ဘယ်လောက်မှာစပြီး ဘယ်လောက်မှာဆုံး မလဲဆိုတာ ကြည့်ကြည့်ပါမယ်။ 




PDF File အစ =  Cluster 1606
PDF File အဆုံး =  Cluster 1794
PDF က Cluster 1606 – 1794 အထိနေရာယူထားပါတယ်။ တနည်းအားဖြင့် Cluster 189 နေရာ အဲဒီထဲကမှ 1 နေရာက Fragment ဖြစ်နေတယ်လို့ပြသတာဖြစ်ပါတယ်။ File က Cluster နေရာ ဘယ်နှစ်နေရာ ယူတယ် File က ဘယ် Cluster မှာစတယ်ဆိုတာကို အောက်မှာဆက်စပ် ကြည့်နိုင်ပါတယ်။








Run List Example 




Run List Example 

ပုံမှာကြည့်မယ်ဆိုရင် Cluster တွေက အစဉ်အတိုင်းမဖြစ်တာကိုတွေ့နိုင်ပါတယ်။ အရင်တုန်းက File က Unlocated ဖြစ်နေတဲ့အခါ Sector Or Cluster တွေက မကောင်းတဲ့အခါမျိုးတွေမှာ ဖြစ်တတ်ပါတယ်။ 
အခုဆက်ပြီးဖော်ပြမှာက အများဆုံးတွေ့ရတဲ့ Attributes တွေအကြောင်းပဲဖြစ်ပါတယ်။ 


Standard Information Attribute ($SIA) – (0x10) 

Standard Information Attribute  မှာပါဝင်တာတွေကတော့ Standard File  Information တွေဖြစ်တဲ့ File  Security, Timestamps, logging Information, Etc တွေပဲဖြစ်ပါတယ်။ $SIA ရဲ့  File Size က 48-74 Bytes အထိရှိနိုင်ပါတယ်။ 700 Bytes ထက်နည်းတဲ့အတွက် သူက အမြဲတမ်း Resident Attribute ဖြစ်ပါတယ်။ Resident Attribute ဖြစ်တာကြောင့် MFT Entry Record ထဲမှာပဲ ရှိပါတယ်။ သူ့ရဲ့ Attribute  ID =  (0x10) ဖြစ်ပါတယ်။ $SIA ထဲမှာ File အတွက် အဓိကကျတဲ့ Metadata တွေပါဝင်ပါတယ်။  အောက်ကပုံထဲမှာပါတဲ့ အချက်အလက်တွေထဲကမှ Attribute Header အထိကျွန်တော်တို့ရှင်းပြီးပါပြီ။ အနီရောင် Box ထဲက Hex Value တွေက Standard Information Attribute ထဲမှာပါတဲ့ အချက်အလက်တွေဖြစ်ပါတယ်။ 


အခုအောက်ကပုံကတော့ Standard Information Attribute   ထဲမှာပါဝင်တဲ့ Standard File Information တွေပဲဖြစ်ပါတယ်။  Disk Editor ထဲမှာ အလွယ်တကူကြည့်နိုင်ပါတယ်။ Attribute Header မှာ ရှင်းသလိုတော့ Hex Value တွေနဲ့မရှင်းတော့ပါဘူး။


Standard Information Data Structure 


$SI  မှာ Timestamp နဲ့ပတ်သတ်ပြီး အချိန် ၄ မျိုးဖော်ပြပါတယ်။ 
File Created = File ကို Created လုပ်ခဲ့တဲ့အချိန်။ 
File Modified =  $DATA or $INDEX ထဲက Content တွေကို Modified လုပ်ခဲ့တဲ့အချိန်။
Recorded Change = MFT Entry Record မှာ File နဲ့ပတ်သတ်ပြီး နောက်ဆုံး Update လုပ်တဲ့အချိန်။ 
Last Record Changed လုပ်တဲ့ Time ကို File ရဲ့ Properties မှာမြင်ရမှာမဟုတ်ပါဘူး။ 
Last Accessed Time = File ကိုနောက်ဆုံး Accessed လုပ်တဲ့အချိန်ဖြစ်ပါတယ်။


MFT Entry Record ကိုဖြည်ကြည့်ရင် မြင်ရမဲ့ ပုံစံဖြစ်ပါတယ်။

$SI File Permission 

$FILE_NAME Attribute (0x30) 

File Name Attribute ထဲမှာတော့ File Name တွေနဲ့ File ရဲ့ Parent Directory, Directory Index, Time Stamp တွေပါ၀င်ပါတယ်။  Time Stamp ပါဝင်တဲ့အတွက် Standard Information မှာရှိတဲ့ TimeStamp တွေပြောင်းလဲရင်တောင်  File Name Attribute မှာကြည့်နိုင်ပါတယ်။700 Bytes ထက်နည်းတဲ့အတွက် သူက အမြဲတမ်း Resident Attribute ဖြစ်ပါတယ်။ Resident Attribute ဖြစ်တာကြောင့် MFT Entry Record ထဲမှာပဲ ရှိပါတယ်။ Attribute ID = 0x30 ဖြစ်ပါတယ်။


File Name Attribute  Data Structure 





Data ($DATA) [0x80]


File Data တွေရှိတဲ့နေရာဖြစ်ပါတယ်။ Data တွေ ရှိပေမဲ့ Attribute Header 16 Bytes ကတော့ အတူတူပဲဖြစ်ပါတယ်။ File Data တွေက 700 Bytes ထက်များရင် File Data တွေက MFT ရဲ့အပြင်ဘက်မှာရှိပြီး 
Non-Resident ဖြစ်ပါတယ် Data တွေရှိတဲ့နေရာတွေကို သိနိုင်ဖို့ Run List ကိုသိရမှာ ဖြစ်ပါတယ်။ Attribute ID = 80 ဖြစ်ပါတယ်။ 



Comments

Popular posts from this blog

B-Trees (NTFS)

NTFS Index Attributes

Volatility Workbench (GUI) for the Volatility tool