Fat File System Forensics
Fat File System Forensics
Forensics
pd_image1.dd
File Allocation Table (FAT)
• The File Allocation Table (FAT) file system is one of the most
simple file systems found in common operating systems.
The first section is the reserved area. In the reserved area are a backup boot sector and a
FSINFO data structure. In FAT12 and FAT16 this area is typically only 1 sector in size, but
the size is defined in the boot sector. The reserved area starts in sector 0 of the file system,
and its size is given in the boot sector.
The typical layout of the FAT file system has three physical sections to it
The second section is the FAT area, and it contains the primary and backup FAT structures.
It starts in the sector following the reserved area.
Its size is calculated by multiplying the number of FAT structures by the size of each FAT;
both of these values are given in the boot sector.
The allocation status of each cluster can be determined by looking at the cluster's entry in the
FAT. Entries with a zero value are unallocated and non-zero entries are allocated. If we
wanted to extract the contents of all unallocated clusters, we would read the FAT and extract
each cluster with a zero in the table.
The typical layout of the FAT file system has three physical sections to it:
The third section is the data area. It contains the clusters that will be allocated to store file
and directory content. It begins in the sector after the FAT area.
Its size is calculated by subtracting the starting sector address of the data area from the
total number of sectors in the file system, which is specified in the boot sector.
The layout of the data area is slightly different in FAT12/16 and FAT32.
In FAT12/16 the beginning of the data area is reserved for the root directory(fixed size in
FAT12/16) , but in FAT32 the root directory (dynamic size ) can be anywhere in the data
area
The dynamic size and location of the root directory allows FAT32 to adapt to bad sectors
in the beginning of the data area and allows the directory to grow as large as it needs to.
•We can see that there are 545 reserved
sectors until the first FAT. In the reserved
area are a backup boot sector and a
FSINFO data structure.
•There are two FAT structures, and they
span from sectors 546 to 4368 and 4369
to 8191.
•The data area starts in sector 8192, and it
has clusters that are 4096 bytes in size.
To determine the
configuration of a
FAT file system, we
need to process the
first sector of the
disk--->
1F80 * 200=
3F0000
0x00: 3 bytes,
representing the jump
instruction;
0x03: 8 bytes,
representing the
vendor logo and OS
version number;
0x0B: 53 bytes,
representing BPB;
0x40: 26 bytes,
representing extended
BPB;
0x1FE: 2 bytes,
representing the valid
end flag;
Bios
Paramet
er Block
Extended
Bios Parameter
Block used by FAT
36-89 bytes
Some Critical fields
Offset 0x0B contains 2 bytes which
specify the number of bytes per sector.
The first 11 bytes are the short filename. The extension is always the last three bytes.
If the file's name is shorter than 8 bytes, the unused bytes are filled with spaces (0x20).
The starting cluster number is found as two 16 bit sections, and the file size (in bytes) is found
in the last four bytes of the record.
The first cluster number tells you where the file's data begins on the drive, and the size field
tells how long the file is.
There are four types of 32-byte directory records.
Normal record with short filename : Attrib is normal
Long filename text : Attrib has all four type bits set
Unused - First byte is 0xE5
End of directory - First byte is zero
The Attrib byte has six bits defined, as shown in the table below.
Most simple firmware will check the Attrib byte to determine if the 32 bytes are a
normal record or long filename data, and to determine if it is a normal file or a
subdirectory.
Long filename records have all four of the least significant bits set.