|
analyzeMFT
analyzeMFT - a Python tool to deconstruct the Windows NTFS $MFT file
NOTE - V1.7 is the current, supported, version. V2.0 is in betaIntroductionanalyzeMFT.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:
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. Major contributions from Matt Sabourin. VersionCurrently at version 1.7. The 2.0 version has some additional features, and some additional limitations. V2.0 should be considered beta. Please use 1.7 version for production work, or if you're working with large $MFT files as you might run out of memory using the 2.0 version. BackgroundMy 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. Installation and useUsage: analyzeMFT.py [options]
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-f FILENAME, --filename=FILENAME
[Required] Name of the MFT file to process.
-d, --debug [Optional] Turn on debugging output.
-p, --fullpath [Optional] Print full paths in output (see comments
in code).
-n, --fntimes [Optional] Use MAC times from FN attribute instead of
SI attribute.
-a, --anomaly [Optional] Turn on anomaly detection.
-b BODYFILE, --bodyfile=BODYFILE
[Optional] Write MAC information in mactimes format
to this file.
-m MOUNTPOINT, --mountpoint=MOUNTPOINT
[Optional] The mountpoint of the filesystem that held
this MFT.
-g, --gui [Optional] Use GUI for file selection.
-o OUTPUT, --output=OUTPUT
[Optional] Write analyzeMFT results to this file.Source: The source code can be downloaded from Source page of this site . 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 binary version is often out of date. Use the source (Luke) whenever possible. The installer for a standalone binary is available here. A couple of notes: It often lags (way)behind the source version. If at all possible, use the source. 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. OutputThe 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. Sample OutputSample 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" Future workFuture work:
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.
See other ToDos in the code Change logUpdates: (Most recent on top starting with 2.0) Version 2.0: Matt Sabourin - Created an object-oriented version of analyzeMFT.py. Most of the MFT analysis code and other logic was retained from the original version (along with the comments). The OO version is structured for importing the module directly into the python interpreter to allow for manual interaction with the MFT. The module can also be imported into other python scripts that need to work with an MFT. In addition to switching to OO, I added following code:
Fixed (?) potential issues with analyzeMFT output
--- Version 1.x notes Version 1.0:
|
Are the times output in the local machines time zone? I cannot seem to find any infomation on the handling of dates/times.