Difference between pages "Windows" and "FAT"

From ForensicsWiki
(Difference between pages)
Jump to: navigation, search
(User Account Control)
 
(External links)
 
Line 1: Line 1:
{{Expand}}
+
'''FAT''', or File Allocation Table, is a [[File Systems|file system]] that is designed to keep track of allocation status of clusters on a [[hard drive]].  Developed in 1977 by [[Microsoft]] Corporation, FAT was originally intended to be a [[File Systems|file system]] for the Microsoft Disk BASIC interpreter. FAT was quickly incorporated into an early version of Tim Patterson's QDOS, which was a moniker for "Quick and Dirty Operating System". [[Microsoft]] later purchased the rights to QDOS and released it under Microsoft branding as PC-DOS and later, MS-DOS. 
  
'''Windows''' is a widely-spread [[operating system]] from [[Microsoft]].
+
== Specification ==
  
There are 2 main branches of Windows:
+
FAT is described by Microsoft in [[Media:Fatgen103.doc|Microsoft's FAT32 specification]]. Despite the name, the document includes descriptions of FAT12 and FAT16.
* the DOS-branch: i.e. Windows 95, 98, ME
+
* the NT-branch: i.e. Windows NT 4, XP, Vista
+
  
== Features ==
+
Closely related standards are: ECMA 107 and ISO/EIC 9293, which only cover FAT12 and FAT16, and also are somewhat more restricted than the file system described by Microsoft's document.
* Basic and Dynamic Disks, see: [http://msdn.microsoft.com/en-us/library/windows/desktop/aa363785(v=vs.85).aspx]
+
  
=== Introduced in Windows NT ===
+
== Structure==
* [[NTFS]]
+
  
=== Introduced in Windows 2000 ===
+
{| style="text-align:center;" cellpadding="3" border="1px"
 +
| Boot sector
 +
| More reserved<br/> sectors (optional)
 +
| FAT #1
 +
| FAT #2
 +
| Root directory<br /> (FAT12/16 only)
 +
| Data region<br /> (rest of disk)
 +
|}
  
=== Introduced in Windows XP ===
+
=== Boot Record ===
* [[Prefetch]]
+
When a computer is powered on, a POST (power-on self test) is performed, and control is then transferred to the [[Master boot record]] ([[MBR]]).  The [[MBR]] is present no matter what file system is in use, and contains information about how the storage device is logically partitioned.  When using a FAT file system, the [[MBR]] hands off control of the computer to the Boot Record, which is the first sector on the partition. The Boot Record, which occupies a reserved area on the partition, contains executable code, in addition to information such as an OEM identifier, number of FATs, media descriptor (type of storage device), and information about the operating system to be booted. Once the Boot Record code executes, control is handed off to the operating system installed on that partition.
* System Restore (Restore Points); also present in Windows ME
+
  
==== SP2 ====
+
=== FATs ===
* Windows Firewall
+
The primary task of the File Alocation Tables are to keep track of the allocation status of clusters, or logical groupings of sectors, on the disk drive.  There are four different possible FAT entries: allocated (along with the address of the next cluster associated with the file), unallocated, end of file, and bad sector.
  
=== Introduced in Windows Server 2003 ===
+
In order to provide redundancy in case of data corruption, two FATs, FAT1 and FAT2, are stored in the file system. FAT2 is a typically a duplicate of FAT1. However, FAT mirroring can be disabled on a FAT32 drive, thus enabling any of the FATs to become the Primary FAT. This possibly leaves FAT1 empty, which can be deceiving.
* Volume Shadow Copies
+
  
=== Introduced in [[Windows Vista]] ===  
+
=== Root Directory ===
* [[BitLocker Disk Encryption | BitLocker]]
+
The Root Directory, sometimes referred to as the Root Folder, contains an entry for each file and directory stored in the file system.  This information includes the file name, starting cluster number, and file size. This information is changed whenever a file is created or subsequently modified. Root directory has a fixed size of 512 entries on a hard disk and the size on a floppy disk depends.  With FAT32 it can be stored anywhere within the partition, although in previous versions it is always located immediately following the FAT region.
* [[Windows Desktop Search | Search]] integrated in operating system
+
* [[ReadyBoost]]
+
* [[SuperFetch]]
+
* [[NTFS|Transactional NTFS (TxF)]]
+
* [[Windows NT Registry File (REGF)|Transactional Registry (TxR)]]
+
* [[Windows Shadow Volumes|Shadow Volumes]]; the volume-based storage of the Volume Shadow Copy data
+
* $Recycle.Bin
+
* [[Windows XML Event Log (EVTX)]]
+
* [[User Account Control (UAC)]]
+
  
=== Introduced in Windows Server 2008 ===
+
=== Data Area ===
  
=== Introduced in [[Windows 7]] ===
+
The Boot Record, FATs, and Root Directory are collectively referred to as the System Area.  The remaining space on the logical drive is called the Data Area, which is where files are actually stored.  It should be noted that when a file is deleted by the operating system, the data stored in the Data Area remains intact until it is overwritten.
* [[BitLocker Disk Encryption | BitLocker To Go]]
+
* [[Jump Lists]]
+
* [[Sticky Notes]]
+
  
=== Introduced in [[Windows 8]] ===
+
=== Clusters ===
* [[Windows File History | File History]]
+
In order for FAT to manage files with satisfactory efficiency, it groups sectors into larger blocks referred to as clusters. A cluster is the smallest unit of disk space that can be allocated to a file, which is why clusters are often called allocation units. Each cluster can be used by one and only one resident file. Only the "data area" is divided into clusters, the rest of the partition is simply sectors. Cluster size is determined by the size of the disk volume and every file must be allocated an even number of clusters. Cluster sizing has a significant impact on performance and disk utilization. Larger cluster sizes result in more wasted space because files are less likely to fill up an even number of clusters.  
* [[Windows Storage Spaces | Storage Spaces]]
+
* [[Search Charm History]]
+
* [[Resilient File System (ReFS)]]; Was initially available in the Windows 8 server edition.
+
  
=== Introduced in Windows Server 2012 ===
+
The size of one cluster is specified in the Boot Record and can range from a single sector (512 bytes) to 128 sectors (65536 bytes). The sectors in a cluster are continuous, therefore each cluster is a continuous block of space on the disk.  Note that only one file can be allocated to a cluster.  Therefore if a 1KB file is placed within a 32KB cluster there are 31KB of wasted space. The formula for determining clusters in a partition is (# of Sectors in Partition) - (# of Sectors per Fat * 2) - (# of Reserved Sectors) ) /  (# of Sectors per Cluster).
* [[Resilient File System (ReFS)]]
+
  
== Forensics ==
+
=== Wasted Sectors ===
  
=== Partition layout ===
+
'''Wasted Sectors''' (a.k.a. '''partition [[slack]]''') are a result of the number of data sectors not being evenly distributed by the cluster size. It's made up of unused bytes left at the end of a file. Also, if the partition as declared in the partition table is larger than what is claimed in the Boot Record the volume can be said to have wasted sectors. Small files on a hard drive are the reason for wasted space and the bigger the hard drive the more wasted space there is. 
Default partition layout, first partition starts:
+
* at sector 63 in Windows 2000, XP, 2003
+
* at sector 2048 in Windows Vista, 2008, 7
+
  
=== Filesystems ===
+
=== FAT Entry Values ===
* [[FAT]], [[FAT|exFAT]]
+
<br>
* [[NTFS]]
+
FAT12<br>
* [[Resilient File System (ReFS) | ReFS]]
+
<br>
 +
0x000          (Free Cluster)<br>   
 +
0x001          (Reserved Cluster)<br>
 +
0x002 - 0xFEF  (Used cluster; value points to next cluster)<br>
 +
0xFF0 - 0xFF6  (Reserved values)<br>
 +
0xFF7          (Bad cluster)<br>
 +
0xFF8 - 0xFFF  (Last cluster in file)<br>
 +
<br>
 +
FAT16<br>
 +
<br>
 +
0x0000          (Free Cluster)<br>
 +
0x0001          (Reserved Cluster)<br>
 +
0x0002 - 0xFFEF  (Used cluster; value points to next cluster)<br>
 +
0xFFF0 - 0xFFF6  (Reserved values)<br>
 +
0xFFF7          (Bad cluster)<br>
 +
0xFFF8 - 0xFFFF  (Last cluster in file)<br>
 +
<br>
 +
FAT32<br>
 +
<br>
 +
0x?0000000              (Free Cluster)<br>
 +
0x?0000001              (Reserved Cluster)<br>
 +
0x?0000002 - 0x?FFFFFEF  (Used cluster; value points to next cluster)<br>
 +
0x?FFFFFF0 - 0x?FFFFFF6  (Reserved values)<br>
 +
0x?FFFFFF7              (Bad cluster)<br>
 +
0x?FFFFFF8 - 0x?FFFFFFF  (Last cluster in file)
  
=== Recycle Bin ===
+
Note: FAT32 uses only 28 of 32 possible bits, the upper 4 bits should be left alone. Typically these bits are zero, and are represented above by a question mark (?).
  
==== RECYCLER ====
+
==Versions==
Used by Windows 2000, XP.
+
Uses INFO2 file.
+
  
See: [http://www.cybersecurityinstitute.biz/downloads/INFO2.pdf]
+
There are three variants of FAT in existence: FAT12, FAT16, and FAT32.
  
==== $RECYCLE.BIN ====
+
=== FAT12 ===
Used by Windows Vista.
+
*  FAT12 is the oldest type of FAT that uses a 12 bit file allocation table entry.
Uses $I and $R files.
+
*  FAT12 can hold a max of 4,084 clusters (which is 2<sup>12</sup> clusters minus a few values that are reserved for values used in  the FAT). 
 +
*  It is used for floppy disks and hard drive partitions that are smaller than 16 MB. 
 +
*  All 1.44 MB 3.5" floppy disks are formatted using FAT12.
 +
*  Cluster size that is used is between 0.5 KB to 4 KB.
  
See: [http://www.forensicfocus.com/downloads/forensic-analysis-vista-recycle-bin.pdf]
+
=== FAT16 ===
 +
*  It is called FAT16 because all entries are 16 bit.
 +
*  FAT16 can hold a max of 65,524 addressable units
 +
*  It is used for small and moderate sized hard disk volumes.
  
=== Registry ===
+
=== FAT32 ===
 +
FAT32 is the enhanced version of the FAT system implemented beginning with Windows 95 OSR2, Windows 98, and Windows Me.
 +
Features include:
 +
*  Drives of up to 2 terabytes are supported ([[Windows]] 2000 only supports up to 32 gigabytes)
 +
*  Since FAT32 uses smaller clusters (of 4 kilobytes each), it uses hard drive space more efficiently. This is a 10 to 15 percent improvement over FAT or FAT16.
 +
*  The limitations of FAT or FAT 16 on the number of root folder entries have been eliminated. In FAT32, the root folder is an ordinary cluster chain, and can be located anywhere on the drive.
 +
*  File allocation mirroring can be disabled in FAT32. This allows a different copy of the file allocation table then the default to be active.
  
The [[Windows Registry]] is a database of keys and values that provides a wealth of information to forensic [[investigator]]s.
+
==== Limitations with [[Windows]] 2000 & [[Windows]] XP ====
 +
* Clusters cannot be 64KB or larger.
 +
* Cannot decrease cluster size that will result in the the FAT being larger than 16 MB minus 64KB in size.
 +
* Cannot contain fewer than 65,527 clusters.
 +
* Maximum of 32KB per cluster.
 +
* ''[[Windows]] XP'': The Windows XP installation program will not allow a user to format a drive of more than 32GB using the FAT32 file system. Using the installation program, the only way to format a disk greater than 32GB in size is to use NTFS. A disk larger than 32GB in size ''can'' be formatted with FAT32 for use with Windows XP if the system is booted from a Windows 98 or Windows ME startup disk, and formatted using the tool that will be on the disk.
  
=== Thumbs.db Files ===
+
=== exFAT (sometimes incorrectly called FAT64) ===
 +
exFAT (also know as Extended File Allocation Table or exFAT) is Microsoft's latest version of FAT and works with Windows Embedded CE 6.0, Windows XP/Server 2003 (with a KB patch, Vista/Server 2008 SP 1 & Later, and Windows 7.
 +
Features include:
 +
*  Largest file size is 2<sup>64</sup> bytes (16 exabytes) vs. FAT32's maximum file size of 4GB.
 +
*  Has transaction support using Transaction-Safe Extended FAT File System (TexFAT). (Not released yet in Desktop/Server OS)
 +
*  Speeds up storage allocation processes by using free space bitmaps.
 +
*  Support UTC timestamps (Vista/Server 2008 SP1 does not support UTC, UTC support came out with SP2)
 +
*  Maximum Cluster size of 32MB (Fat32 is 32KB)
 +
*  Sector sizes from 512 bytes to 4096 bytes in size
 +
*  Maximum FAT supportable volume size of 128PB
 +
*  Maximum Subdirectory size of 256MB which can support up to over 2 million files in a singlr subdirectory
 +
*  Uses a Bitmap for cluster allocation
 +
*  Supports File Permissions (Not released yet in Desktop/Server OS)
 +
*  Has been selected as the exclusive file system of the SDXC memory card by the SD Association
  
[[Thumbs.db]] files can be found on many Windows systems. They contain thumbnails of images or documents and can be of great value for the [[investigator]].
+
Although Microsoft has published some information on exFAT, there are more technical specifications available from third parties. For example, here is a  [http://paradigmsolutions.files.wordpress.com/2009/12/exfat-excerpt-1-4.pdf detailed presentation on exFAT].
  
See also: [[Vista thumbcache]].
+
Another published technical paper that goes in the internals in great detail is in the SANS Reading Room at: [http://www.sans.org/reading_room/whitepapers/forensics/rss/reverse_engineering_the_microsoft_exfat_file_system_33274 Reverse Engineering the Microsoft exFAT File System]
  
=== Browser Cache ===
+
=== Comparison of FAT Versions ===
  
=== Browser History ===
+
See the table at http://en.wikipedia.org/wiki/File_Allocation_Table for more detailed information about the various versions of FAT.
  
The [[Web Browser History]] files can contain significant information. The default [[Web browser|web browser]] that comes with Windows is [[Internet Explorer|Microsoft Internet Explorer]] but other common browsers on Windows are [[Apple Safari]], [[Google Chrome]], [[Mozilla Firefox]] and [[Opera]].
+
== Uses ==
 +
Due to its low cost, mobility, and non-volatile nature, flash memory has quickly become the choice medium for storing and transferring data in consumer electronic devices. The majority of flash memory storage is formatted using the FAT file system.  In addition, FAT is also frequently used in electronic devices with miniature hard drives.
  
=== Search ===
+
Examples of devices in which FAT is utilized include:
See [[Windows Desktop Search]]
+
  
=== Setup log files (setupapi.log) ===
+
* [[USB]] thumb drives
Windows Vista introduced several setup log files [http://support.microsoft.com/kb/927521].
+
* [[Digital camera|Digital cameras]]
 +
* Digital camcorders
 +
* Portable audio and video players
 +
* Multifunction [[printers]]
 +
* Electronic photo frames
 +
* Electronic musical instruments
 +
* Standard televisions
 +
* [[PDAs]]
  
=== Sleep/Hibernation ===
+
==Data Recovery==
 +
Recovering directory entries from FAT filesystems as part of [[recovering deleted data]] can be accomplished by looking for entries that begin with a sigma 0xe5. When a file or directory is deleted under a FAT filesystem, the first character of its name is changed to sigma. The remainder of the directory entry information remains intact.
  
After (at least) Windows 7 recovers from sleep/hibernation there often is a system time change event (event id 1) in the event logs.
+
The pointers are also changed to zero for each cluster used by the file.  Recovery tools look at the FAT to find the entry for the file.  The location of the starting cluster will still be in the directory file.  It is not deleted or modified.  The tool will go straight to that cluster and try to recover the file using the file size to determine the number of clusters to recover.  Some tools will go to the starting cluster and recover the next "X" number of clusters needed for the specific file size.  However, this tool is not ideal.  An ideal tool will locate "X" number of available clusters.  Since files are most often fragmented, this will be a more precise way to recover the file.
  
=== Users ===
+
An issue arises when two files in the same row of clusters are deleted.  If the clusters are not in sequential order, the tool will automatically receive "X" number of clusters.  However, because the file was fragmented, it's most likely that all the clusters obtained will not all contain data for that file.  If these two deleted files are in the same row of clusters, it is highly unlikely the file can be recovered.
Windows stores a users Security identifiers (SIDs) under the following registry key:
+
<pre>
+
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
+
</pre>
+
  
The %SID%\ProfileImagePath value should also contain the username.
+
==File [[Slack]]==
 +
File [[slack]] is data that starts from the end of the file written and continues to the end of the sectors designated to the file. There are two types of file [[slack]], RAM slack and Residual [[slack]]. RAM slack starts from the end of the file and goes to the end of that sector. Residual slack then starts at the next sector and goes to the end of the cluster allocated for the file.  File slack is a helpful tool when analyzing a hard drive because the old data that is not overwritten by the new file is still in tact. Go to http://www.pcguide.com/ref/hdd/file/partSizes-c.html for examples.
  
=== Windows Error Reporting (WER) ===
 
  
As of Vista, for User Access Control (UAC) elevated applications WER reports can be found in:
+
<table border="1" cellspacing="2" bordercolor="#000000" cellpadding="4" width="468" bordercolorlight="#C0C0C0">
<pre>
+
  <tr>
C:\ProgramData\Microsoft\Windows\WER\
+
    <td width="101" bgcolor="#808080"><font size="2"><b><center>Cluster</center></b></font></td>
</pre>
+
    <td width="177" bgcolor="#808080"><font size="2"><b><center>Sample Slack Space,
 +
    50% Cluster Slack Per File</center></b></font></td>
 +
    <td width="178" bgcolor="#808080"><font size="2"><b><center>Sample Slack Space,
 +
    67% Cluster Slack Per File</center></b></font></td>
 +
  </tr>
 +
  <tr>
 +
    <td width="101" bgcolor="#C0C0C0"><font size="2"><b><center>2 kiB</center></b></font></td>
 +
    <td width="177"><font size="2"><center>17 MB</center></font></td>
 +
    <td width="178"><font size="2"><center>22 MB</center></font></td>
 +
  </tr>
 +
  <tr>
 +
    <td width="101" bgcolor="#C0C0C0"><font size="2"><b><center>4 kiB</center></b></font></td>
 +
    <td width="177"><font size="2"><center>33 MB</center></font></td>
 +
    <td width="178"><font size="2"><center>44 MB</center></font></td>
 +
  </tr>
 +
  <tr>
 +
    <td width="101" bgcolor="#C0C0C0"><font size="2"><b><center>8 kiB</center></b></font></td>
 +
    <td width="177"><font size="2"><center>66 MB</center></font></td>
 +
    <td width="178"><font size="2"><center>89 MB</center></font></td>
 +
  </tr>
 +
  <tr>
 +
    <td width="101" bgcolor="#C0C0C0"><font size="2"><b><center>16 kiB</center></b></font></td>
 +
    <td width="177"><font size="2"><center>133 MB</center></font></td>
 +
    <td width="178"><font size="2"><center>177 MB</center></font></td>
 +
  </tr>
 +
  <tr>
 +
    <td width="101" bgcolor="#C0C0C0"><font size="2"><b><center>32 kiB</center></b></font></td>
 +
    <td width="177"><font size="2"><center>265 MB</center></font></td>
 +
    <td width="178"><font size="2"><center>354 MB</center></font></td>
 +
  </tr>
 +
</table>
  
As of Vista, for non-UAC elevated applications (LUA) WER reports can be found in:
+
The diagram above demonstrates the larger the cluster size used, the more disk space is wasted due to slack. This suggests it is better to use smaller cluster sizes whenever possible.
<pre>
+
C:\Users\%UserName%\AppData\Local\Microsoft\Windows\WER\
+
</pre>
+
  
Corresponding registry key:
+
==FAT Advantages==
<pre>
+
*  Files available to multiple operating systems on the same computer
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting
+
*  Easier to switch from FAT to [[NTFS]] than vice versa
</pre>
+
*  Performs faster on smaller volumes (< 10GB)
 +
*  Does not index files, which causes slightly higher performance
 +
*  Performs better with small cache sizes (< 96MB)
 +
*  More space-efficient on small volumes (< 4GB)
 +
*  Performs better with slow disks (< 5400RPM)
  
== Advanced Format (4KB Sector) Hard Drives ==
+
==FAT Disadvantages==
Windows XP does not natively handle drives that use the new standard of 4KB sectors. For information on this, see [[Advanced Format]].
+
*  FAT has a fixed maximum number of clusters per partition, which means as the hard disk gets bigger the size of each cluster must increase, creating more slack space
 +
*  Doesn't natively support many abilities of [[NTFS]] such as on-the-fly compression, [[encryption]], or advanced security using access control lists
 +
*  [[NTFS]] recommended by [[Microsoft]] for volumes larger than 32GB
 +
*  FAT slows down as the number of files on the disk increases
 +
*  FAT usually fragments files more
 +
*  FAT does not allow for indexing of files for faster searching
 +
*  FAT does not support user quotas
 +
*  FAT has minimal security features including no access control list (ACL) capability.
  
== %SystemRoot% ==
+
== External links ==
The actual value of %SystemRoot% is store in the following registry value:
+
* http://en.wikipedia.org/wiki/File_Allocation_Table
<pre>
+
* http://www.microsoft.com
Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\
+
* http://www.ntfs.com
Value: SystemRoot
+
* http://www.ntfs.com/ntfs_vs_fat.htm
</pre>
+
* http://support.microsoft.com/kb/q154997/#XSLTH3126121123120121120120
 +
* http://www.dewassoc.com/kbase/hard_drives/boot_sector.htm
 +
* http://home.teleport.com/~brainy/fat32.htm
 +
* http://www2.tech.purdue.edu/cpt/courses/cpt499s/
 +
* http://home.no.net/tkos/info/fat.html
 +
* http://web.ukonline.co.uk/cook/fat32.htm
 +
* http://www.ntfs.com/fat-systems.htm
 +
* http://www.microsoft.com/whdc/system/platform/firmware/fatgen.mspx
 +
* http://support.microsoft.com/kb/q140418
  
== See Also ==
+
=== ExFAT ===
* [[Windows Event Log (EVT)]]
+
* [http://en.wikipedia.org/wiki/ExFAT Wikipedia: ExFAT]
* [[Windows XML Event Log (EVTX)]]
+
* [http://www.active-undelete.com/xfat_volume.htm exFAT File System]
* [[Windows Vista]]
+
* [http://www.sans.org/reading-room/whitepapers/forensics/reverse-engineering-microsoft-exfat-file-system-33274 Reverse Engineering the Microsoft exFAT File System], by [[Robert Shullich]], December 1, 2009
* [[Windows 7]]
+
* [http://paradigmsolutions.files.wordpress.com/2009/12/exfat-excerpt-1-4.pdf Extended FAT file system], by [[Jeff Hamm]], December 2009
* [[Windows 8]]
+
* [http://www.slideshare.net/overcertified/demystifying-the-microsoft-extended-fat-file-system-exfat Demystifying the Microsoft Extended FAT File System (exFAT)], by [[Robert Shullich]], September 20, 2010
 +
* [http://aut.researchgateway.ac.nz/bitstream/handle/10292/4123/LeY.pdf Windows Phone 7 : Implications For Digital Forensic Investigators], by [[Yung Anh Le]], 2012
  
== External Links ==
+
=== textFAT ===
 +
* [http://msdn.microsoft.com/en-us/library/ee490643(v=winembedded.60).aspx TexFAT Overview (Windows Embedded CE 6.0)], by [[Microsoft]]
 +
* [http://www.ntfs.com/exfat-textFAT-padding.htm TexFAT Padding Directory Entry]
  
* [http://en.wikipedia.org/wiki/Microsoft_Windows Wikipedia: Microsoft Windows]
+
== Tools ==
* [http://support.microsoft.com/kb/927521 Windows 7, Windows Server 2008 R2, and Windows Vista setup log file locations]
+
=== exFAT ===
* [http://www.forensicfocus.com/downloads/forensic-analysis-vista-recycle-bin.pdf The Forensic Analysis of the Microsoft Windows Vista Recycle Bin], by [[Mitchell Machor]], 2008
+
* [http://code.google.com/p/exfat/ Open Source exFAT file system implementation]
* [http://www.ericjhuber.com/2013/02/microsoft-file-system-tunneling.html?m=1 Microsoft Windows File System Tunneling], by [[Eric Huber]], February 24, 2013
+
* [http://www.nsa.gov/ia/_files/app/Spotting_the_Adversary_with_Windows_Event_Log_Monitoring.pdf Spotting the Adversary with Windows Event Log Monitoring], by National Security Agency/Central Security Service, February 28, 2013
+
  
=== Malware/Rootkits ===
+
[[Category:File Systems]]
* [http://forensicmethods.com/inside-windows-rootkits Inside Windows Rootkits], by [[Chad Tilbury]], September 4, 2013
+
 
+
=== Program execution ===
+
* [http://windowsir.blogspot.com/2013/07/howto-determine-program-execution.html HowTo: Determine Program Execution], by [[Harlan Carvey]], July 06, 2013
+
* [http://journeyintoir.blogspot.com/2014/01/it-is-all-about-program-execution.html It Is All About Program Execution], by [[Corey Harrell]], January 14, 2014
+
* [http://sysforensics.org/2014/01/know-your-windows-processes.html Know your Windows Processes or Die Trying], by [[Patrick Olsen]], January 18, 2014
+
 
+
=== Tracking removable media ===
+
* [http://www.swiftforensics.com/2012/08/tracking-usb-first-insertion-in-event.html Tracking USB First insertion in Event logs], by Yogesh Khatri, August 18, 2012
+
 
+
=== Under the hood ===
+
* [http://msdn.microsoft.com/en-us/library/windows/desktop/aa366533(v=vs.85).aspx MSDN: Comparing Memory Allocation Methods], by [[Microsoft]]
+
* [http://blogs.msdn.com/b/ntdebugging/archive/2007/06/28/how-windows-starts-up-part-the-second.aspx How Windows Starts Up (Part the second)]
+
* [http://msdn.microsoft.com/en-us/library/aa375142.aspx DLL/COM Redirection]
+
* [http://msdn.microsoft.com/en-us/library/windows/desktop/ms682586(v=vs.85).aspx Dynamic-Link Library Search Order]
+
* [http://blogs.msdn.com/b/junfeng/archive/2004/04/28/121871.aspx Image File Execution Options]
+
 
+
==== MSI ====
+
* [http://blogs.msdn.com/b/heaths/archive/2009/02/02/changes-to-package-caching-in-windows-installer-5-0.aspx?Redirected=true Changes to Package Caching in Windows Installer 5.0], by Heath Stewart, February 2, 2009
+
* [http://blog.didierstevens.com/2013/07/26/msi-the-case-of-the-invalid-signature/ MSI: The Case Of The Invalid Signature], by Didier Stevens, July 26, 2013
+
 
+
==== Side-by-side (WinSxS) ====
+
* [http://en.wikipedia.org/wiki/Side-by-side_assembly Wikipedia: Side-by-side assembly]
+
* [http://msdn.microsoft.com/en-us/library/aa374224.aspx Assembly Searching Sequence]
+
* [http://blogs.msdn.com/b/junfeng/archive/2007/06/26/rt-manifest-resource-and-isolation-aware-enabled.aspx RT_MANIFEST resource, and ISOLATION_AWARE_ENABLED]
+
* [http://msdn.microsoft.com/en-us/library/windows/desktop/dd408052(v=vs.85).aspx Isolated Applications and Side-by-side Assemblies]
+
* [http://blogs.msdn.com/b/junfeng/archive/2006/01/24/517221.aspx#531208 DotLocal (.local) Dll Redirection], by [[Junfeng Zhang]], January 24, 2006
+
* [http://blogs.msdn.com/b/junfeng/archive/2006/04/14/576314.aspx Diagnosing SideBySide failures], by [[Junfeng Zhang]], April 14, 2006
+
* [http://omnicognate.wordpress.com/2009/10/05/winsxs/ EVERYTHING YOU NEVER WANTED TO KNOW ABOUT WINSXS]
+
 
+
==== Application Experience and Compatibility ====
+
* [http://technet.microsoft.com/en-us/library/dd837644(v=ws.10).aspx Technet: Understanding Shims], by [[Microsoft]]
+
* [http://msdn.microsoft.com/en-us/library/bb432182(v=vs.85).aspx MSDN: Application Compatibility Database], by [[Microsoft]]
+
* [http://www.alex-ionescu.com/?p=39 Secrets of the Application Compatilibity Database (SDB) – Part 1], by [[Alex Ionescu]], May 20, 2007
+
* [http://www.alex-ionescu.com/?p=40 Secrets of the Application Compatilibity Database (SDB) – Part 2], by [[Alex Ionescu]], May 21, 2007
+
* [https://dl.mandiant.com/EE/library/Whitepaper_ShimCacheParser.pdf Leveraging the Application Compatibility Cache in Forensic Investigations], by [[Andrew Davis]], May 4, 2012
+
* [http://journeyintoir.blogspot.ch/2013/12/revealing-recentfilecachebcf-file.html Revealing the RecentFileCache.bcf File], by [[Corey Harrell]], December 2, 2013
+
* [http://journeyintoir.blogspot.ch/2013/12/revealing-program-compatibility.html Revealing Program Compatibility Assistant HKCU AppCompatFlags Registry Keys], by [[Corey Harrell]], December 17, 2013
+
 
+
==== System Restore (Restore Points) ====
+
* [http://en.wikipedia.org/wiki/System_Restore Wikipedia: System Restore]
+
* [http://www.stevebunting.org/udpd4n6/forensics/restorepoints.htm Restore Point Forensics], by [[Steve Bunting]]
+
* [http://windowsir.blogspot.ch/2007/06/restore-point-analysis.html Restore Point Analysis], by [[Harlan Carvey]],  June 16, 2007
+
* [http://windowsir.blogspot.ch/2006/10/restore-point-forensics.html Restore Point Forensics], by [[Harlan Carvey]], October 20, 2006
+
* [http://www.ediscovery.co.nz/wip/srp.html System Restore Point Log Decoding]
+
 
+
==== Crash dumps ====
+
* [http://blogs.technet.com/b/yongrhee/archive/2010/12/29/drwtsn32-on-windows-vista-windows-server-2008-windows-7-windows-server-2008-r2.aspx Technet: Drwtsn32 on Windows Vista/Windows Server 2008/Windows 7/Windows Server 2008 R2], by Yong Rhee, December 29, 2010
+
* [http://support.microsoft.com/kb/315263 MSDN: How to read the small memory dump file that is created by Windows if a crash occurs], by [[Microsoft]]
+
 
+
==== RPC ====
+
* [http://blogs.technet.com/b/networking/archive/2008/10/24/rpc-to-go-v-1.aspx RPC to Go v.1], by Michael Platts, October 24, 2008
+
* [http://blogs.technet.com/b/networking/archive/2008/12/04/rpc-to-go-v-2.aspx RPC to Go v.2], by Michael Platts, December 4, 2008
+
 
+
==== User Account Control (UAC) ====
+
* [http://blog.strategiccyber.com/2014/03/20/user-account-control-what-penetration-testers-should-know/ User Account Control – What Penetration Testers Should Know], by Raphael Mudge, March 20, 2014
+
 
+
==== Windows Scripting Host ====
+
* [https://www.mandiant.com/blog/ground-windows-scripting-host-wsh/ Going To Ground with The Windows Scripting Host (WSH)], by Devon Kerr, February 19, 2014
+
 
+
==== USB ====
+
* [https://blogs.sans.org/computer-forensics/files/2009/09/USBKEY-Guide.pdf USBKEY Guide], by [[SANS | SANS Institute - Digital Forensics and Incident Response]], September 2009
+
* [https://blogs.sans.org/computer-forensics/files/2009/09/USB_Drive_Enclosure-Guide.pdf USB Drive Enclosure Guide], by [[SANS | SANS Institute - Digital Forensics and Incident Response]], September 2009
+
 
+
==== WMI ====
+
* [http://www.trendmicro.com/cloud-content/us/pdfs/security-intelligence/white-papers/wp__understanding-wmi-malware.pdf Understanding WMI Malware], by Julius Dizon, Lennard Galang, and Marvin Cruz, July 2010
+
 
+
==== Windows Error Reporting (WER) ====
+
* [http://blogs.technet.com/b/yongrhee/archive/2010/12/29/drwtsn32-on-windows-vista-windows-server-2008-windows-7-windows-server-2008-r2.aspx Drwtsn32 on Windows Vista/Windows Server 2008/Windows 7/Windows Server 2008 R2], by Yong Rhee, December 29, 2010
+
* [http://journeyintoir.blogspot.ch/2014/02/exploring-windows-error-reporting.html Exploring Windows Error Reporting], by [[Corey Harrell]], February 24, 2014
+
 
+
==== Windows Firewall ====
+
* [http://en.wikipedia.org/wiki/Windows_Firewall Wikipedia: Windows Firewall]
+
* [http://technet.microsoft.com/en-us/library/cc737845(v=ws.10).aspx#BKMK_log Windows Firewall Tools and Settings]
+
 
+
==== Windows 32-bit on Windows 64-bit (WoW64) ====
+
* [http://en.wikipedia.org/wiki/WoW64 Wikipedia: WoW64]
+
 
+
=== Windows XP ===
+
* [http://support.microsoft.com/kb/q308549 Description of Windows XP System Information (Msinfo32.exe) Tool]
+
 
+
[[Category:Operating systems]]
+

Revision as of 02:00, 23 June 2014

FAT, or File Allocation Table, is a file system that is designed to keep track of allocation status of clusters on a hard drive. Developed in 1977 by Microsoft Corporation, FAT was originally intended to be a file system for the Microsoft Disk BASIC interpreter. FAT was quickly incorporated into an early version of Tim Patterson's QDOS, which was a moniker for "Quick and Dirty Operating System". Microsoft later purchased the rights to QDOS and released it under Microsoft branding as PC-DOS and later, MS-DOS.

Specification

FAT is described by Microsoft in Microsoft's FAT32 specification. Despite the name, the document includes descriptions of FAT12 and FAT16.

Closely related standards are: ECMA 107 and ISO/EIC 9293, which only cover FAT12 and FAT16, and also are somewhat more restricted than the file system described by Microsoft's document.

Structure

Boot sector More reserved
sectors (optional)
FAT #1 FAT #2 Root directory
(FAT12/16 only)
Data region
(rest of disk)

Boot Record

When a computer is powered on, a POST (power-on self test) is performed, and control is then transferred to the Master boot record (MBR). The MBR is present no matter what file system is in use, and contains information about how the storage device is logically partitioned. When using a FAT file system, the MBR hands off control of the computer to the Boot Record, which is the first sector on the partition. The Boot Record, which occupies a reserved area on the partition, contains executable code, in addition to information such as an OEM identifier, number of FATs, media descriptor (type of storage device), and information about the operating system to be booted. Once the Boot Record code executes, control is handed off to the operating system installed on that partition.

FATs

The primary task of the File Alocation Tables are to keep track of the allocation status of clusters, or logical groupings of sectors, on the disk drive. There are four different possible FAT entries: allocated (along with the address of the next cluster associated with the file), unallocated, end of file, and bad sector.

In order to provide redundancy in case of data corruption, two FATs, FAT1 and FAT2, are stored in the file system. FAT2 is a typically a duplicate of FAT1. However, FAT mirroring can be disabled on a FAT32 drive, thus enabling any of the FATs to become the Primary FAT. This possibly leaves FAT1 empty, which can be deceiving.

Root Directory

The Root Directory, sometimes referred to as the Root Folder, contains an entry for each file and directory stored in the file system. This information includes the file name, starting cluster number, and file size. This information is changed whenever a file is created or subsequently modified. Root directory has a fixed size of 512 entries on a hard disk and the size on a floppy disk depends. With FAT32 it can be stored anywhere within the partition, although in previous versions it is always located immediately following the FAT region.

Data Area

The Boot Record, FATs, and Root Directory are collectively referred to as the System Area. The remaining space on the logical drive is called the Data Area, which is where files are actually stored. It should be noted that when a file is deleted by the operating system, the data stored in the Data Area remains intact until it is overwritten.

Clusters

In order for FAT to manage files with satisfactory efficiency, it groups sectors into larger blocks referred to as clusters. A cluster is the smallest unit of disk space that can be allocated to a file, which is why clusters are often called allocation units. Each cluster can be used by one and only one resident file. Only the "data area" is divided into clusters, the rest of the partition is simply sectors. Cluster size is determined by the size of the disk volume and every file must be allocated an even number of clusters. Cluster sizing has a significant impact on performance and disk utilization. Larger cluster sizes result in more wasted space because files are less likely to fill up an even number of clusters.

The size of one cluster is specified in the Boot Record and can range from a single sector (512 bytes) to 128 sectors (65536 bytes). The sectors in a cluster are continuous, therefore each cluster is a continuous block of space on the disk. Note that only one file can be allocated to a cluster. Therefore if a 1KB file is placed within a 32KB cluster there are 31KB of wasted space. The formula for determining clusters in a partition is (# of Sectors in Partition) - (# of Sectors per Fat * 2) - (# of Reserved Sectors) ) / (# of Sectors per Cluster).

Wasted Sectors

Wasted Sectors (a.k.a. partition slack) are a result of the number of data sectors not being evenly distributed by the cluster size. It's made up of unused bytes left at the end of a file. Also, if the partition as declared in the partition table is larger than what is claimed in the Boot Record the volume can be said to have wasted sectors. Small files on a hard drive are the reason for wasted space and the bigger the hard drive the more wasted space there is.

FAT Entry Values


FAT12

0x000 (Free Cluster)
0x001 (Reserved Cluster)
0x002 - 0xFEF (Used cluster; value points to next cluster)
0xFF0 - 0xFF6 (Reserved values)
0xFF7 (Bad cluster)
0xFF8 - 0xFFF (Last cluster in file)

FAT16

0x0000 (Free Cluster)
0x0001 (Reserved Cluster)
0x0002 - 0xFFEF (Used cluster; value points to next cluster)
0xFFF0 - 0xFFF6 (Reserved values)
0xFFF7 (Bad cluster)
0xFFF8 - 0xFFFF (Last cluster in file)

FAT32

0x?0000000 (Free Cluster)
0x?0000001 (Reserved Cluster)
0x?0000002 - 0x?FFFFFEF (Used cluster; value points to next cluster)
0x?FFFFFF0 - 0x?FFFFFF6 (Reserved values)
0x?FFFFFF7 (Bad cluster)
0x?FFFFFF8 - 0x?FFFFFFF (Last cluster in file)

Note: FAT32 uses only 28 of 32 possible bits, the upper 4 bits should be left alone. Typically these bits are zero, and are represented above by a question mark (?).

Versions

There are three variants of FAT in existence: FAT12, FAT16, and FAT32.

FAT12

  • FAT12 is the oldest type of FAT that uses a 12 bit file allocation table entry.
  • FAT12 can hold a max of 4,084 clusters (which is 212 clusters minus a few values that are reserved for values used in the FAT).
  • It is used for floppy disks and hard drive partitions that are smaller than 16 MB.
  • All 1.44 MB 3.5" floppy disks are formatted using FAT12.
  • Cluster size that is used is between 0.5 KB to 4 KB.

FAT16

  • It is called FAT16 because all entries are 16 bit.
  • FAT16 can hold a max of 65,524 addressable units
  • It is used for small and moderate sized hard disk volumes.

FAT32

FAT32 is the enhanced version of the FAT system implemented beginning with Windows 95 OSR2, Windows 98, and Windows Me. Features include:

  • Drives of up to 2 terabytes are supported (Windows 2000 only supports up to 32 gigabytes)
  • Since FAT32 uses smaller clusters (of 4 kilobytes each), it uses hard drive space more efficiently. This is a 10 to 15 percent improvement over FAT or FAT16.
  • The limitations of FAT or FAT 16 on the number of root folder entries have been eliminated. In FAT32, the root folder is an ordinary cluster chain, and can be located anywhere on the drive.
  • File allocation mirroring can be disabled in FAT32. This allows a different copy of the file allocation table then the default to be active.

Limitations with Windows 2000 & Windows XP

  • Clusters cannot be 64KB or larger.
  • Cannot decrease cluster size that will result in the the FAT being larger than 16 MB minus 64KB in size.
  • Cannot contain fewer than 65,527 clusters.
  • Maximum of 32KB per cluster.
  • Windows XP: The Windows XP installation program will not allow a user to format a drive of more than 32GB using the FAT32 file system. Using the installation program, the only way to format a disk greater than 32GB in size is to use NTFS. A disk larger than 32GB in size can be formatted with FAT32 for use with Windows XP if the system is booted from a Windows 98 or Windows ME startup disk, and formatted using the tool that will be on the disk.

exFAT (sometimes incorrectly called FAT64)

exFAT (also know as Extended File Allocation Table or exFAT) is Microsoft's latest version of FAT and works with Windows Embedded CE 6.0, Windows XP/Server 2003 (with a KB patch, Vista/Server 2008 SP 1 & Later, and Windows 7. Features include:

  • Largest file size is 264 bytes (16 exabytes) vs. FAT32's maximum file size of 4GB.
  • Has transaction support using Transaction-Safe Extended FAT File System (TexFAT). (Not released yet in Desktop/Server OS)
  • Speeds up storage allocation processes by using free space bitmaps.
  • Support UTC timestamps (Vista/Server 2008 SP1 does not support UTC, UTC support came out with SP2)
  • Maximum Cluster size of 32MB (Fat32 is 32KB)
  • Sector sizes from 512 bytes to 4096 bytes in size
  • Maximum FAT supportable volume size of 128PB
  • Maximum Subdirectory size of 256MB which can support up to over 2 million files in a singlr subdirectory
  • Uses a Bitmap for cluster allocation
  • Supports File Permissions (Not released yet in Desktop/Server OS)
  • Has been selected as the exclusive file system of the SDXC memory card by the SD Association

Although Microsoft has published some information on exFAT, there are more technical specifications available from third parties. For example, here is a detailed presentation on exFAT.

Another published technical paper that goes in the internals in great detail is in the SANS Reading Room at: Reverse Engineering the Microsoft exFAT File System

Comparison of FAT Versions

See the table at http://en.wikipedia.org/wiki/File_Allocation_Table for more detailed information about the various versions of FAT.

Uses

Due to its low cost, mobility, and non-volatile nature, flash memory has quickly become the choice medium for storing and transferring data in consumer electronic devices. The majority of flash memory storage is formatted using the FAT file system. In addition, FAT is also frequently used in electronic devices with miniature hard drives.

Examples of devices in which FAT is utilized include:

  • USB thumb drives
  • Digital cameras
  • Digital camcorders
  • Portable audio and video players
  • Multifunction printers
  • Electronic photo frames
  • Electronic musical instruments
  • Standard televisions
  • PDAs

Data Recovery

Recovering directory entries from FAT filesystems as part of recovering deleted data can be accomplished by looking for entries that begin with a sigma 0xe5. When a file or directory is deleted under a FAT filesystem, the first character of its name is changed to sigma. The remainder of the directory entry information remains intact.

The pointers are also changed to zero for each cluster used by the file. Recovery tools look at the FAT to find the entry for the file. The location of the starting cluster will still be in the directory file. It is not deleted or modified. The tool will go straight to that cluster and try to recover the file using the file size to determine the number of clusters to recover. Some tools will go to the starting cluster and recover the next "X" number of clusters needed for the specific file size. However, this tool is not ideal. An ideal tool will locate "X" number of available clusters. Since files are most often fragmented, this will be a more precise way to recover the file.

An issue arises when two files in the same row of clusters are deleted. If the clusters are not in sequential order, the tool will automatically receive "X" number of clusters. However, because the file was fragmented, it's most likely that all the clusters obtained will not all contain data for that file. If these two deleted files are in the same row of clusters, it is highly unlikely the file can be recovered.

File Slack

File slack is data that starts from the end of the file written and continues to the end of the sectors designated to the file. There are two types of file slack, RAM slack and Residual slack. RAM slack starts from the end of the file and goes to the end of that sector. Residual slack then starts at the next sector and goes to the end of the cluster allocated for the file. File slack is a helpful tool when analyzing a hard drive because the old data that is not overwritten by the new file is still in tact. Go to http://www.pcguide.com/ref/hdd/file/partSizes-c.html for examples.


Cluster
Sample Slack Space, 50% Cluster Slack Per File
Sample Slack Space, 67% Cluster Slack Per File
2 kiB
17 MB
22 MB
4 kiB
33 MB
44 MB
8 kiB
66 MB
89 MB
16 kiB
133 MB
177 MB
32 kiB
265 MB
354 MB

The diagram above demonstrates the larger the cluster size used, the more disk space is wasted due to slack. This suggests it is better to use smaller cluster sizes whenever possible.

FAT Advantages

  • Files available to multiple operating systems on the same computer
  • Easier to switch from FAT to NTFS than vice versa
  • Performs faster on smaller volumes (< 10GB)
  • Does not index files, which causes slightly higher performance
  • Performs better with small cache sizes (< 96MB)
  • More space-efficient on small volumes (< 4GB)
  • Performs better with slow disks (< 5400RPM)

FAT Disadvantages

  • FAT has a fixed maximum number of clusters per partition, which means as the hard disk gets bigger the size of each cluster must increase, creating more slack space
  • Doesn't natively support many abilities of NTFS such as on-the-fly compression, encryption, or advanced security using access control lists
  • NTFS recommended by Microsoft for volumes larger than 32GB
  • FAT slows down as the number of files on the disk increases
  • FAT usually fragments files more
  • FAT does not allow for indexing of files for faster searching
  • FAT does not support user quotas
  • FAT has minimal security features including no access control list (ACL) capability.

External links

ExFAT

textFAT

Tools

exFAT