Difference between pages "Internet Explorer History File Format" and "Determining OS version from an evidence image"

From ForensicsWiki
(Difference between pages)
Jump to: navigation, search
(External Links)
 
m (Windows 95/98/ME: Added one point of identification)
 
Line 1: Line 1:
{{Expand}}
+
One of the first steps an examiners will need to carry out once they have an evidence image is to log system metadata, including OS version and patch level. This may be of particular importance if the image in question is from a machine that is suspected of having been compromised.
[[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.
+
  
== File Locations ==
+
==Windows==
  
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.
+
===Windows 95/98/ME===
  
On Windows 95/98 these files were located in the following locations:
+
Examine C:\MSDOS.SYS in C:\, and particularly the WinVer parameter
<tt>%systemdir%\Temporary Internet Files\Content.ie5
+
%systemdir%\Cookies
+
%systemdir%\History\History.ie5</tt>
+
  
On Windows 2000/XP the file locations have changed:
+
{| class="wikitable"
<tt>%systemdir%\Documents and Settings\%username%\Local Settings\Temporary Internet Files\Content.ie5
+
|-
%systemdir%\Documents and Settings\%username%\Cookies
+
! WinVer
%systemdir%\Documents and Settings\%username%\Local Settings\History\history.ie5</tt>
+
! OS
 +
|-
 +
| 4.00.0950
 +
| Windows 95
 +
|-
 +
| 4.00.1111
 +
| Windows 95 OSR2
 +
|-
 +
| 4.10.1998
 +
| Windows 98
 +
|-
 +
| 4.10.2222
 +
| Windows 98 SE
 +
|-
 +
| 4.90.3000
 +
| Windows ME
 +
|}
  
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>.
+
===Windows NT===
  
Note that not every file named index.dat is a IE History file.
+
===Windows 2000/2003/XP/Vista===
 +
Information about a running system can be displayed using the command `ver` (and `systeminfo` on some systems).
  
== File Header ==
+
During a forensic examination, information regarding the version of Windows can be found in a number of placesFor example, by default, the Windows directory on Windows XP is "C:\Windows", where on Windows NT and 2000, it was "C:\Winnt".  This is not definitive, however, because this directory name is easily modified during installation.
Every version of Internet Explorer since Internet Explorer 5 has used the same structure for the file header and the individual recordsInternet 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 [[endianness | little-endian]] format so the numbers must actually be reversed to calculate the value.
+
Determining the version of Windows from the Software Registry Hive file - navigate to the ''Microsoft\Windows NT\CurrentVersion'' key, and examine the values beneath the key; specifically, values such as ProductName, CSDVersion, ProductId (if available), BuildLab, and on Vista, BuildLabEx.
  
Also of interest in the file header is the location of the cache directoriesIn 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 fileEach directory entry is 12 bytes long of which the first eight bytes contain the directory name.
+
Determining the version of Windows from file version information - locate the file %WinDir%\system32\ntoskrnl.exe and review the file version information/strings from the resource section of the PE fileYou can view this information with a hex editor, or extract it using a variety of meansThere is a Perl module (Win32::File::VersionInfo) that will allow you to extract this information, and the Perl script [http://sourceforge.net/project/showfiles.php?group_id=164158&package_id=203967 kern.pl] illustrates a platform independent means of examining the PE header and ultimately locating the file version information.
  
== Allocation bitmap ==
+
In order to determine the difference between Windows XP Professional and Home versions, look for the %WinDir%\system32\prodspec.ini file; it contains information regarding the Product type (either XP Pro or Home). Another way to do this is to look at Microsoft Product Code (first 5 digits of ''Product ID''). Some of these values:
The IE History File contains an allocation bitmap starting from offset 0x250 to 0x4000.
+
  
== Record Formats ==
+
{| class="wikitable" border="1"
 +
|-
 +
!Value (MPC)!!Version
 +
|-
 +
|55034 || Windows XP Professional English
 +
|-
 +
|55683 || Windows XP Professional Russian
 +
|-
 +
|55681 || Windows XP Home Edition Russian
 +
|}
  
Every record has a similar header that consists of 8 bytes.
+
==Unix/Linux==
 +
Information about a running system, including the kernel version, can be displayed using the command `uname -a`. However, this is not much good if you performing dead analysis on a disk image.
  
<pre>typedef struct _RECORD_HEADER {
+
===Linux===
  /* 000 */ char        Signature[4];
+
A number of Linux distributions create a file in ''/etc'' to identify the release or version installed.
  /* 004 */ uint32_t    AmountOfBlocksInRecord;
+
} RECORD_HEADER;</pre>
+
  
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.
+
{| class="wikitable" border="1"
 +
|-
 +
!Distro!!Tag
 +
|-
 +
|Red Hat || /etc/redhat-release
 +
|-
 +
|Debian  || /etc/debian-version
 +
|}
  
The blocks that make up a record can have slack space.
+
===Solaris===
  
Currently 4 types of records are known:
+
===Free/Net/OpenBSD===
* URL
+
You can get the release and version of BSDs operating system inside the kernel images, even with only a disk image.
* REDR
+
* HASH
+
* LEAK
+
  
=== URL Records ===
+
{| class="wikitable" border="1"
 +
|-
 +
!OS!!Kernel path
 +
|-
 +
|FreeBSD || /boot/kernel/kernel
 +
|-
 +
|OpenBSD || /bsd
 +
|-
 +
|NetBSD || /netbsd
 +
|-
 +
|}
  
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:
+
You can use <tt>strings</tt> and <tt>grep</tt> tools to find this information with <tt>strings kernel_path | grep os_name</tt>. (e.g.: <tt>strings /bsd | grep OpenBSD</tt>)
  
<pre>55 52 4C 20</pre>
+
===AIX===
This corresponds to the string <tt>URL</tt> followed by a space.
+
  
The definition for the structure in C99 format:
+
===HP/UX===
  
<pre>typedef struct _URL_RECORD_HEADER {
+
[[Category:Howtos]]
  /* 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 ==
+
 
+
* [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 05:10, 26 March 2012

One of the first steps an examiners will need to carry out once they have an evidence image is to log system metadata, including OS version and patch level. This may be of particular importance if the image in question is from a machine that is suspected of having been compromised.

Windows

Windows 95/98/ME

Examine C:\MSDOS.SYS in C:\, and particularly the WinVer parameter

WinVer OS
4.00.0950 Windows 95
4.00.1111 Windows 95 OSR2
4.10.1998 Windows 98
4.10.2222 Windows 98 SE
4.90.3000 Windows ME

Windows NT

Windows 2000/2003/XP/Vista

Information about a running system can be displayed using the command `ver` (and `systeminfo` on some systems).

During a forensic examination, information regarding the version of Windows can be found in a number of places. For example, by default, the Windows directory on Windows XP is "C:\Windows", where on Windows NT and 2000, it was "C:\Winnt". This is not definitive, however, because this directory name is easily modified during installation.

Determining the version of Windows from the Software Registry Hive file - navigate to the Microsoft\Windows NT\CurrentVersion key, and examine the values beneath the key; specifically, values such as ProductName, CSDVersion, ProductId (if available), BuildLab, and on Vista, BuildLabEx.

Determining the version of Windows from file version information - locate the file %WinDir%\system32\ntoskrnl.exe and review the file version information/strings from the resource section of the PE file. You can view this information with a hex editor, or extract it using a variety of means. There is a Perl module (Win32::File::VersionInfo) that will allow you to extract this information, and the Perl script kern.pl illustrates a platform independent means of examining the PE header and ultimately locating the file version information.

In order to determine the difference between Windows XP Professional and Home versions, look for the %WinDir%\system32\prodspec.ini file; it contains information regarding the Product type (either XP Pro or Home). Another way to do this is to look at Microsoft Product Code (first 5 digits of Product ID). Some of these values:

Value (MPC) Version
55034 Windows XP Professional English
55683 Windows XP Professional Russian
55681 Windows XP Home Edition Russian

Unix/Linux

Information about a running system, including the kernel version, can be displayed using the command `uname -a`. However, this is not much good if you performing dead analysis on a disk image.

Linux

A number of Linux distributions create a file in /etc to identify the release or version installed.

Distro Tag
Red Hat /etc/redhat-release
Debian /etc/debian-version

Solaris

Free/Net/OpenBSD

You can get the release and version of BSDs operating system inside the kernel images, even with only a disk image.

OS Kernel path
FreeBSD /boot/kernel/kernel
OpenBSD /bsd
NetBSD /netbsd

You can use strings and grep tools to find this information with strings kernel_path | grep os_name. (e.g.: strings /bsd | grep OpenBSD)

AIX

HP/UX