Partition recovery tools work by assuming that a file system was located
in each partition. Fortunately, many filesystems start with a data structure that has a constant
"magic number" or signature value. For example, a FAT file system has the values
0x55 and 0xAA in byte offsets 510 and 511 of the first sector. The partition recovery tools
search for these sort of signature values and identify where a partition may have started.
The search mechanism of each tool may vary. Some tools examine each
sector and compare it to known signatures. Other tools search only
cylinder boundaries because partitions are typically created on cylinder boundaries. Others may use data from the filesystem data structures to learn
how big the filesystem is and jump to the end before searching for more
known data structures.
An example of a linux tool that can be used for partition recovery is gpart. This command can identify a number of filesystem types by testing sectors and assessing
which filesystem type is the most probable (ref B. Carrier, "File System Forensic Analysis").
First, lets search the /images/diskimg1.dd image file for signature value 0x55aa.
Execute the command:
sigfind -o 510 55aa /images/diskimg1.dd
This should produce output similar to the following:
Block size: 512 Offset: 510 Signature: 55AA
Block: 0 (-)
Block: 63 (+63)
Block: 6803 (+6740)
Block: 6815 (+12)
Block: 48195 (+41380)
Block: 51051 (+2856)
Block: 51067 (+16)
Block: 64259 (+13192)
Block: 64260 (+1)
Block: 92460 (+28200)
Block: 92476 (+16)
Block: 112454 (+19978)
Block: 112455 (+1)
Block: 113512 (+1057)
Block: 127818 (+14306)
error reading bytes 257040
sigfind searches through a file and looks for the hex_signature at a
given offset. This can be used to search for lost boot sectors, superblocks,
and partition tables.
From the output you can see that there are many matches, but some of them
are not relevent to finding the partitions. You need to look through
the matches and identify the likely candidates for a valid partition, and/or
remove useless matches.
Sometimes filesystem knowledge can help you, as for instance NTFS is
formatted so that sector 0 and then the last sector of an NTFS partition
both have a valid copy of the MBR (the last sector is a backup copy of sector 0).
In FAT32 sector 6 usually holds a backup copy of the MBR sector 0.
Sometimes files in valid filesystems will co-incidentally have 0x55aa at
offset 510. This can simply happen by chance. It is likely matches to
sectors which lie within valid filesystems are not going to be deleted
partitions.
Save the output of the sigfile command shown above in "/home/caine/blist1".