ExfatDump
an experimental tool for forensic analysis of ExFAT filesystem
Install / Use
/learn @lclevy/ExfatDumpREADME
ExFAT dump
Introduction
exfat_dump.py is an experimental tool for forensic analysis of the ExFAT filesystem. User interface is inspired by The Sleuth Kit commands.
Features:
- displays partitions table (mmls, from MBR)
- displays filesystem information (fsstat, from VBR and root directory)
- lists (recursively, -r option) files and directory entries
- displays deleted directory entries (with debug level 2, -d 2)
- displays Modification, Creation/Birth and Access timestamps (-l option)
- displays first cluster number and 'next cluster method' (FAT chaining -fat- or contiguous -nfc*-)
- file content extraction (icat command)
- optionally computes SHA1 of extracted data (-h option)
- computes bitmap statistics (like chkdsk, with fsstat command)
- can display bitmap content (-d 2)
- can display clusters list for a given file or directory (istat)
*nfc = NoFatChaining
Requirements: Python 2.7.x only.
Reference document
Reverse Engineering the Microsoft exFAT File System, by Robert Shullich, 2009, SANS Institute InfoSec Reading Room: http://reverse-engineering-microsoft-exfat-file-system-33274-1.pdf
Intellectual property notes
- FAT and exFAT is protected by Microsoft patents
- This experimental code is released under GPL license
Usage
mmls displays partitions information from the MBR:
>python exfat_dump.py mmls exfat12.001
MBR, Partition table:
bootable type start end size
0x80 0x07 0000000051 0000060800 0000060749 (ExFAT/NTFS)
fsstat displays filesystem information, mainly using VBR content. Volume label comes from root directory and free/allocated cluster from Bitmap. Option -o is used to explicit which partition to use, via its starting sector. If ommited, the first partition with type 7 is used.
>python exfat_dump.py fsstat -o 51 exfat12.001
FILE SYSTEM INFORMATION
--------------------------------------------
File System Type: EXFAT
Sector size: 512 bytes
Cluster size: 4 sectors
FAT size: 120 sectors
Data area size: 15123 clusters
Volume label: EOS_DIGITAL
VBR#1 0x00006600-0x00007e00 (sectors 51-63)
VBR#2 0x00007e00-0x00009600 (sectors 63-75)
FAT#1 0x00016600-0x00025600 (sectors 179-299)
dataArea 0x00026600-0x01dafe00 (sectors 307-60799, clusters 2-15125)
rootDir at 0x28600 (sector 323, cluster 6)
Directories: 2 (6 Kb) Files: 23 (26590 Kb)
Rootdir: 3 clusters (6 Kb)
Bitmap= 15123 available clusters (30246 Kb), 1811 free clusters (3622 Kb), 13312 allocated clusters (26624 Kb)
fls command is used to list directory entries. First column is modification timestamp, then attributes, first cluster number (0 means irrelevant), content size and entry name. In the following example, the file adencrypt.exe starts at cluster #8, its size is 231936 bytes.
>python exfat_dump.py fls exfat12.001
2012/08/23 22:13:00:000 a---- 8 231936 /adencrypt_gui.exe
2012/08/23 22:12:52:000 a---- 122 7680 /adfs_globals.dll
2012/08/23 22:12:50:000 a---- 126 70144 /ADIsoDLL.dll
2012/08/23 22:13:06:000 a---- 161 377856 /adshattrdefs.dll
2015/09/17 21:25:44:183 -d--- 8004 2048 /empty_dir
2015/09/17 21:25:36:000 a---- 6608 12 /new_file.txt
2012/03/14 19:54:44:000 a---- 8005 31744 /da7zip.dll
2014/11/28 17:46:50:000 a---- 1189 12309315 /volatility_2.4.win.standalone.zip
2015/02/16 11:26:34:000 -d--- 7 4096 /langs
2015/09/18 10:49:12:000 a---- 0 0 /nom de fichier vraiment tres tres tres long pour tenir sur plusieurs entrees 0xc1 - Copie (5) - Copie.txt
2011/01/20 19:15:10:000 a---- 8510 946176 /cximage.dll
2015/09/18 10:49:12:000 a---- 0 0 /nom de fichier vraiment tres tres tres long pour tenir sur plusieurs entrees 0xc1 - Copie (4).txt
2015/09/18 10:49:12:000 a---- 0 0 /nom de fichier vraiment tres tres tres long pour tenir sur plusieurs entrees 0xc1 - Copie (4) - Copie.txt
2015/09/18 10:49:12:000 a---- 0 0 /nom de fichier vraiment tres tres tres long pour tenir sur plusieurs entrees 0xc1 - Copie (6) - Copie.txt
2015/09/18 10:49:12:000 a---- 0 0 /nom de fichier vraiment tres tres tres long pour tenir sur plusieurs entrees 0xc1 - Copie (7) - Copie.txt
2015/09/18 10:49:12:000 a---- 0 0 /nom de fichier vraiment tres tres tres long pour tenir sur plusieurs entrees 0xc1 - Copie (8) - Copie.txt
2015/09/18 10:49:12:000 a---- 0 0 /nom de fichier vraiment tres tres tres long pour tenir sur plusieurs entrees 0xc1 - Copie (9) - Copie.txt
2015/09/18 10:49:12:000 a---- 0 0 /nom de fichier vraiment tres tres tres long pour tenir sur plusieurs entrees 0xc1 - Copie (10) - Copie.txt
2015/09/18 10:49:12:000 a---- 0 0 /nom de fichier vraiment tres tres tres long pour tenir sur plusieurs entrees 0xc1 - Copie (11) - Copie.txt
2014/12/10 13:31:24:000 a---- 8021 407856 /NEWS.txt
2013/03/13 15:04:48:000 a---- 8973 2481152 /perl516.dll
2013/12/17 10:44:38:000 a---- 400 1613956 /CSIRT_setting_up_guide_ENISA-FR.pdf
2015/09/20 20:35:54:000 a---- 10185 8640336 /Andriller_v2.5.0.2_Setup.exe
Option -r is used to list recursively directories:
>python exfat_dump.py fls -r exfat12.001
2012/08/23 22:13:00:000 a---- 8 231936 /adencrypt_gui.exe
2012/08/23 22:12:52:000 a---- 122 7680 /adfs_globals.dll
2012/08/23 22:12:50:000 a---- 126 70144 /ADIsoDLL.dll
2012/08/23 22:13:06:000 a---- 161 377856 /adshattrdefs.dll
2015/09/17 21:25:44:183 -d--- 8004 2048 /empty_dir
2015/09/17 21:25:36:000 a---- 6608 12 /new_file.txt
2012/03/14 19:54:44:000 a---- 8005 31744 /da7zip.dll
2014/11/28 17:46:50:000 a---- 1189 12309315 /volatility_2.4.win.standalone.zip
2015/02/16 11:26:34:000 -d--- 7 4096 /langs
2012/08/20 22:41:04:000 a---- 346 6144 /langs/chs_adencrypt.dll
2012/08/20 22:41:04:000 a---- 349 104448 /langs/chs_adshattrdefs.dll
2015/09/18 10:49:12:000 a---- 0 0 /nom de fichier vraiment tres tres tres long pour tenir sur plusieurs entrees 0xc1 - Copie (5) - Copie.txt
2011/01/20 19:15:10:000 a---- 8510 946176 /cximage.dll
2015/09/18 10:49:12:000 a---- 0 0 /nom de fichier vraiment tres tres tres long pour tenir sur plusieurs entrees 0xc1 - Copie (4).txt
2015/09/18 10:49:12:000 a---- 0 0 /nom de fichier vraiment tres tres tres long pour tenir sur plusieurs entrees 0xc1 - Copie (4) - Copie.txt
2015/09/18 10:49:12:000 a---- 0 0 /nom de fichier vraiment tres tres tres long pour tenir sur plusieurs entrees 0xc1 - Copie (6) - Copie.txt
2015/09/18 10:49:12:000 a---- 0 0 /nom de fichier vraiment tres tres tres long pour tenir sur plusieurs entrees 0xc1 - Copie (7) - Copie.txt
2015/09/18 10:49:12:000 a---- 0 0 /nom de fichier vraiment tres tres tres long pour tenir sur plusieurs entrees 0xc1 - Copie (8) - Copie.txt
2015/09/18 10:49:12:000 a---- 0 0 /nom de fichier vraiment tres tres tres long pour tenir sur plusieurs entrees 0xc1 - Copie (9) - Copie.txt
2015/09/18 10:49:12:000 a---- 0 0 /nom de fichier vraiment tres tres tres long pour tenir sur plusieurs entrees 0xc1 - Copie (10) - Copie.txt
2015/09/18 10:49:12:000 a---- 0 0 /nom de fichier vraiment tres tres tres long pour tenir sur plusieurs entrees 0xc1 - Copie (11) - Copie.txt
2014/12/10 13:31:24:000 a---- 8021 407856 /NEWS.txt
2013/03/13 15:04:48:000 a---- 8973 2481152 /perl516.dll
2013/12/17 10:44:38:000 a---- 400 1613956 /CSIRT_setting_up_guide_ENISA-FR.pdf
2015/09/20 20:35:54:000 a---- 10185 8640336 /Andriller_v2.5.0.2_Setup.exe
With option -l, a lot more details can be displayed, (a)ccess and creation/(b)irth timestamps, secondary count (sc) value and cluster list method (FAT or NoFastChain -nfc-):
>python exfat_dump.py fls -l exfat12.001
i= 8 l= 231936 a---- m=2012/08/23 22:13:00:000 a=2015/09/17 21:24:50:000 b=2015/09/17 21:24:50:104 sc=3 nfc /adencrypt_gui.exe
i= 122 l= 7680 a---- m=2012/08/23 22:12:52:000 a=2015/09/17 21:25:06:000 b=2015/09/17 21:25:06:039 sc=3 nfc /adfs_globals.dll
i= 126 l= 70144 a---- m=2012/08/23 22:12:50:000 a=2015/09/17 21:25:06:000 b=2015/09/17 21:25:06:086 sc=2 nfc /ADIsoDLL.dll
i= 161 l= 377856 a---- m=2012/08/23 22:13:06:000 a=2015/09/17 21:25:06:000 b=2015/09/17 21:25:06:139 sc=3 nfc /adshattrdefs.dll
i= 8004 l= 2048 -d--- m=2015/09/17 21:25:44:183 a=2015/09/17 21:25:44:000 b=2015/09/17 21:25:44:183 sc=2 nfc /empty_dir
i= 6608 l= 12 a---- m=2015/09/17 21:25:36:000 a=2015/09/17 21:25:36:000 b=2015/09/17 21:25:22:054 sc=2 nfc /new_file.txt
i= 8005 l= 31744 a---- m=2012/03/14 19:54:44:000 a=2015/09/18 15:06:58:000 b=2015/09/18 15:06:58:032 sc=2 nfc /da7zip.dll
i= 1189 l=12309315 a---- m=2014/11/28 17:46:50:000 a=2015/10/02 17:30:40:000 b=2015/10/02 17:30:40:080 sc=4 fat /volatility_2.4.win.standalone.zip
i= 7 l= 4096 -d--- m=2015/02/16 11:26:34:000 a=2015/09/17 21:24:54:000 b=2015/09/17 21:24:54:147 sc=2 fat /langs
i= 0 l= 0 a---- m=2015/09/18 10:49:12:000 a=2015/09/18 15:07:50:000 b=2015/09/18 15:07:50:115 sc=8 fat /nom de fichier vraiment tres tres tres long pour tenir sur plusieurs entrees 0xc1 - Copie (5) - Copie.txt
i= 8510 l= 946176 a---- m=2011/01/20 19:15:10:000 a=2015/09/18 15:06:58:000 b=2015/09/18 15:06:58:143 sc=2 nfc /cximage.dll
i= 0 l= 0 a---- m=2015/09/18 10:49:12:000 a=2015/09/18 15:07:38:000 b=2015/09/18 15:07:38:093 sc=8 fat /nom de fichier vraiment tres tres tres l
