Difference between pages "Google Chrome" and "Gzip"

From ForensicsWiki
(Difference between pages)
Jump to: navigation, search
(Extension Cookies)
 
(File format)
 
Line 1: Line 1:
Google Chrome is a [[Web Browser|web browser]] developed by Google Inc.
+
{{expand}}
  
== Configuration ==
+
== File format ==
The Google Chrome configuration can be found in the '''Preferences''' file.
+
The gzip file (.gz) format consists of:
 +
* a file header
 +
* optional headers
 +
** extra fields
 +
** original file name
 +
** comment
 +
** header checksum
 +
* compressed data (commonly used compression method DEFLATE, without zlib header)
 +
* a file footer
  
On Linux
+
{| class="wikitable"
<pre>
+
! align="left"| Characteristics
/home/$USER/.config/google-chrome/Default/Preferences
+
! Description
</pre>
+
|-
 +
| Byte order
 +
| little-endian
 +
|-
 +
| Date and time values
 +
| POSIX timestamp <br> Number of seconds since January 1, 1970 00:00:00 UTC
 +
|-
 +
| Character strings
 +
| ISO 8859-1 (LATIN-1)
 +
|}
  
On MacOS-X
+
=== File header ===
<pre>
+
The file header is 10 bytes in size and contains:
/Users/$USER/Library/Application Support/Google/Chrome/Default/Preferences
+
{| class="wikitable"
</pre>
+
! align="left"| Offset
 +
! Size
 +
! Value
 +
! Description
 +
|-
 +
| 0
 +
| 2
 +
| 0x1f 0x8b
 +
| Signature (or identification byte 1 and 2)
 +
|-
 +
| 2
 +
| 1
 +
|
 +
| Compression Method
 +
|-
 +
| 3
 +
| 1
 +
|
 +
| Flags
 +
|-
 +
| 4
 +
| 4
 +
|
 +
| Last modification time <br> Contains a POSIX timestamp.
 +
|-
 +
| 8
 +
| 1
 +
|
 +
| Compression flags (or extra flags)
 +
|-
 +
| 9
 +
| 1
 +
|
 +
| Operating system <br> Value that indicates on which operating system the gzip file was created.
 +
|}
  
On Windows XP
+
==== Compression method ====
<pre>
+
C:\Documents and Settings\%USERNAME%\Local Settings\Application Data\Google\Chrome\User Data\Default\Preferences
+
</pre>
+
  
On Windows Vista and later
+
{| class="wikitable"
<pre>
+
! align="left"| Value
C:\Users\%USERNAME%\AppData\Local\Google\Chrome\User Data\Default\Preferences
+
! Identifier
</pre>
+
! Description
 +
|-
 +
| 0 - 7
 +
|
 +
| Reserved
 +
|-
 +
| 8
 +
| deflate
 +
| deflate compressed data
 +
|}
  
Or for '''Chromium'''
+
==== Flags ====
  
On Linux
+
{| class="wikitable"
<pre>
+
! align="left"| Value
/home/$USER/.config/chromium/Default/Preferences
+
! Identifier
</pre>
+
! Description
 +
|-
 +
| 0x01
 +
| FTEXT
 +
| If set the uncompressed data needs to be treated as text instead of binary data. <br> This flag hints end-of-line conversion for cross-platform text files but does not enforce it.
 +
|-
 +
| 0x02
 +
| FHCRC
 +
| The file contains a header checksum (CRC-16)
 +
|-
 +
| 0x04
 +
| FEXTRA
 +
| The file contains extra fields
 +
|-
 +
| 0x08
 +
| FNAME
 +
| The file contains an original file name string
 +
|-
 +
| 0x10
 +
| FCOMMENT
 +
| The file contains comment
 +
|-
 +
| 0x20
 +
|
 +
| Reserved
 +
|-
 +
| 0x40
 +
|
 +
| Reserved
 +
|-
 +
| 0x80
 +
|
 +
| Reserved
 +
|}
  
On MacOS-X
+
<b>Notes:</b>
<pre>
+
* Reserved flags bits must be zero.
/Users/$USER/Library/Application Support/Chromium/Default/Preferences
+
* The FHCRC bit was never set by versions of gzip up to 1.2.4, even though it was documented with a different meaning in gzip 1.2.4.
</pre>
+
  
On Windows XP
+
==== Compression flags ====
<pre>
+
This value contains flags specific to the compression method.
C:\Documents and Settings\%USERNAME%\Local Settings\Application Data\Chromium\User Data\Default\Preferences
+
</pre>
+
  
On Windows Vista and later
+
===== Compression flags - deflate =====
<pre>
+
If compression method value is 8 (deflate) the following compression flags can be used:
C:\Users\%USERNAME%\AppData\Local\Chromium\User Data\Default\Preferences
+
{| class="wikitable"
</pre>
+
! align="left"| Value
 +
! Identifier
 +
! Description
 +
|-
 +
| 0x02
 +
|
 +
| compressor used maximum compression, slowest algorithm
 +
|-
 +
| 0x04
 +
|
 +
| compressor used fastest algorithm
 +
|}
  
=== Plugins ===
+
==== Operating System ====
 +
{| class="wikitable"
 +
! align="left"| Value
 +
! Identifier
 +
! Description
 +
|-
 +
| 0
 +
|
 +
| FAT filesystem (MS-DOS, OS/2, NT/Win32)
 +
|-
 +
| 1
 +
|
 +
| Amiga
 +
|-
 +
| 2
 +
|
 +
| VMS (or OpenVMS)
 +
|-
 +
| 3
 +
|
 +
| Unix
 +
|-
 +
| 4
 +
|
 +
| VM/CMS
 +
|-
 +
| 5
 +
|
 +
| Atari TOS
 +
|-
 +
| 6
 +
|
 +
| HPFS filesystem (OS/2, NT)
 +
|-
 +
| 7
 +
|
 +
| Macintosh
 +
|-
 +
| 8
 +
|
 +
| Z-System
 +
|-
 +
| 9
 +
|
 +
| CP/M
 +
|-
 +
| 10
 +
|
 +
| TOPS-20
 +
|-
 +
| 11
 +
|
 +
| NTFS filesystem (NT)
 +
|-
 +
| 12
 +
|
 +
| QDOS
 +
|-
 +
| 13
 +
|
 +
| Acorn RISCOS
 +
|-
 +
| 255
 +
|
 +
| unknown
 +
|}
  
Information about plugins can be found under the "plugins section" of the Preferences file.
+
=== Optional headers ===
 +
==== Extra fields ====
 +
This value is present in the file if the FEXTRA flag is set in the file header flags.
  
=== DNS Prefetching ===
+
The extra field are variable of size and contains:
 +
{| class="wikitable"
 +
! align="left"| Offset
 +
! Size
 +
! Value
 +
! Description
 +
|-
 +
| 0
 +
| 2
 +
|
 +
| Extra field data size <br> Value in bytes.
 +
|-
 +
| 2
 +
| ...
 +
|
 +
| Extra field data
 +
|}
  
DNS is prefetched for related sites, e.g. links on the page.
+
==== Original file name ====
This behavior is controlled by the setting "Predict network actions to improve page load performance", which is enabled by default.
+
This value is present in the file if the FNAME flag is set in the file header flags.
  
If enabled the Preferences file contains:
+
This is the original name of the file being compressed, with any directory components removed, and, if the file being compressed is on a file system with case insensitive names, forced to lower case.
<pre>
+
  "dns_prefetching": {
+
      "enabled": true,
+
</pre>
+
  
If disabled the Preferences file contains:
+
Contains an ISO 8859-1 (LATIN-1) string with end-of-string character.
<pre>
+
  "dns_prefetching": {
+
      "enabled": false,
+
</pre>
+
  
== Start-up DNS queries ==
+
==== Comment ====
 +
This value is present in the file if the FCOMMENT flag is set in the file header flags.
  
When Chrome starts it queries for several non-existing hostnames that consists of a 10 random characters, E.g.
+
Contains an ISO 8859-1 (LATIN-1) string with end-of-string character. Line breaks should be denoted by a single line feed character.
<pre>
+
ttrgoiknff.mydomain.com
+
bxjhgftsyu.mydomain.com
+
yokjbjiagd.mydomain.com
+
</pre>
+
  
This is used to determine if your ISP is hijacking NXDOMAIN results [http://www.google.com/support/forum/p/Chrome/thread?tid=3511015c72a7b314&hl=en].
+
==== Header checksum ====
 +
The header checksum contain a CRC-16 that consists of the two least significant bytes of the CRC-32 for all bytes of the gzip header up to and not including the CRC-16.
  
== Disk Cache ==
+
=== File footer ===
Google Chrome uses multiple caches, from [http://src.chromium.org/viewvc/chrome/trunk/src/net/base/cache_type.h?view=markup]:
+
The file footer is 8 bytes in size and contains:
<pre>
+
{| class="wikitable"
// The types of caches that can be created.
+
! align="left"| Offset
enum CacheType {
+
! Size
    DISK_CACHE,  // Disk is used as the backing storage.
+
! Value
    MEMORY_CACHE,  // Data is stored only in memory.
+
! Description
    MEDIA_CACHE,  // Optimized to handle media files.
+
|-
    APP_CACHE,  // Backing store for an AppCache.
+
| 0
    SHADER_CACHE, // Backing store for the GL shader cache.
+
| 4
    PNACL_CACHE, // Backing store the PNaCl translation cache
+
|
};
+
| Checksum (CRC-32)
</pre>
+
|-
 
+
| 4
The Google Chrome disk cache can be found in:
+
| 4
 
+
|
On Linux
+
| Uncompressed data size <br> Value in bytes.
 
+
|}
<pre>
+
/home/$USER/.cache/chromium/Default/Cache/
+
/home/$USER/.cache/google-chrome/Default/Cache/
+
/home/$USER/.config/chromium/Default/Cache/
+
/home/$USER/.config/google-chrome/Default/Cache/
+
</pre>
+
 
+
<pre>
+
/home/$USER/.cache/chromium/Default/Media Cache/
+
/home/$USER/.cache/google-chrome/Default/Media Cache/
+
/home/$USER/.config/chromium/Default/Media Cache/
+
/home/$USER/.config/google-chrome/Default/Media Cache/
+
</pre>
+
 
+
<pre>
+
/home/$USER/.config/chromium/Default/Application Cache/Cache/
+
/home/$USER/.config/google-chrome/Default/Application Cache/Cache/
+
</pre>
+
 
+
<pre>
+
/home/$USER/.config/chromium/Default/GPUCache/
+
/home/$USER/.config/google-chrome/Default/GPUCache/
+
</pre>
+
 
+
<pre>
+
/home/$USER/.cache/chromium/PnaclTranslationCache/
+
/home/$USER/.cache/google-chrome/PnaclTranslationCache/
+
</pre>
+
 
+
On MacOS-X
+
<pre>
+
/Users/$USER/Caches/Chromium/Default/Cache/
+
/Users/$USER/Caches/Google/Chrome/Default/Cache/
+
</pre>
+
 
+
On Windows XP
+
<pre>
+
C:\Documents and Settings\%USERNAME%\Local Settings\Application Data\Chromium\User Data\Cache\
+
C:\Documents and Settings\%USERNAME%\Local Settings\Application Data\Google\Chrome\User Data\Cache\
+
</pre>
+
 
+
On Windows Vista and later
+
<pre>
+
C:\Users\%USERNAME%\AppData\Local\Google\Chromium\Default\Cache\
+
C:\Users\%USERNAME%\AppData\Local\Google\Chrome\User Data\Default\Cache\
+
</pre>
+
 
+
The Chrome Cache contains different files with the following file names:
+
* index
+
* data_#; where # contains a decimal digit.
+
* f_######; where # contains a hexadecimal digit.
+
 
+
For more info see Chrome developers site [http://www.chromium.org/developers/design-documents/network-stack/disk-cache].
+
 
+
== History ==
+
Chrome stores the history of visited sites in a file named '''History'''. This file uses the [[SQLite database format]].
+
 
+
The '''History''' file can be found in same location as the '''Preferences''' file.
+
 
+
There is also '''Archived History''' that predates information in the '''History''' file.
+
Note that the '''Archived History''' only contains visits.
+
 
+
=== Timestamps ===
+
The '''History''' file uses the different timestamps.
+
 
+
==== visits.visit_time ====
+
 
+
The '''visits.visit_time''' is in (the number of) microseconds since January 1, 1601 UTC
+
 
+
Some Python code to do the conversion into human readable format:
+
<pre>
+
date_string = datetime.datetime( 1601, 1, 1 )
+
            + datetime.timedelta( microseconds=timestamp )
+
</pre>
+
 
+
Note that this timestamp is not the same as a Windows filetime which is (the number of) 100 nanoseconds since January 1, 1601 UTC
+
 
+
==== downloads.start_time ====
+
 
+
The '''downloads.start_time''' is in (the number of) seconds since January 1, 1970 UTC
+
 
+
Some Python code to do the conversion into human readable format:
+
<pre>
+
date_string = datetime.datetime( 1970, 1, 1 )
+
            + datetime.timedelta( seconds=timestamp )
+
</pre>
+
 
+
=== Example queries ===
+
Some example queries:
+
 
+
To get an overview of the visited sites:
+
<pre>
+
SELECT datetime(((visits.visit_time/1000000)-11644473600), "unixepoch"), urls.url, urls.title FROM urls, visits WHERE urls.id = visits.url;
+
</pre>
+
 
+
Note that the visit_time conversion looses precision.
+
 
+
To get an overview of the downloaded files:
+
<pre>
+
SELECT datetime(downloads.start_time, "unixepoch"), downloads.url, downloads.full_path, downloads.received_bytes, downloads.total_bytes FROM downloads;
+
</pre>
+
 
+
How the information of the downloaded files is stored in the database can vary per version of Chrome as of version 26:
+
<pre>
+
SELECT datetime(((downloads.start_time/1000000)-11644473600), "unixepoch"), downloads.target_path, downloads_url_chains.url, downloads.received_bytes, downloads.total_bytes \
+
FROM downloads, downloads_url_chains WHERE downloads.id = downloads_url_chains.id;
+
</pre>
+
 
+
== Cookies ==
+
Chrome stores the cookies in a file named '''Cookies'''. This file uses the [[SQLite database format]].
+
 
+
=== Extension Cookies ===
+
Chrome stores the cookies used by extensions in a file named '''Extension Cookies'''. This file uses the [[SQLite database format]].
+
 
+
<pre>
+
SELECT datetime(((cookies.creation_utc/1000000)-11644473600), "unixepoch"), cookies.host_key, cookies.name, cookies.value, cookies.path, \
+
datetime(((cookies.expires_utc/1000000)-11644473600), "unixepoch"), cookies.secure, cookies.httponly, datetime(((cookies.last_access_utc/1000000)-11644473600), "unixepoch"), \
+
cookies.has_expires, cookies.persistent, cookies.priority FROM cookies;
+
</pre>
+
  
 
== See Also ==
 
== See Also ==
 
+
* [[bzip2]]
* [[SQLite database format]]
+
* [[tar]]
  
 
== External Links ==
 
== External Links ==
* [http://en.wikipedia.org/wiki/Google_Chrome Wikipedia article on Google Chrome]
 
* [http://www.chromium.org/user-experience/user-data-directory The Chromium Projects - User Data Directory]
 
* [http://www.chromium.org/developers/design-documents/network-stack/disk-cache Chrome Disk Cache]
 
* [http://www.google.com/support/forum/p/Chrome/thread?tid=3511015c72a7b314&hl=en Chrome support forum article random 10 character hostnames on startup]
 
* [http://www.useragentstring.com/pages/Chrome/ Chrome User Agent strings]
 
* [http://computer-forensics.sans.org/blog/2010/01/21/google-chrome-forensics/ Google Chrome Forensics] by [[Kristinn Guðjónsson]], January 21, 2010
 
* [http://linuxsleuthing.blogspot.ch/2013/02/cashing-in-on-google-chrome-cache.html?m=1 Cashing in on the Google Chrome Cache], [[John Lehr]], February 24, 2013
 
* [http://www.obsidianforensics.com/blog/history-index-files-removed-from-chrome/ History Index files removed from Chrome v30], by Ryan Benson, October 2, 2013
 
* [https://hindsight-internet-history.googlecode.com/files/Evolution_of_Chrome_Databases.png Evolution of Chrome Databases], by Ryan Benson, November 12, 2013
 
  
== Tools ==
+
* [http://www.gzip.org/format.txt The gzip file format], by the [http://www.gzip.org/ gzip project]
=== Open Source ===
+
* [http://www.gzip.org/algorithm.txt The gzip compression algorithm], by the [http://www.gzip.org/ gzip project]
* [https://code.google.com/p/hindsight-internet-history/ hindsight-internet-history]
+
* [http://tools.ietf.org/html/rfc1952 RFC1952: GZIP file format specification version 4.3], by [[IETF]]
 +
* [http://en.wikipedia.org/wiki/Gzip Wikipedia: gzip]
  
[[Category:Applications]]
+
[[Category:File Formats]]
[[Category:Web Browsers]]
+

Revision as of 08:16, 30 April 2014

Information icon.png

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

File format

The gzip file (.gz) format consists of:

  • a file header
  • optional headers
    • extra fields
    • original file name
    • comment
    • header checksum
  • compressed data (commonly used compression method DEFLATE, without zlib header)
  • a file footer
Characteristics Description
Byte order little-endian
Date and time values POSIX timestamp
Number of seconds since January 1, 1970 00:00:00 UTC
Character strings ISO 8859-1 (LATIN-1)

File header

The file header is 10 bytes in size and contains:

Offset Size Value Description
0 2 0x1f 0x8b Signature (or identification byte 1 and 2)
2 1 Compression Method
3 1 Flags
4 4 Last modification time
Contains a POSIX timestamp.
8 1 Compression flags (or extra flags)
9 1 Operating system
Value that indicates on which operating system the gzip file was created.

Compression method

Value Identifier Description
0 - 7 Reserved
8 deflate deflate compressed data

Flags

Value Identifier Description
0x01 FTEXT If set the uncompressed data needs to be treated as text instead of binary data.
This flag hints end-of-line conversion for cross-platform text files but does not enforce it.
0x02 FHCRC The file contains a header checksum (CRC-16)
0x04 FEXTRA The file contains extra fields
0x08 FNAME The file contains an original file name string
0x10 FCOMMENT The file contains comment
0x20 Reserved
0x40 Reserved
0x80 Reserved

Notes:

  • Reserved flags bits must be zero.
  • The FHCRC bit was never set by versions of gzip up to 1.2.4, even though it was documented with a different meaning in gzip 1.2.4.

Compression flags

This value contains flags specific to the compression method.

Compression flags - deflate

If compression method value is 8 (deflate) the following compression flags can be used:

Value Identifier Description
0x02 compressor used maximum compression, slowest algorithm
0x04 compressor used fastest algorithm

Operating System

Value Identifier Description
0 FAT filesystem (MS-DOS, OS/2, NT/Win32)
1 Amiga
2 VMS (or OpenVMS)
3 Unix
4 VM/CMS
5 Atari TOS
6 HPFS filesystem (OS/2, NT)
7 Macintosh
8 Z-System
9 CP/M
10 TOPS-20
11 NTFS filesystem (NT)
12 QDOS
13 Acorn RISCOS
255 unknown

Optional headers

Extra fields

This value is present in the file if the FEXTRA flag is set in the file header flags.

The extra field are variable of size and contains:

Offset Size Value Description
0 2 Extra field data size
Value in bytes.
2 ... Extra field data

Original file name

This value is present in the file if the FNAME flag is set in the file header flags.

This is the original name of the file being compressed, with any directory components removed, and, if the file being compressed is on a file system with case insensitive names, forced to lower case.

Contains an ISO 8859-1 (LATIN-1) string with end-of-string character.

Comment

This value is present in the file if the FCOMMENT flag is set in the file header flags.

Contains an ISO 8859-1 (LATIN-1) string with end-of-string character. Line breaks should be denoted by a single line feed character.

Header checksum

The header checksum contain a CRC-16 that consists of the two least significant bytes of the CRC-32 for all bytes of the gzip header up to and not including the CRC-16.

File footer

The file footer is 8 bytes in size and contains:

Offset Size Value Description
0 4 Checksum (CRC-32)
4 4 Uncompressed data size
Value in bytes.

See Also

External Links