Difference between pages "HFS+" and "Internet Explorer History File Format"

From ForensicsWiki
(Difference between pages)
Jump to: navigation, search
 
(External Links)
 
Line 1: Line 1:
HFS+, or Hierarchical File System Plus, is the file system designed by Apple Computer[http://www.apple.com] to supersede HFS. First introduced with Mac OS 8.1, one of the biggest differences was the lower allocation block size of 4kb, which increased performance and lowered fragmentation (See:  Technical Note TN1121). It also implemented Unicode (rather than Mac proprietary formats) for naming files.
+
{{Expand}}
 +
[[Internet Explorer]] as of version 4 stores the web browsing history in files called <tt>index.dat</tt>. The files contain multiple records.
 +
MSIE version 3 probably uses similar records in its History (Cache) files.
  
There are structurally many differences between HFS and HFS+, which are listed below[http://developer.apple.com/technotes/tn/tn1150.html#HFSPlusBasics]:
+
== File Locations ==
<br><br>
+
<CENTER><TABLE Border=1 cellpadding=2 cellspacing=0 width=75%>
+
            <TR>
+
              <TD>
+
                  <P><B>Feature</B></p>
+
  
              </TD><TD>
+
Internet Explorer history files keep a record of URLs that the browser has visited, cookies that were created by these sites, and any temporary internet files that were downloaded by the site visit.  As a result, Internet Explorer history files are kept in several locations.  Regardless of the information stored in the file, the file is named index.dat.
                  <P><B>HFS</B></p>
+
              </TD><TD>
+
                  <P><B>HFS Plus</B></p>
+
              </TD><TD>
+
                  <P><B>Benefit/Comment</B></p>
+
              </TD></TR>
+
  
            <TR>
+
On Windows 95/98 these files were located in the following locations:
              <TD>
+
<tt>%systemdir%\Temporary Internet Files\Content.ie5
                  <P>User visible name</p>
+
%systemdir%\Cookies
              </TD><TD>
+
%systemdir%\History\History.ie5</tt>
                  <P>Mac OS Standard</p>
+
              </TD><TD>
+
                  <P>Mac OS Extended</p>
+
  
              </TD><TD>
+
On Windows 2000/XP the file locations have changed:
                  <P></p>
+
<tt>%systemdir%\Documents and Settings\%username%\Local Settings\Temporary Internet Files\Content.ie5
              </TD></TR>
+
%systemdir%\Documents and Settings\%username%\Cookies
            <TR>
+
%systemdir%\Documents and Settings\%username%\Local Settings\History\history.ie5</tt>
              <TD>
+
                  <P>Number of allocation blocks</p>
+
              </TD><TD>
+
                  <P>16 bits worth</p>
+
  
              </TD><TD>
+
Internet Explorer also keeps daily, weekly, and monthly history logs that will be located in subfolders of %systemdir%\Documents and Settings\%username%\Local Settings\History\history.ie5.  The folders will be named <tt>MSHist<two-digit number><starting four-digit year><starting two-digit month><starting two-digit day><ending four-digit year><ending two-digit month><ending two-digit day></tt>.  For example, the folder containing data from March 26, 2008 to March 27, 2008 might be named <tt>MSHist012008032620080327</tt>.
                  <P>32 bits worth</p>
+
              </TD><TD>
+
                  <P>Radical decrease in disk space used on large
+
                  volumes, and a larger number of files per volume.</p>
+
              </TD></TR>
+
            <TR>
+
              <TD>
+
                  <P>Long file names</p>
+
  
              </TD><TD>
+
Note that not every file named index.dat is a IE History file.
                  <P>31 characters</p>
+
              </TD><TD>
+
                  <P>255 characters</p>
+
              </TD><TD>
+
                  <P>Obvious user benefit; also improves
+
                  cross-platform compatibility</p>
+
              </TD></TR>
+
  
            <TR>
+
== File Header ==
              <TD>
+
Every version of Internet Explorer since Internet Explorer 5 has used the same structure for the file header and the individual records.  Internet Explorer history files begin with:
                  <P>File name encoding</p>
+
43 6c 69 65 6e 74 20 55 72 6c 43 61 63 68 65 20 4d 4d 46 20 56 65 72 20 35 2e 32
              </TD><TD>
+
Which represents the ascii string "Client UrlCache MMF Ver 5.2"
                  <P>MacRoman</p>
+
              </TD><TD>
+
                  <P>Unicode</p>
+
  
              </TD><TD>
+
The next field in the file header starts at byte offset 28 and is a four byte representation of the file size.  The number will be stored in [[endianness | little-endian]] format so the numbers must actually be reversed to calculate the value.
                  <P>Allows for international-friendly file names,
+
                  including mixed script names</p>
+
              </TD></TR>
+
            <TR>
+
              <TD>
+
                  <P>File/folder attributes</p>
+
              </TD><TD>
+
                  <P>Support for fixed size attributes (FileInfo and
+
                  ExtendedFileInfo)</p>
+
  
              </TD><TD>
+
Also of interest in the file header is the location of the cache directories.  In the URL records the cache directories are given as a number, with one representing the first cache directory, two representing the second and so on.  The names of the cache directories are kept at byte offset 64 in the file.  Each directory entry is 12 bytes long of which the first eight bytes contain the directory name.
                  <P>Allows for future meta-data extensions</p>
+
              </TD><TD>
+
                  <P>Future systems may use metadata for a richer
+
                  Finder experience</p>
+
              </TD></TR>
+
            <TR>
+
              <TD>
+
                  <P>OS startup support</p>
+
  
              </TD><TD>
+
== Allocation bitmap ==
                  <P>System Folder ID</p>
+
The IE History File contains an allocation bitmap starting from offset 0x250 to 0x4000.
              </TD><TD>
+
                  <P>Also supports a dedicated startup file</p>
+
              </TD><TD>
+
                  <P>May help non-Mac OS systems to boot from HFS
+
                  Plus volumes</p>
+
              </TD></TR>
+
  
            <TR>
+
== Record Formats ==
              <TD>
+
                  <P>catalog node size</p>
+
              </TD><TD>
+
                  <P>512 bytes</p>
+
              </TD><TD>
+
                  <P>4 KB</p>
+
  
              </TD><TD>
+
Every record has a similar header that consists of 8 bytes.
                  <P>Maintains efficiency in the face of the other
+
                  changes. (This larger catalog node size is due to
+
                  the much longer file names [512 bytes as opposed to
+
                  32 bytes], and larger catalog records (because of
+
                  more/larger fields)).</p>
+
              </TD></TR>
+
            <TR>
+
              <TD>
+
                  <P>Maximum file size</p>
+
              </TD><TD>
+
                  <P>2<SUP>31</SUP> bytes</p>
+
  
              </TD><TD>
+
<pre>typedef struct _RECORD_HEADER {
                  <P>2<SUP>63</SUP> bytes</p>
+
  /* 000 */ char        Signature[4];
              </TD><TD>
+
  /* 004 */ uint32_t    AmountOfBlocksInRecord;
                  <P>Obvious user benefit, especially for multimedia
+
} RECORD_HEADER;</pre>
                  content creators.</p></td>
+
                  </tr>
+
</table></CENTER>
+
<br>
+
An HFS+ volume contains five special files:
+
<ol>
+
<li>
+
Catalog file - Describes the folder and file hierarchy of the volume. It is organized as a "balanced tree" for fast and efficient searches
+
</li>
+
<li>Extents overflow file - Additional extents (contiguous allocation blocks allocated to forks) are stored in a b-tree in this file
+
</li>
+
<li>
+
Allocation file - Specifies whether an allocation block is free (similar to $Bitmap in NTFS). This is stored in a bitmap, specifying a free allocation block with a "clear bit"
+
</li>
+
<li>Attributes file - Contains attribute information regarding files or folders
+
</li>
+
<li>
+
Startup file - Allows computers to boot that do have built in support for HFS+ file systems
+
</li>
+
</ol>
+
<br>
+
HFS+ also implements journaling, which allows fast recovery in the case of a crash or power outage. According to Apple, "The purpose of the journal is to ensure that when a group of related changes are being made, that either all of those changes are actually made, or none of them are made."[http://developer.apple.com/technotes/tn/tn1150.html#Journal]
+
  
Apple technical notes are available for the HFS+ file system from their [http://developer.apple.com/cgi-bin/search.pl?q=HFS+&num=10&site=default_collection website].
+
The size of the record can be determined from the amount of blocks in the record; per default the block size is 128 bytes. Therefore, a length of <pre>05 00 00 00</pre> would indicate five blocks (because the number is stored in little-endian format) of 128 bytes for a total record length of 640 bytes.
 +
 
 +
The blocks that make up a record can have slack space.
 +
 
 +
Currently 4 types of records are known:
 +
* URL
 +
* REDR
 +
* HASH
 +
* LEAK
 +
 
 +
=== URL Records ===
 +
 
 +
These records indicate URIs that were actually requested. They contain the location and additional data like the web server's HTTP response. They begin with the header, in hexadecimal:
 +
 
 +
<pre>55 52 4C 20</pre>
 +
This corresponds to the string <tt>URL</tt> followed by a space.
 +
 
 +
The definition for the structure in C99 format:
 +
 
 +
<pre>typedef struct _URL_RECORD_HEADER {
 +
  /* 000 */ char        Signature[4];
 +
  /* 004 */ uint32_t    AmountOfBlocksInRecord;
 +
  /* 008 */ FILETIME    LastModified;
 +
  /* 010 */ FILETIME    LastAccessed;
 +
  /* 018 */ FATTIME    Expires;
 +
  /* 01c */
 +
  // Not finished yet
 +
} URL_RECORD_HEADER;</pre>
 +
 
 +
<pre>
 +
typedef struct _FILETIME {
 +
  /* 000 */ uint32_t    lower;
 +
  /* 004 */ uint32_t    upper;
 +
} FILETIME;</pre>
 +
 
 +
<pre>
 +
typedef struct _FATTIME {
 +
  /* 000 */ uint16_t    date;
 +
  /* 002 */ uint16_t    time;
 +
} FATTIME;</pre>
 +
 
 +
The actual interpretation of the "LastModified" and "LastAccessed" fields depends on the type of history file in which the record is contained. As a matter of fact, Internet Explorer uses three different types of history files, namely Daily History, Weekly History, and Main History. Other "index.dat" files are used to store cached copies of visited pages and cookies.
 +
The information concerning how to intepret the dates of these different files can be found on Capt. Steve Bunting's web page at the University of Delaware Computer Forensics Lab (http://128.175.24.251/forensics/default.htm).
 +
Please be aware that most free and/or open source index.dat parsing programs, as well as quite a few commercial forensic tools, are not able to correctly interpret the above dates. More specifically, they interpret all the time and dates as if the records were contained into a Daily History file regardless of the actual type of the file they are stored in.
 +
 
 +
=== REDR Records ===
 +
REDR records are very simple records.  They simply indicate that the browser was redirected to another site.  REDR records always start with the string REDR (0x52 45  44 52).  The next four bytes are the size of the record in little endian format.  The size will indicate the number 128 byte blocks.
 +
 
 +
At offset 8 from the start of the REDR record is an unknown data field.  It has been confirmed that this is not a date field.
 +
 
 +
16 bytes into the REDR record is the URL that was visited in a null-terminated string.  After the URL, the REDR record appears to be padded with zeros until the end of the 128 byte block.
 +
 
 +
=== HASH Records ===
 +
 
 +
=== LEAK Records ===
 +
The exact purpose of LEAK records remains unknown, however research performed by Mike Murr suggests that LEAK records are created when the machine attempts to delete records from the history file while a corresponding Temporary Internet File (TIF) is held open and cannot be deleted.
  
 
== External Links ==
 
== External Links ==
* [http://web.archive.org/web/20090530120010/http://developer.apple.com/technotes/tn/tn1121.html Internet Archive Copy of: Technical Note TN1121], originally found on http://developer.apple.com/technotes/tn/tn1121.html#HFSPlus
 
  
[[Category:Disk file systems]]
+
* [http://www.cqure.net/wp/?page_id=18 IEHist program for reading index.dat files]
 +
* [http://www.milincorporated.com/a3_index.dat.html What is in Index.dat files]
 +
* [http://www.foundstone.com/us/pdf/wp_index_dat.pdf Detailed analysis of index.dat file format]
 +
* [http://downloads.sourceforge.net/sourceforge/libmsiecf/MSIE_Cache_File_format.pdf MSIE Cache File (index.dat) format specification]
 +
* [http://www.forensicblog.org/2009/09/10/the-meaning-of-leak-records/ The Meaning of LEAK records]
 +
 
 +
[[Category:File Formats]]

Revision as of 23:34, 25 September 2009

Information icon.png

Please help to improve this article by expanding it.
Further information might be found on the discussion page.

Internet Explorer as of version 4 stores the web browsing history in files called index.dat. The files contain multiple records.

MSIE version 3 probably uses similar records in its History (Cache) files.

File Locations

Internet Explorer history files keep a record of URLs that the browser has visited, cookies that were created by these sites, and any temporary internet files that were downloaded by the site visit. As a result, Internet Explorer history files are kept in several locations. Regardless of the information stored in the file, the file is named index.dat.

On Windows 95/98 these files were located in the following locations: %systemdir%\Temporary Internet Files\Content.ie5 %systemdir%\Cookies %systemdir%\History\History.ie5

On Windows 2000/XP the file locations have changed: %systemdir%\Documents and Settings\%username%\Local Settings\Temporary Internet Files\Content.ie5 %systemdir%\Documents and Settings\%username%\Cookies %systemdir%\Documents and Settings\%username%\Local Settings\History\history.ie5

Internet Explorer also keeps daily, weekly, and monthly history logs that will be located in subfolders of %systemdir%\Documents and Settings\%username%\Local Settings\History\history.ie5. The folders will be named MSHist<two-digit number><starting four-digit year><starting two-digit month><starting two-digit day><ending four-digit year><ending two-digit month><ending two-digit day>. For example, the folder containing data from March 26, 2008 to March 27, 2008 might be named MSHist012008032620080327.

Note that not every file named index.dat is a IE History file.

File Header

Every version of Internet Explorer since Internet Explorer 5 has used the same structure for the file header and the individual records. Internet Explorer history files begin with:

43 6c 69 65 6e 74 20 55 72 6c 43 61 63 68 65 20 4d 4d 46 20 56 65 72 20 35 2e 32

Which represents the ascii string "Client UrlCache MMF Ver 5.2"

The next field in the file header starts at byte offset 28 and is a four byte representation of the file size. The number will be stored in little-endian format so the numbers must actually be reversed to calculate the value.

Also of interest in the file header is the location of the cache directories. In the URL records the cache directories are given as a number, with one representing the first cache directory, two representing the second and so on. The names of the cache directories are kept at byte offset 64 in the file. Each directory entry is 12 bytes long of which the first eight bytes contain the directory name.

Allocation bitmap

The IE History File contains an allocation bitmap starting from offset 0x250 to 0x4000.

Record Formats

Every record has a similar header that consists of 8 bytes.

typedef struct _RECORD_HEADER {
  /* 000 */ char        Signature[4];
  /* 004 */ uint32_t    AmountOfBlocksInRecord;
} RECORD_HEADER;
The size of the record can be determined from the amount of blocks in the record; per default the block size is 128 bytes. Therefore, a length of
05 00 00 00
would indicate five blocks (because the number is stored in little-endian format) of 128 bytes for a total record length of 640 bytes.

The blocks that make up a record can have slack space.

Currently 4 types of records are known:

  • URL
  • REDR
  • HASH
  • LEAK

URL Records

These records indicate URIs that were actually requested. They contain the location and additional data like the web server's HTTP response. They begin with the header, in hexadecimal:

55 52 4C 20

This corresponds to the string URL followed by a space.

The definition for the structure in C99 format:

typedef struct _URL_RECORD_HEADER {
  /* 000 */ char        Signature[4];
  /* 004 */ uint32_t    AmountOfBlocksInRecord;
  /* 008 */ FILETIME    LastModified;
  /* 010 */ FILETIME    LastAccessed;
  /* 018 */ FATTIME     Expires;
  /* 01c */ 
  // Not finished yet
} URL_RECORD_HEADER;
typedef struct _FILETIME {
  /* 000 */ uint32_t    lower;
  /* 004 */ uint32_t    upper;
} FILETIME;
typedef struct _FATTIME {
  /* 000 */ uint16_t    date;
  /* 002 */ uint16_t    time;
} FATTIME;

The actual interpretation of the "LastModified" and "LastAccessed" fields depends on the type of history file in which the record is contained. As a matter of fact, Internet Explorer uses three different types of history files, namely Daily History, Weekly History, and Main History. Other "index.dat" files are used to store cached copies of visited pages and cookies. The information concerning how to intepret the dates of these different files can be found on Capt. Steve Bunting's web page at the University of Delaware Computer Forensics Lab (http://128.175.24.251/forensics/default.htm). Please be aware that most free and/or open source index.dat parsing programs, as well as quite a few commercial forensic tools, are not able to correctly interpret the above dates. More specifically, they interpret all the time and dates as if the records were contained into a Daily History file regardless of the actual type of the file they are stored in.

REDR Records

REDR records are very simple records. They simply indicate that the browser was redirected to another site. REDR records always start with the string REDR (0x52 45 44 52). The next four bytes are the size of the record in little endian format. The size will indicate the number 128 byte blocks.

At offset 8 from the start of the REDR record is an unknown data field. It has been confirmed that this is not a date field.

16 bytes into the REDR record is the URL that was visited in a null-terminated string. After the URL, the REDR record appears to be padded with zeros until the end of the 128 byte block.

HASH Records

LEAK Records

The exact purpose of LEAK records remains unknown, however research performed by Mike Murr suggests that LEAK records are created when the machine attempts to delete records from the history file while a corresponding Temporary Internet File (TIF) is held open and cannot be deleted.

External Links