Вы находитесь на странице: 1из 4

2010 Second International Workshop on Education Technology and Computer Science

Analysis and Implementation of NTFS File System


Based on Computer Forensics
Zhang Kai ,Cheng En , Gao Qinquan
  


Key Laboratory of Underwater Acoustic Communication and Marine
Information Technology,Ministry of Education ,Xiamen University, Xiamen, China

Department of Automation, Xiamen University, Xiamen, China
E-mail: chengen@xmu.edu.cn

Abstract—NTFS, which restores and manages the important features, such as webǃdisk quota and file encryption. NTFS
data, is a common file system in Windows Operating System,. supports the managing function of encrypting files, and so it
Tapping and analyzing the useful data of the NTFS file system can provide a higher- level security guarantees to the users.
has become an important means of current computer forensic.
Through detailed analysis and research on the storage A. Framework of NTFS
principles of the NTFS file system, the object-oriented method In NTFS, system obtains the storage location of data by
is put forward to design NTFS file parsing system. This system Master File Table (MFT).MFT is a database relative to the
parses the binary data stored in disk, achieving the total
file, consisting of a series of File Record[2]. Each file in the
analysis of both the normal files and the deleted files. Then, all
volume has a file record (There may be many file records in
the data retrieved can be restored into the form of a friendly
user interface which can provide a reliable data source for the
accord with a mass file), MFT can also have its own record
computer forensics. file.The structure of NTFS partition is shown in Figure1..
Boot MFT System file File area
Keywords-computer forensics;NTFS;file system;data recover;
object-oriented

I. INTRODUCTION Figure 1. Structure of NTFS partition

With the rapid development of information technology NTFS locates files by VCN, each of which has a
and Internet, computers have been extensively used in many corresponding file and may record one or more date records,
different fields of our life, while computer-related crimes and each record includes initial cluster and length of file,.
occur more and more frequently. As a new kind of Several file records can be combined into the date of a file.
high-technology crime, the evidence of computer crime is
stored and transmitted through the computers or webs. B. The Volume Access Process By MFT In NTFS
Therefore, based on the computer forensics, tapping and The volume access process by MFT in NTFS is as
analyzing of the data stored in various storage devices follows; first, when NTFS accesses one volume, it must load
becomes an important part of taking evidence from the volume; and then NTFS check the guided files and find
computers[1]. the physical disk address of MFT; and from the data attribute
Windows Operating System (OS) has played an of file record it could obtain the mapping of VCN to LCN,
important role in our life, and NTFS, which stored and and save into the relative memory. The operating position of
managed the important data, is the common file system MFT is located by this mapping[3].
under Windows Operating System. Tapping and analyzing (1)Small File(SF) And Small Directory(SD) Access
the useful data of NTFS file system is of great importance in All the attributes of SD and SF can be resident in MFT.
computer forensics. If the data is deleted, we couldn’t The unnamed attributes of SD can include all file data.
directly observe it under Windows Operating System, but it (2)Mass File Access
sometimes includes some important evidence of crime. The size of a file record is fixed at 1K, so mass files and
Through detailed analysis and study on the Memory mass directory cannot be saved in a single file record, thus
Principle s of the NTFS file system, this paper puts forward NTFS assigns spaces for them outside the MFT. These
the object-oriented idea to design NTFS file parsing system, spaces are always called a Run or an Extent that can save the
parse the most derived binary data that was saved to disk, attribute values, such as file date. If the attribute value
achieving the totally analysis of the normal files and the increases, NTFS will assign a new Run for the additional
deleted files. Then a friendly interface is used to display all values. The attributes saved in Run not in MFT are called
these data of tree structure to the users. It provides a reliable nonresident attribute. A nonresident attribute, like mass file
data source and a powerful tool for the computer forensics. data, includes the relevant information in its head by which
NTFS locates the attribute value on the disk. The structure of
II. ANALYSIS OF NTFS FILE SYSTEM the mass file is shown in Figure2.
NTFS is a common file system under Windows NT OS
and Windows NT advanced network server OS. Meanwhile
it is a special disk format designed for management safety

Corresponding Author:Cheng en ,E-mail:chengen@xmu.edu.cn

978-0-7695-3987-4/10 $26.00 © 2010 IEEE 325


DOI 10.1109/ETCS.2010.434
operation interfaces is provided for preferable analysis and
forensics[5].
Based on the objectives to be achieved, this paper
presents a thought of object-oriented file parsing. we regards
all files as an object which encapsulated each attribute of the
Figure 2. storage structure of mass file
objects and various interface functions for the objects, and
each object is an independent one. In the file list parsed,
A data Run is corresponding to a nonresident attribute, project, disk ˈ partition, directory and document are all
and the file data is composed of two nonresident attributes. inherited from CMyFile. According to the different effects of
Only the increasing attribute is non-resident in standard objects, CMyFile develops class CDevice and CProject.
attribute. As to the file, the increasing attributes can be data, CDevice is used to express device and CProject is used to
attribute list and so on. Standard information and file name express project. Likewise, CDevice develops class
are always resident attribute. MFT record the content of file ClogicDisk and Cdisk. ClogicDisk is used to express
by VCN-LCN mechanism. The structure of VCN-LCN is partition, and Cdisk is used to express disk. Thus we could
shown in Figure3. obtain the framework of the whole file system as is shown in
Figure5[6].

Figure 3. Corresponding VCN-LCN for files

If a file has too many attributes to be saved in MFT


record, then a second MFT file record can be used to Figure 5. The overall class framework diagram of NTFS file system
accommodate these extra attributes (or the head of
nonresident attribute). In this case, an attribute called We define an object of CSource in each CDevice class,
Attribute List is added. Attribute list includes the name of and CSource express the data source of this device, so that
file attribute, type codes and the attribute quote in the MFT. the construction and acquisition of each file object could be
The attribute list is always a scattered file which need several easier. Data source is divided into hard disk data source and
MFT file record for the mapping of VCV-LCV is too mirror image data source according to the different
large[4]. applications. Therefore, two subclasses of CDeviceSource
(3)Directory Access and CFileSource are derived from the CSource base class.
The folder in NTFS is only an index of a simple file One is used to express hard data source and the other is used
name and file quote. If the size of directory’s attribute list is to express document data source. Functions such as
smaller than a record’s length, then all the information of this CREATEFILE and READFILE are achieved in these
folder can be saved in MFT record. As to the one which is subclasses, thus we could obtain the class inheritance
bigger, it should use B+ tree to manage, and use a pointer to framework of the whole file system, which is shown in
point at an Extent. This cluster is used to save the folder’s Figure6.
attributes that MFT can’t hold. The process is shown in
Figure4.

Figure 6. The resource class framework diagram of NTFS file system

B. The Analysis Of NTFS File System[7]


Figure 4. NTFS Directory access
(1)The Analytic Techniques Of Normal files
III. DESIGN OF OBJECT-ORIENTED NTFS FILE SYSTEM As in NTFS, all data is included in file, and file obtain its
store location on disk and record its information by MFT.
A. The Frame of Object-oriented NTFS File System According to the explanation in the previous section, this
In the resolving process of NTFS file system, according paper designs an analytical method to normal files under
to the structure of the NTFS file system, the system extracts NTFS as follows:
all the information existed as document, remote directory 1 Read the dos boot record DBR of NTFS, and obtain the
and file partition and so forth from the most derived binary initial logical cluster number of MFT;
data stream. Then a friendly interface is used to display these 2 According to the cluster number, read the whole MFT
data of tree structure to the users. Meanwhile, the various record and save it in memory;

326
3 Through cyclic traversal, analyze each file record in Therefore it provides probability to recover NTFS data. But
MFT, and parse every piece of file information in the record. we can not see the deleted file at original position. If we
The concrete process for each file record is as follows: write data into hard-disk again, these clusters may be over
3.1 Read the head of MFT file record, and analyze the write. That is to say, when the deleted file’s original clusters
flag byte at offset 0X16 byte. If the value is 0X00, it are covered by new information, the deleted file might not be
indicates that the file is a deleted one, and the value 0X02 recovered.
indicates a deleted folder. According to the design idea of this paper, the data area
3.2 Through the head of file record, the fragment offset of deleted file can be defined as totally recoverable, partial
of the first attribute can be obtained. In general case the recoverable and totally non-recoverable. Specific judgment
offset value is 10H as standard attribute, from which size, is as follows:
set-up time, last amending time, last accessing time and file 1. Totally recoverable model:
attribute of the deleted file can be extracted.
3.3 According to the size of the first attribute, continue to
analyze the offset, the file name attribute 30H can be
obtained, from which some important information like file
name can be extracted; after that, the data attribute recording 
the details of the file can be gained. When data attribute is Figure 8. Totally recoverable model
resident, file content can be saved in file record; when data
attribute is non-resident, that is to say, the file size is too big, 2. Partial recoverable model:
and we should assign extra space to store them. Meanwhile,
through analysis, record the sector information in which file
is saved.
3.4.Read root folder attribute 0X90 and index attribute 
0X0A, build folder structure of file, put all these data been Figure 9. Partial recoverable model
analyzed into folder tree structure.
According to the above analysis, a flow chart for the 3. Totally non-recoverable model:
analysis of normal NTFS files is designed as Figure7.


Figure 10. Totally non-recoverable model

Based on the above analysis, when the data area of


deleted file is not covered by the adjacent two files, then it
can be totally recovered. When the area is partly covered by
the adjacent two files, then the area that is uncovered can be
extracted, and based on the analysis of normal file we should
cut out the covered sectors. When the area is totally covered
by the adjacent files, then the data is lost and is totally
non-recoverable.
According to the storage principles of NTFS and the
processing techniques to deleted files, the technique of
deleted files implementation is as follows:
1. According to the normal file analysis, parse all the files,
and store the flag bit information of the deleted file.
2. Sort order of all file by address space.
3. When analysis is over, find the deleted file and folder
through the flag byte.
4. When the data area of deleted file is not covered by the
adjacent two files, the file date is fine, so do not clip.
5. When the area is partly covered by the adjacent two
Figure 7. The flowchart of the analysis of normal NTFS files files, we should cut out the covered space, and then the
remainder is right content after analysis.
(2)The Recovery Techniques Of Deleted Files 6. When the area is totally covered by the adjacent files,
In Windows OS, when the NTFS file is deleted, file data then the data is lost and is totally non-recoverable.
area is not cleared at once. The system only alter file status According to the above analysis, we design a flow chart
byte value from 01(remain using) to 00(deleted) in file for the recovery of deleted files under NTFS as Figure11.
record, and all other important information is remained.

327
Figure 12. The flowchart of the object-oriented parsing
of NTFS file system

IV. VERIFICATION OF SYSTEM


We implement the method under Windows XP+SP2
OS and Microsoft Visual C++ 2005 platform. Use this
system to analyze the NTFS file system can obtain a right
result. The running interface is shown in Figure13. The result
of the tests indicated object-oriented NTFS file system
analysis is feasible. Then a friendly interface can be used to
display all these data of tree structure to users, providing a
reliable data source for the computer forensics[9].

Figure 11. The flowchart of the reparsing the deleted file

(3) Assembly Software Flow Chart


Through parsing the file system, we may obtain the Figure 13. The Interface of object-oriented parsing of NTFS file system
whole hard-disk or partition. Thus, we should judge the
device type first. When it is partition, we shall judge whether V. CONCLUSION
it is NTFS partition. If it is NTFS partition, then build the
Aiming at the demand of computer forensics based on
partition object, and progressively parse the partition from
NTFS file system, this paper proposes a method of
root directory. And finally, store them in the tree structure. object-oriented method to design and analyze NTFS file
When it is hard disk, we should build hard disk object. Then system. The inherit relationship and encapsulation of class
cyclic parsing the partition list of hard disk, extract the NTFS are used to deeply analyze different kinds of data sources. It
partition, and build the corresponding NTFS partition. Then, not only implements normal file analysis, but restores the
according to the analysis method for partition, parse the deleted file. The result of analysis is displayed in a friendly
extracted partition object until the end. The flowchart of the interface. A reliable data source for the computer forensics is
object-oriented parsing of NTFS file system is shown in provided. Meanwhile, many interfaces have reference value
Figure12[8]. for the design of upper computer forensics software.
REFERENCES
[1] WANG Lina; YANG Mo; WANG Hui; GUO Panfeng, “Computer
Forensics Research and Implementation Based on NTFS File
System,” Journal of Wuhan University(Natural Science Edition),vol.
5, pp. 519–522.
[2] Liang Jinqian;Zhang Yue, “The Main Data Structure of NTFS File
System,”Computer Engineering and Applications[J],2003,
pp.116-130.
[3] Tu Yanhui;Dai Shijian, Data security and programming techniques
[M]. Beijing: Tsinghua University Press, 2005. (in Chinese)
[4] Wan Lan-ying, Ju Jin-wu.“Analysis of NTFS file system
structure[J],”Computer Engineering and Design,2005,27(3),
pp.418-420.
[5] Zhang Jingsheng 㧘 Wang Zhongxia 㧘 Liu Wei. Data Recovery
Methods and Case Analysis [MJ]. Beijing: Electronics Industry Press,
2008. (in Chinese)
[6] Liang Jinming, Object-Oriented System Analysis and Design
(UMLPattern)[M]. Beijing: Tsinghua University Press, 2005. (in
Chinese)
[7] Sun Xing㧘Yu An’ping. Detailed analysis of the VC + + [M]. Beijing:
Electronics Industry Press, 2004. (in Chinese)
[8] Wang Shilin, Data Structure Algorithm and Application [M].Beijing:
Machinery Industry Press, 2000. (in Chinese)
[9] Clifford A. Shaffer.A, Practical Infroducation to Data Structures and
Algorithm Analysis[M]. Beijing: Electronics Industry Press.2005.

328

Вам также может понравиться