Updates:
Version 1.0: Initial release
Version 1.1: Split parent folder reference and sequence into two fields.
Version 1.2:
- Fixed problem with non-printable characters in filenames.
- Added "compile time" flag to turn off the inclusion of any GUI related modules and libraries for systems missing tk/tcl support. (Set noGUI to True in the code)
Version 1.3:
- Added new column to hold log entries relating to each record. For example, a note stating that some characters in the filename were converted to hex as they could not be printed.
- Built standalone executable and installer.
Overview:
analyzeMFT.py is designed to fully parse the MFT file from an NTFS filesystem and present the results as accurately as possible in a format that allows further analysis with other tools. At present, it parses the attributes from a $MFT file to produce the following output:
- Record Number
- Good - if the entry is valid
- Active - if the entry is active
- Record type - the type of record
- Record Sequence - the sequence number for the record
- Parent Folder Record Number
- Parent Folder Sequence Number
- For the standard information attribute:
- Creation date
- Modification date
- Access date
- Entry date
- For up to four file name records:
- File name
- Creation date
- Modification date
- Access date
- Entry date
- Object ID
- Birth Volume ID
- Birth Object ID
- Birth Domain ID
- And flags to show if each of the following attributes is present:
- Standard Information, Attribute List, Filename, Object ID, Volume Name, Volume Info, Data, Index Root, Index Allocation, Bitmap, Reparse Point, EA Information, EA, Property Set, Logged Utility Stream
- Notes/Log - Field used to log any significant events or observations relating to this record
For each entry in the MFT a record is written to an output file in CSV format.
analyzeMFT will run on any system with Python installed. A standalone Windows executable is also available,
Contributions and suggestions for improvement are quite welcome.
analyzeMFT is Copyright (c) 2010 David Kovar. All rights reserved. This software is distributed under the Common Public License 1.0.
Sample output:
Sample output:
"Record Number","Good","Active","Record type","Parent Folder","Record Sequence","Filename #1","Std Info Creation date","Std Info Modification date","Std Info Access date","Std Info Entry date","FN Info Creation date","FN Info Modification date","FN Info Access date","FN Info Entry date","Object ID","Birth Volume ID","Birth Object ID","Birth Domain ID","Filename #2","FN Info Creation date","FN Info Modify date","FN Info Access date","FN Info Entry date","Filename #3","FN Info Creation date","FN Info Modify date","FN Info Access date","FN Info Entry date","Filename #4","FN Info Creation date","FN Info Modify date","FN Info Access date","FN Info Entry date","Standard Information","Attribute List","Filename","Object ID","Volume Name","Volume Info","Data","Index Root","Index Allocation","Bitmap","Reparse Point","EA Information","EA","Property Set","Logged Utility Stream"
"0","Good","Active","File","5 - 5","1","$MFT","2007/07/31 19:16:13.734373","2007/07/31 19:16:13.734373","2007/07/31 19:16:13.734373","2007/07/31 19:16:13.734373","2007/07/31 19:16:13.734373","2007/07/31 19:16:13.734373","2007/07/31 19:16:13.734373","2007/07/31 19:16:13.734373","","","","","","","","","","","","","","","","","","","","True","False","False","False","False","False","True","False","False","True","False","False","False","False","False"
-------
"110575","Good","Inactive","0","5422 - 5426","3","TRANSFERMGR.EXE-24D2A23F.pf","2009/12/27 18:35:57.625000","2009/12/28 05:32:01.390625","2009/12/27 18:35:57.625000","2009/12/28 05:32:01.390625","2009/12/27 18:35:57.625000","2009/12/27 18:35:57.625000","2009/12/27 18:35:57.625000","2009/12/27 18:35:57.625000","","","","","TRANSFERMGR.EXE-24D2A23F.pf","2009/12/27 18:35:57.625000","2009/12/27 18:35:57.625000","2009/12/27 18:35:57.625000","2009/12/27 18:35:57.625000","","","","","","","","","","","True","False","False","False","False","False","True","False","False","False","False","False","False","False","False"
Downloads:
Source: The source code can be downloaded here. You will need Python installed on your system to run it. I recommend ActivePython, free, from here.
You need to have the tkinter python module and may need tk/tcl as well. The first thing to try is installing the tkinter module for your platform. More details can be found here. If you don't want to install tk/tcl, just set the "noGUI" flag to 'True' in the code and it will not try to import the modules.
Binary executable: The installer for a standalone binary is available here. A couple of notes:
- It installs the Microsoft Visual C++ 2008 Redistributable Package. This provides the runtime libraries required. If you want to install this for yourself, it can be found here.
- On Windows XP, the Startup Menu install works correctly and if you start the application in this manner, the GUI comes up. On Windows 7, the startup parameter doesn't get set by the installer so the application starts up and immediately exits. You can run it from the command line without problems.
Background:
My original inspiration was a combination of MFT Ripper (thus the current output format) and the SANS 508.1 study guide. I couldn't bear to read about NTFS structures again, particularly since the information didn't "stick". I also wanted to learn Python so I figured that using it to tear apart the MFT file was a reasonably sized project.
Many of the variable names are taken directly from Brian Carrier's The Sleuth Kit. His code, plus his book "File System Forensic Analysis", was very helpful in my efforts to write this code.
The output format is almost identical to Mark Menz's MFT Ripper. His tool really inspired me to learn more about the structure of the MFT and to learn what additional information I could glean from the data.
I also am getting much more interested in timeline analysis and figured that really understanding the the MFT and having a tool that could parse it might serve as a good foundation for further research in that area.
Output from --help:
Usage: analyzeMFT.py [options]
Options:
-h, --help show this help message and exit
-f FILE, --file=FILE read MFT from FILE
-o FILE, --output=FILE
write results to FILE
-g, --gui Use GUI for file selection
-d, --debug turn on debugging output
Purpose:
analyzeMFT.py is designed to fully parse the MFT file from an NTFS filesystem
and present the results as accurately as possible in a format that allows
further analysis with other tools. At present, it will read an entire MFT
through to the end without error, but it skips over parsing some of the
attributes. These will be filled in as time permits.
Caution:
This code is very much under development. You should not depend on its results without double checking
them against at least one other tool.
Output:
The output is currently written in CSV format. Due to the fact that Excel
automatically determines the type of data in a column, it is recommended that
you write the output to a file without the .csv extension, open it in Excel, and
set all the columns to "Text" rather than "General" when the import wizard
starts. Failure to do so will result in Excel formatting the columns in a way
that misrepresents the data.
I could pad the data in such a way that forces Excel to set the column type correctly
but this might break other tools.
Future work:
1) Figure out how to write the CSV file in a manner that forces Excel to interpret the date/time
fields as text. If you add the .csv extension Excel will open the file without invoking the import
wizard and the date fields are treated as "General" and the date is chopped leaving just the time.
2) Add version switch
3) Add "mftr" switch - produce MFT Ripper compatible output
4) Add "extract" switch - extract or work on live MFT file
5) Finish parsing all possible attributes
6) Look into doing more timeline analysis with the information
7) Improve the documentation so I can use the structures as a reference and reuse the code more effectively
8) Clean up the code and, in particular, follow standard naming conventions
9) There are two MFT entry flags that appear that I can't determine the significance of. These appear in
the output as Unknown1 and Unknown2
10) Parse filename based on 'nspace' value in FN structure
11) Test it and ensure that it works on all major Windows OS versions
12) Output HTML as well as CSV
See other ToDos in the code |