Exploring NTFS
Exploring NTFS
Exploring NTFS
Full Access
By going through the raw disk instead of
the file system routines, we get full access
to any file on the disk as well as any
sectors on the disk that may be
inaccessible through file system locking
mechanisms.
3. Find the root directory metafile entry in the MFT and extract its index allocation
attribute data.
4. Process the INDX records found within the index allocation attribute data one by
one recursively until you find a file that matches the one you are looking for.
5. In the index entry that matched, find the MFT record number and move to that
record position within the MFT.
6. Record the MFT entry and process its standard attribute headers one by one until
the data attribute is encountered.
7. Use the process of attribute data extraction in order to retrieve the data attribute,
which contains the contents of the file that is being accessed.
About NTFS
The NTFS file system has gone through several
iterations each of which brought new features to
end users and application designers.
The current version (3.1) is the primary focus of
this document although the technical details
remain the same for previous versions so this
document is rather universal.
B+ Trees
A B+ tree represents sorted data in a way
which allows for extremely efficient
insertion, removal, and retrieval of data.
All data is identified by a key within the
tree which serves the purpose of being a
multilevel index to nodes on the tree.
Explanation of B+ Operations
In a B+ tree, each node in the tree has a record identifier
or a hash.
Each of these hashes can either point, to data on the
disk or another node.
Each node being pointed to can have the same
properties as a node before it.
This hierarchical data storage mechanism allows for a
theoretical infinite depth with fast lookup times as long as
the storage algorithms to sort the data while its being
stored.
Figure of an Example B+
Partition Table
The 16 byte partition records stored in the MBR, at the
fourth of byte offset, contains a one byte valuewhich
represents one of the possible partition types which can
exist.
In the White paper accompanying this presentation, and
the citations and references section there is a link to all
of the different partition types which can be encountered.
However, for the purposes of this presentation it is only
important to know that if this value is the number seven,
it represents an NTFS partition.
Hexidecimal Value
Unused
Standard Information
File Name
Object ID
Security Descriptor
Volume Name
Volume Information
Data
Index Root
Index Allocation
Bitmap
Reparse Point
EA Information
EA
Property Set
Logged Utility Stream
First User Defined Attribute
End of Attributes (records)
0x00
0x10
0x30
0x40
0x50
0x60
0x70
0x80
0x90
0xa0
0xb0
0xc0
0xd0
0xe0
0xf0
0x100
0x1000
0xffffffff
Continuing Extraction
Create an eight byte value for large integer calculations.
This value will hold a copy to record length for the first
data run.
Using the length member of the union bit field in the
previous slide, copy that number of bytes into the new
value. This is the length of the data run as a large
integer.
Advanced the file pointer that number of bytes forward.
Finishing Up
If we were to now move our final pointer to the data run
offset, and read in the number of bytes specified by the
data run length, we would be able to extract a data run
from a file.
Considering that a file can have multiple data runs, and
that their records are all stored contiguously, its often
best to read in all the data run variables before extracting
the actual run data.
However, the final implementation methodology is left to
the developer.
Additional Information
Linux NTFS Driver Project. "NTFS documentation",
Richard Russon and Yuval Fledel 2005
http://data.linux-ntfs.org/ntfsdoc.pdf
Wikipedia entry on NTFS "NTFS",
http://en.wikipedia.org/wiki/NTFS
Wikipedia Entry On The BIOS Parameter Block "BIOS
Parameter Block",
http://en.wikipedia.org/wiki/BIOS_parameter_block
Wikipedia Entry on the Master Boot Record "Master Boot
Record",
http://en.wikipedia.org/wiki/Master_boot_record