<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Digital Investigation</title>
	<atom:link href="https://digitalinvestigation.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://digitalinvestigation.wordpress.com</link>
	<description>Digital evidence: if it&#039;s there, we&#039;ll find it</description>
	<lastBuildDate>Fri, 07 Dec 2012 11:27:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<site xmlns="com-wordpress:feed-additions:1">29307891</site><cloud domain='digitalinvestigation.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>https://secure.gravatar.com/blavatar/8c441487b573643bb3aad16a9bbe4fd4360beece9df1fb24daf12e067728cb4d?s=96&#038;d=https%3A%2F%2Fs0.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Digital Investigation</title>
		<link>https://digitalinvestigation.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="https://digitalinvestigation.wordpress.com/osd.xml" title="Digital Investigation" />
	<atom:link rel='hub' href='https://digitalinvestigation.wordpress.com/?pushpress=hub'/>
	<item>
		<title>Reverse Engineering Evernote Penultimate (or: When is a picture not a picture?)</title>
		<link>https://digitalinvestigation.wordpress.com/2012/12/05/reverse-engineering-evernote-penultimate-or-when-is-a-picture-not-a-picture/</link>
					<comments>https://digitalinvestigation.wordpress.com/2012/12/05/reverse-engineering-evernote-penultimate-or-when-is-a-picture-not-a-picture/#comments</comments>
		
		<dc:creator><![CDATA[CCL-Forensics]]></dc:creator>
		<pubDate>Wed, 05 Dec 2012 10:18:24 +0000</pubDate>
				<category><![CDATA[Computer forensics]]></category>
		<category><![CDATA[Mobile phone forensics]]></category>
		<category><![CDATA[R&D]]></category>
		<category><![CDATA[Alex Caithness]]></category>
		<category><![CDATA[CCL-Forensics]]></category>
		<category><![CDATA[evernote]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[NSKeyedArchiver]]></category>
		<category><![CDATA[penultimate]]></category>
		<category><![CDATA[Plist]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[svg]]></category>
		<guid isPermaLink="false">http://digitalinvestigation.wordpress.com/?p=366</guid>

					<description><![CDATA[In this post Alex Caithness takes a look at “Penultimate” on the iPad and discovers that a picture paints a thousand words… but only once you work out how that picture is stored. Recently we came up against an iPad &#8230; <a href="https://digitalinvestigation.wordpress.com/2012/12/05/reverse-engineering-evernote-penultimate-or-when-is-a-picture-not-a-picture/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><i>In this post Alex Caithness takes a look at “Penultimate” on the iPad and discovers that a picture paints a thousand words… but only once you work out how that picture is stored.</i></p>
<p>Recently we came up against an iPad note-taking application by the name of <a href="https://evernote.com/penultimate/">“Penultimate”</a>. As a user it’s actually really quite a nice app to use: you can create multiple “notebooks” each with as many pages as you require on which you can jot down notes, draw diagrams or just doodle with a stylus or your finger. For a user it’s nice, simple and intuitive, for an intrepid forensic analyst, it’s not quite as straight-forward…</p>
<div data-shortcode="caption" id="attachment_367" style="width: 594px" class="wp-caption aligncenter"><a href="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/hello-world-app-screenshot.png"><img aria-describedby="caption-attachment-367" data-attachment-id="367" data-permalink="https://digitalinvestigation.wordpress.com/2012/12/05/reverse-engineering-evernote-penultimate-or-when-is-a-picture-not-a-picture/hello-world-app-screenshot/" data-orig-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/hello-world-app-screenshot.png" data-orig-size="768,1024" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Penultimate Hello World Screenshot" data-image-description="" data-image-caption="&lt;p&gt;Penultimate Screenshot&lt;/p&gt;
" data-medium-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/hello-world-app-screenshot.png?w=225" data-large-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/hello-world-app-screenshot.png?w=584" class="size-full wp-image-367" alt="Penultimate Hello World Screenshot" src="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/hello-world-app-screenshot.png?w=584&#038;h=778" height="778" width="584" srcset="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/hello-world-app-screenshot.png?w=584&amp;h=779 584w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/hello-world-app-screenshot.png?w=113&amp;h=150 113w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/hello-world-app-screenshot.png?w=225&amp;h=300 225w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/hello-world-app-screenshot.png 768w" sizes="(max-width: 584px) 100vw, 584px" /></a><p id="caption-attachment-367" class="wp-caption-text">Penultimate Screenshot</p></div>
<p>After installing the application on a test iPad, creating a couple of notebooks and having a doodle in each of them, I performed an extraction of the device. Poking through the application’s folder, this is the layout of the files which we can acquire with a backup-style acquisition:</p>
<pre>com.cocoabox.penultimate
└───Library
 ├───Preferences
 │     com.cocoabox.penultimate.plist
 │ 
 └───Private Documents
 │     notebookList
 │ 
 └───notebooks
 │     notebookListBackup
 │ 
 ├───23FDA4FF-CE5E-4353-8D9A-B0C3E3E8AAE7
 │     100F53F2-BD1F-4046-8104-714E42264DAE
 │ 
 └───DD47D226-0CB3-460F-A0F9-3A7E2A795B3D
       BBDC9CD6-2685-4AFF-BCB4-D370F975A3F1
       BEB76173-1F62-472B-B0DC-F69EF039A59F
       C1766626-9BD2-44F9-A2DD-D7C4F23367A8</pre>
<p>Now, ideally what we’d liked to have seen at this point are some image files, a nice friendly JPEG, GIF or PNG or two would have been just lovely. But no, it’s not going to be that easy (and, in fairness, if it had been I wouldn’t be bothering with this blog would I?).</p>
<p>So what do we actually have? Well, we can see the familiar “Library” folder in which we find the (also familiar) “Preferences” folder which contains a property list, the contents of which are mostly mundane (though we do have application launch counts and dates which may be of interest in some situations). More interesting is the “Private Documents” folder and the files and folders which are contained within it.</p>
<p>In the root of the Private Documents folder is a binary property list file named “notebookList”. It is a ‘NSKeyedArchiver’ plist, which means, as we <a title="Geek post: NSKeyedArchiver files – what are they, and how can I use them?" href="https://digitalinvestigation.wordpress.com/2012/04/04/geek-post-nskeyedarchiver-files-what-are-they-and-how-can-i-use-them/">discussed in a previous blog</a>, it needs some additional processing in order for us to see the actual structure of the data. Luckily I had <a href="http://www.cclgroupltd.com/Buy-Software/pip-xml-and-plist-parsing-tool.html#">PIP</a> and the <a href="http://code.google.com/p/ccl-bplist/">“ccl_bplist” Python module</a> to hand, both of which can perform that transformation. With the data structure untangled I proceeded with digging around to see what, if anything, we could extract from the “notebookList”.</p>
<p>Among some less interesting data, the root object contains a list of the notebook objects which are stored by the device, under the “notebooks” key.</p>
<div data-shortcode="caption" id="attachment_372" style="width: 358px" class="wp-caption aligncenter"><a href="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/01-notebooklist-notebooks-key.png"><img aria-describedby="caption-attachment-372" data-attachment-id="372" data-permalink="https://digitalinvestigation.wordpress.com/2012/12/05/reverse-engineering-evernote-penultimate-or-when-is-a-picture-not-a-picture/01-notebooklist-notebooks-key/" data-orig-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/01-notebooklist-notebooks-key.png" data-orig-size="348,448" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="notebookList in PIP" data-image-description="" data-image-caption="&lt;p&gt;notebookList in PIP&lt;/p&gt;
" data-medium-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/01-notebooklist-notebooks-key.png?w=233" data-large-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/01-notebooklist-notebooks-key.png?w=348" class="size-full wp-image-372" alt="notebookList in PIP" src="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/01-notebooklist-notebooks-key.png?w=584"   srcset="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/01-notebooklist-notebooks-key.png 348w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/01-notebooklist-notebooks-key.png?w=117&amp;h=150 117w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/01-notebooklist-notebooks-key.png?w=233&amp;h=300 233w" sizes="(max-width: 348px) 100vw, 348px" /></a><p id="caption-attachment-372" class="wp-caption-text">notebookList in PIP</p></div>
<p>Each of the notebook objects (which are represented by dictionaries in the property list) contain the keys: &#8216;name&#8217;, &#8216;title&#8217;, &#8216;pageNames&#8217;, &#8216;created&#8217;, &#8216;modified&#8217;,  &#8216;changeCount&#8217;, &#8216;blankPages&#8217;, &#8216;creatingDeviceId&#8217;, &#8216;editingPageName&#8217;, &#8216;pageDataIsCooked&#8217;, &#8216;versionMajor&#8217;, &#8216;versionMinor&#8217;, &#8216;pagePaperStyles&#8217;, &#8216;paperStyle&#8217;, &#8216;imported&#8217; , &#8216;coverColor&#8217;, &#8216;originalName&#8217;.</p>
<p>The first few there are of immediate interest: the value of “title” does indeed contain the title of the notebooks that I created during my testing and the “created” and “modified” timestamps also ring true. The values of the “name” keys are familiar as well, albeit for a different reason; in my test data we see the “name” values “DD47D226-0CB3-460F-A0F9-3A7E2A795B3D” and “23FDA4FF-CE5E-4353-8D9A-B0C3E3E8AAE7” – matching the directory names that were extracted underneath the “notebooks” folder (see above). Beyond this, the “pageName” key contains a list of values which also match the names of files in each of the “name” directories.</p>
<p>So, with the “notebookList” file we have some useful metadata and a helpful guide to how the other files are organised, but there’s still no sign of the content of the notes themselves. Delving deeper into the folder structure, our next stop is one of the files which was named in the “pageName” list mentioned above.</p>
<p>Opening one of the “page” files we find another “NSKeyedArchiver” property list. After unravelling the structure of the file we find a top-level object containing further metadata (including a “blankDate” which appears to match the “created” timestamp reported in the “notebookList” and the dimensions of the note) along with a list of “layers”. Each of the “layer” objects (again represented by dictionaries) have keys for the layer’s colour (more on that later) the layer’s dimensions and a list of “layerRects” – sections of the layer where the user has drawn their notes; and that’s where we finally find the image itself.</p>
<p>Sort of.</p>
<div data-shortcode="caption" id="attachment_371" style="width: 594px" class="wp-caption aligncenter"><a href="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/page-object-layout.png"><img aria-describedby="caption-attachment-371" data-attachment-id="371" data-permalink="https://digitalinvestigation.wordpress.com/2012/12/05/reverse-engineering-evernote-penultimate-or-when-is-a-picture-not-a-picture/page-object-layout/" data-orig-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/page-object-layout.png" data-orig-size="960,720" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Structure of the page object" data-image-description="" data-image-caption="&lt;p&gt;Structure of the page object&lt;/p&gt;
" data-medium-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/page-object-layout.png?w=300" data-large-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/page-object-layout.png?w=584" class="size-full wp-image-371" alt="Structure of the page object" src="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/page-object-layout.png?w=584&#038;h=437" height="437" width="584" srcset="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/page-object-layout.png?w=584&amp;h=438 584w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/page-object-layout.png?w=150&amp;h=113 150w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/page-object-layout.png?w=300&amp;h=225 300w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/page-object-layout.png?w=768&amp;h=576 768w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/page-object-layout.png 960w" sizes="(max-width: 584px) 100vw, 584px" /></a><p id="caption-attachment-371" class="wp-caption-text">Structure of the page object</p></div>
<p>Each of the “layerRects” objects are represented by (and this shouldn’t be a surprise by now) a dictionary. There are two keys: firstly “rect” which contains a string of two sets of “x,y” co-ordinates: the bounds of this layerRect on the page. The second key is “values” which requires a little extra explanation. As noted in my <a title="Geek post: NSKeyedArchiver files – what are they, and how can I use them?" href="https://digitalinvestigation.wordpress.com/2012/04/04/geek-post-nskeyedarchiver-files-what-are-they-and-how-can-i-use-them/">previous post on NSKeyedArchiver files</a>, their function is to represent a serialisation of objects; the object under the “values” key is a “CBMutableFloatArray” which is programmer talk for a list of floating-point numbers. With this in mind we quite reasonably expect to see just that – a list of floating point numbers; but no, instead we get a data field containing binary data! As nothing else in this data had been straight-forward this was disappointing, but by this point didn’t surprise me. Floating-point numbers (like any numerical data) can be represented quite happily in binary, so I set about trying to turn the binary data into a list of floating-point numbers. I extracted one of these data fields and with a nice <a title="An analyst enthuses about Python. No, not that one. The geeky stuff." href="https://digitalinvestigation.wordpress.com/2012/02/23/an-analyst-enthuses-about-python-no-not-that-one-the-geeky-stuff/">Python </a>one-liner did just that:</p>
<pre>&gt;&gt;&gt; struct.unpack("&lt;18f", data)
(282.0, 589.0, 5.506037712097168, 281.8666687011719, 588.2999877929688, 5.506037712097168, 281.73333740234375, 587.5999755859375, 5.506037712097168, 281.5999755859375, 586.9000244140625, 5.506037712097168, 281.4666442871094, 586.2000122070312, 5.506037712097168, 281.33331298828125, 585.5, 5.506037712097168)</pre>
<p>So now we can see the numbers, but what did they mean? The meaning becomes clearer if we group them into threes:</p>
<pre>282.0, 589.0, 5.506037712097168
281.8666687011719, 588.2999877929688, 5.506037712097168
281.73333740234375, 587.5999755859375, 5.506037712097168
281.5999755859375, 586.9000244140625, 5.506037712097168
281.4666442871094, 586.2000122070312, 5.506037712097168
281.33331298828125, 585.5, 5.506037712097168</pre>
<p>What we have here is sets of x-y co-ordinates and another value (the meaning of which will become clearer later). So, here, finally is our drawing; stored as a list of co-ordinates rather than any conventional graphics format – the combination of the points in the “layerRects” in each of the layer objects gives you the full picture.</p>
<p>But how to present this data? A list of co-ordinates like this is of little to no use; we want to see the image itself. So I got to thinking: how does the application treat these co-ordinates? Well, when the user draws in the application they are essentially ‘painting’: moving a circular ‘brush’ around the screen making up the lines in the drawing, so if I was able to plot a circle at each of these co-ordinates perhaps I would see the picture? This thought process also gave me an idea as to what the third value in each of the co-ordinate groupings might represent: part of what makes the drawings look natural is that the “line” that is drawn is not of a uniform width, it grows and shrinks with the speed at which the finger or stylus moves, giving an impression of weight – perhaps the final value related to this?</p>
<p>So how to plot these co-ordinates? First of all I looked at various Python imaging libraries (PIL and PyGame both came on my radar), but there were issues with both (especially with PIL which still lacks a proper Py3k port) so I turned my attention to an alternative solution: SVG. <a href="http://www.w3.org/Graphics/SVG/">SVG (Scalable Vector Graphics)</a> is a graphics format specified by the W3C; it uses XML to describe 2D graphics. Because SVG just uses XML, no imaging libraries would be required; I could simply generate textual mark-up describing where each of my circular points should be plotted on the screen. Taking the data above extracted above as an example, the mark-up would be along the lines of:</p>
<pre>&lt;!DOCTYPE svg&gt;
&lt;svg height="865" version="1.1" viewBox="0 0 718 865" 
     width="718" xmlns="http://www.w3.org/2000/svg"&gt;
    &lt;circle cx="282.0" cy="589.0" 
            fill="#000000" r="5.506037712097168"/&gt;
    &lt;circle cx="281.8666687011719" cy="588.2999877929688" 
            fill="#000000" r="5.506037712097168"/&gt;
    &lt;circle cx="281.73333740234375" cy="587.5999755859375" 
            fill="#000000" r="5.506037712097168"/&gt;
    &lt;circle cx="281.5999755859375" cy="281.5999755859375" 
            fill="#000000" r="5.506037712097168"/&gt;
    &lt;circle cx="281.4666442871094" cy="586.2000122070312" 
            fill="#000000" r="5.506037712097168"/&gt;
    &lt;circle cx="281.33331298828125" cy="585.5" 
            fill="#000000" r="5.506037712097168"/&gt;
&lt;/svg&gt;</pre>
<p>Each “circle” tag has an x and y co-ordinate (“cx” and “cy”) a fill colour (here expressed as an html colour code – black in this case) and a radius (“r”). Running some tests gave some good output; but things weren’t quite right, firstly, and most importantly, the image was mirrored in the y-axis, presumably caused by a difference of opinion between Penultimate and SVG as to where the y-axis originates, an easy fix (just subtract the ‘y’ value from the height of the image and use that value instead). Also, the lines in the writing all looked very chubby, making writing very tricky to read. Theorising that this was caused by Penultimate storing diameters and SVG requiring radii, I halved the value which improved things, but comparing the output with what I could see on the screen things still weren’t quite looking right so on a whim I halved the value again which made things look right (I’m not entirely sure why it should be the case that you have to quarter the value – it may be to do with penultimate adding a ‘feathered’ fade to the brush which increases it’s diameter though).</p>
<p>I created a proof-of-concept Python script to check that my thinking was correct and I was pleased to see that the output now matched what I could see on the iPad’s screen, save for the fact that the iPad was in glorious Technicolor and my script’s output was monochrome. I mentioned previously that the “layer” objects contained colour information under the unsurprisingly named “color” key.</p>
<p>The object stored in the “color” key has values for red, blue and green – each one a value between 0 and 1. Those readers who have had even the briefest dalliance with graphic manipulation programs will be familiar with colour-sliders: combining red, green and blue in different proportions in order to generate different colours, which is what these values represented. My SVG generated output was working with HTML colour codes which are made up of 3 bytes, each representing an amount of red, green and blue, this time using values from 0x00 to 0x0FF, to get colour into my output, all I had to do is multiply 0xFF by the correct value from the “layer” object’s colour fields and recombine those values into an HTML colour code. I modified my script and now the output reflected both the form and colour displayed by the App on the iPad.</p>
<div data-shortcode="caption" id="attachment_369" style="width: 594px" class="wp-caption aligncenter"><a href="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/output-comparison1.png"><img aria-describedby="caption-attachment-369" loading="lazy" data-attachment-id="369" data-permalink="https://digitalinvestigation.wordpress.com/2012/12/05/reverse-engineering-evernote-penultimate-or-when-is-a-picture-not-a-picture/output-comparison1/" data-orig-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/output-comparison1.png" data-orig-size="1530,1022" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Comparison between iPad and script output 1" data-image-description="" data-image-caption="&lt;p&gt;Comparison between iPad and script output (1)&lt;/p&gt;
" data-medium-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/output-comparison1.png?w=300" data-large-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/output-comparison1.png?w=584" class="size-full wp-image-369" alt="Comparison between iPad and script output 1" src="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/output-comparison1.png?w=584&#038;h=390" height="390" width="584" srcset="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/output-comparison1.png?w=584&amp;h=390 584w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/output-comparison1.png?w=1168&amp;h=780 1168w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/output-comparison1.png?w=150&amp;h=100 150w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/output-comparison1.png?w=300&amp;h=200 300w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/output-comparison1.png?w=768&amp;h=513 768w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/output-comparison1.png?w=1024&amp;h=684 1024w" sizes="(max-width: 584px) 100vw, 584px" /></a><p id="caption-attachment-369" class="wp-caption-text">Comparison between iPad and script output (1)</p></div>
<div data-shortcode="caption" id="attachment_370" style="width: 594px" class="wp-caption aligncenter"><a href="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/output-comparison2.png"><img aria-describedby="caption-attachment-370" loading="lazy" data-attachment-id="370" data-permalink="https://digitalinvestigation.wordpress.com/2012/12/05/reverse-engineering-evernote-penultimate-or-when-is-a-picture-not-a-picture/output-comparison2/" data-orig-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/output-comparison2.png" data-orig-size="1530,1022" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Comparison between iPad and script output 2" data-image-description="" data-image-caption="&lt;p&gt;Comparison between iPad and script output (2)&lt;/p&gt;
" data-medium-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/output-comparison2.png?w=300" data-large-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/output-comparison2.png?w=584" class="size-full wp-image-370" alt="Comparison between iPad and script output 2" src="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/output-comparison2.png?w=584&#038;h=390" height="390" width="584" srcset="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/output-comparison2.png?w=584&amp;h=390 584w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/output-comparison2.png?w=1168&amp;h=780 1168w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/output-comparison2.png?w=150&amp;h=100 150w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/output-comparison2.png?w=300&amp;h=200 300w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/output-comparison2.png?w=768&amp;h=513 768w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/output-comparison2.png?w=1024&amp;h=684 1024w" sizes="(max-width: 584px) 100vw, 584px" /></a><p id="caption-attachment-370" class="wp-caption-text">Comparison between iPad and script output (2)</p></div>
<p>Working on extracting data from Penultimate was a particularly enjoyable experience as it required a combination of a number of different concepts and led to the use of a number of different technologies to create a solution to automate the extraction of the data, which when it all boiled down was satisfyingly simple.</p>
<p>And as to the question: when is a picture not a picture? Well, quite simply: when it’s a series of serialised floating-point co-ordinate triplets representing points on a page, broken up into rectangles on a layer on a page which is stored in a NSKeyedArchiver property list file (obviously!).</p>
<p>If you have any questions, comments or queries regarding this post, as always you can contact us by dropping an email to research@ccl-forensics.com or by leaving a comment below.</p>
<p><strong>Update: </strong>As requested I&#8217;ve uploaded the script for research purposes. You can find it here: <a href="http://pastebin.com/VYenpXUi">http://pastebin.com/VYenpXUi </a></p>
<p><strong>Alex Caithness, CCL Forensics</strong></p>
]]></content:encoded>
					
					<wfw:commentRss>https://digitalinvestigation.wordpress.com/2012/12/05/reverse-engineering-evernote-penultimate-or-when-is-a-picture-not-a-picture/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">366</post-id>
		<media:content url="https://0.gravatar.com/avatar/69d8d1e2b4b3bf7ff73bd8d2b0b9ac55b57cb85db73c1811cb0bc6053ecc3d0a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">digitalinvestigation</media:title>
		</media:content>

		<media:content url="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/hello-world-app-screenshot.png" medium="image">
			<media:title type="html">Penultimate Hello World Screenshot</media:title>
		</media:content>

		<media:content url="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/01-notebooklist-notebooks-key.png" medium="image">
			<media:title type="html">notebookList in PIP</media:title>
		</media:content>

		<media:content url="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/page-object-layout.png" medium="image">
			<media:title type="html">Structure of the page object</media:title>
		</media:content>

		<media:content url="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/output-comparison1.png" medium="image">
			<media:title type="html">Comparison between iPad and script output 1</media:title>
		</media:content>

		<media:content url="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/12/output-comparison2.png" medium="image">
			<media:title type="html">Comparison between iPad and script output 2</media:title>
		</media:content>
	</item>
		<item>
		<title>Cell site blog: &#8216;consistent&#8217; data, or data &#8216;not inconsistent&#8217;</title>
		<link>https://digitalinvestigation.wordpress.com/2012/11/28/cell-site-blog-consistent-data-or-data-not-inconsistent/</link>
					<comments>https://digitalinvestigation.wordpress.com/2012/11/28/cell-site-blog-consistent-data-or-data-not-inconsistent/#comments</comments>
		
		<dc:creator><![CDATA[CCL-Forensics]]></dc:creator>
		<pubDate>Wed, 28 Nov 2012 08:48:59 +0000</pubDate>
				<category><![CDATA[Cell site analysis]]></category>
		<category><![CDATA[Criminal defence]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[call data records]]></category>
		<category><![CDATA[CDR]]></category>
		<category><![CDATA[cell]]></category>
		<category><![CDATA[cell site analysis]]></category>
		<category><![CDATA[cell site survey]]></category>
		<category><![CDATA[expert witness]]></category>
		<guid isPermaLink="false">http://digitalinvestigation.wordpress.com/?p=340</guid>

					<description><![CDATA[By Dr Iain Brodie, Senior Cell Site Expert As cell site experts we are often asked to consider whether cell site data is ‘consistent’ with a specific scenario, in the knowledge that our words can have a significant impact on &#8230; <a href="https://digitalinvestigation.wordpress.com/2012/11/28/cell-site-blog-consistent-data-or-data-not-inconsistent/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><strong>By Dr Iain Brodie, Senior <a href="http://www.cclgroupltd.com/Law-Enforcement/cell-site-analysis.html">Cell Site </a>Expert</strong></p>
<p>As <a href="http://www.cclgroupltd.com/Law-Enforcement/cell-site-analysis.html">cell site </a>experts we are often asked to consider whether cell site data is ‘consistent’ with a specific scenario, in the knowledge that our words can have a significant impact on how a jury thinks.</p>
<p><strong>For example</strong>, <strong>a typical question put to us might be:</strong>  <i>is the data for a particular mobile phone ‘consistent’ with it having been at the scene of a particular incident which occurred, say, in the centre of Birmingham at 12:00 on a particular day?</i></p>
<p>If the <a href="http://www.cclgroupltd.com/Law-Enforcement/cell-site-analysis.html">cell site </a>data for the phone shows that it connected via a cell site in the centre of Birmingham which serves the scene at 12:00, then in my opinion it is clear that the data is consistent with the phone having been at the scene. This does not mean that I think the phone necessarily WAS at the scene, as the cell ID used will cover an extended area and, of course, locations that are not the scene. Given the unpredictable ways in which phones are used, however – what data there is supports the contention that the phone was at the scene.</p>
<p>The situation is equally clear cut if, at 12:00, the phone connected via a cell in central London. It is physically impossible for the phone to have connected to a cell in London whilst located in Birmingham, so (if the records from the network are correct) such data would be in conflict with or inconsistent with the phone having been in central Birmingham at 12:00.</p>
<p>If, at 12:00 and 12:01 say, the phone connected via cells in central Coventry, the scenario is slightly different. It is not, under all circumstances, physically impossible for the phone to have connected to a cell in Coventry whilst located in Birmingham. But in all normal circumstances – given the huge number of other more likely cells in Birmingham for the phone to have used, I would still say that this data was in conflict with the phone having been in central Birmingham at 12:00. Such an opinion could be reinforced by carrying out further work if required, but in general such further work would not be required.</p>
<p>But imagine the data was less clear cut. For example, now my phone’s call data records show a cell site in Coventry connected to by the phone at 11:00, a cell site in Solihull at 11:30, a cell site in eastern Birmingham at 11:45 and a cell site in Wolverhampton connected to at 12:30.</p>
<p>In my opinion this data is again ‘consistent’ with the phone having been at the central Birmingham scene at 12:00, as the logical journey of the phone would have been close to the scene. Indeed there are not many plausible routes other than the phone passing close to the scene at 12:00 that could generate such data – although again, I do not believe the data means that the phone definitely was at the scene (and nowhere else) at 12:00.</p>
<p>If, however, the call data for the cell in Wolverhampton was not so. All we would have was call data consistent with movement of a phone towards the centre of Birmingham, but even less evidence that the phone was in the centre of Birmingham. Such a scenario presents quite a grey area for evidence of opinion. Some experts may say the data is still consistent with the phone being in the centre of Birmingham at 12:00, whilst it may be argued that there is, in fact, NO data consistent with the phone being in the centre of Birmingham at 12:00.</p>
<p>I would say that the data is consistent with the phone having travelled towards the centre of Birmingham in the times leading up to 12:00, although there is no data showing it had been used in central Birmingham.</p>
<p>A final scenario would be where the phone connected to a cell site in Coventry at 11:00 and again to the same cell site in Coventry at 12:45. In this scenario it is quite POSSIBLE that the phone had time to travel to the centre of Birmingham and back, but there is no data that would lead me to expect that this had been the case. Here I would use the phrase ‘<i>the data is ‘not inconsistent’ with the phone having been in the centre of Birmingham at 12:00 but there was no data indicating it had done so’.</i></p>
<p>This may seem like semantics. However, in a case where I gave evidence for the defence earlier this year (in Birmingham Crown Court as it happens), the prosecution expert asserted that there was cell site evidence ‘consistent’ with the defendant’s phone having been travelling away from a location of a crime at a particular time, when the cell site used for all of the relevant calls provided service at his home address. The prosecution expert’s use of the word ‘consistent’ here was challenged and the challenge was accepted by the court.</p>
<p>The judge, Justice John Royce in summing up said:</p>
<p><i>‘although the data is not in conflict with such a theory</i> &lt;that the defendant was at the relevant scene&gt;.  <i>The data</i> &lt;for the time in question.&gt; <i>is <span style="text-decoration:underline;">not consistent</span> with</i> being <i><span style="text-decoration:underline;">at</span> the site.  It could <span style="text-decoration:underline;">possibly be</span> that the phone was en route however from the site to the defendant’s home…&#8217;</i></p>
<p>&#8216;<em>the prosecution has been driven to trying to construct theories because of the absence of solid evidence.  They have tried to make bricks with but a few straws, and have done so with admirable skill and ingenuity.  But is this sufficient evidence to be left to the jury?  Could a jury, on this evidence, properly directed, safely convict?  The conclusion to which I am driven is that they could not. Accordingly, I shall direct the jury to return not guilty verdicts&#8217;</em></p>
<p>Had the prosecution expert’s semantics not been challenged, the outcome may have been different resulting, possibly, in a miscarriage of justice.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://digitalinvestigation.wordpress.com/2012/11/28/cell-site-blog-consistent-data-or-data-not-inconsistent/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">340</post-id>
		<media:content url="https://0.gravatar.com/avatar/69d8d1e2b4b3bf7ff73bd8d2b0b9ac55b57cb85db73c1811cb0bc6053ecc3d0a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">digitalinvestigation</media:title>
		</media:content>
	</item>
		<item>
		<title>New Epilog Signature files released</title>
		<link>https://digitalinvestigation.wordpress.com/2012/11/02/new-epilog-signature-files-released/</link>
					<comments>https://digitalinvestigation.wordpress.com/2012/11/02/new-epilog-signature-files-released/#respond</comments>
		
		<dc:creator><![CDATA[CCL-Forensics]]></dc:creator>
		<pubDate>Fri, 02 Nov 2012 13:14:03 +0000</pubDate>
				<category><![CDATA[Computer forensics]]></category>
		<category><![CDATA[Forensic software tools]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[R&D]]></category>
		<category><![CDATA[Alex Caithness]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[CCL-Forensics]]></category>
		<category><![CDATA[computer]]></category>
		<category><![CDATA[digital evidence]]></category>
		<category><![CDATA[digital forensics]]></category>
		<category><![CDATA[epil]]></category>
		<category><![CDATA[Epilog]]></category>
		<category><![CDATA[evidence]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[smartphone]]></category>
		<category><![CDATA[SQLite]]></category>
		<guid isPermaLink="false">http://digitalinvestigation.wordpress.com/?p=337</guid>

					<description><![CDATA[Epilog Signature files allow users to add specific support for new databases they encounter and although they are designed so that Epilog’s users can create their own signatures when the need arises, CCL-Forensics are committed to updating and releasing a sets &#8230; <a href="https://digitalinvestigation.wordpress.com/2012/11/02/new-epilog-signature-files-released/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>Epilog Signature files allow users to add specific support for new databases they encounter and although they are designed so that Epilog’s users can create their own signatures when the need arises, CCL-Forensics are committed to updating and releasing a sets of signatures, pre-written and ready to use.</p>
<p>In this new release we have had a real focus on smartphones adding support for:<br />
• iOS6<br />
• Android 4.0 (Ice Cream Sandwich)<br />
• Android 4.1 (Jelly Bean)<br />
• Android 3rd Party Applications<br />
• iOS 3rd Party Applications<br />
• Skype</p>
<p>We always welcome suggestions for signatures that you’d like to see added to the signature collection so please get in touch on <a href="mailto:epilog@ccl-forensics.com">epilog@ccl-forensics.com</a></p>
<p>For more information on epilog please visit our website &#8211; <a href="http://www.cclgroupltd.com/Buy-Software/">www.cclgroupltd.com/Buy-Software/</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://digitalinvestigation.wordpress.com/2012/11/02/new-epilog-signature-files-released/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">337</post-id>
		<media:content url="https://0.gravatar.com/avatar/69d8d1e2b4b3bf7ff73bd8d2b0b9ac55b57cb85db73c1811cb0bc6053ecc3d0a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">digitalinvestigation</media:title>
		</media:content>
	</item>
		<item>
		<title>Chrome Session and Tabs Files (and the puzzle of the pickle)</title>
		<link>https://digitalinvestigation.wordpress.com/2012/09/03/chrome-session-and-tabs-files-and-the-puzzle-of-the-pickle/</link>
					<comments>https://digitalinvestigation.wordpress.com/2012/09/03/chrome-session-and-tabs-files-and-the-puzzle-of-the-pickle/#comments</comments>
		
		<dc:creator><![CDATA[CCL-Forensics]]></dc:creator>
		<pubDate>Mon, 03 Sep 2012 09:57:58 +0000</pubDate>
				<category><![CDATA[Computer forensics]]></category>
		<category><![CDATA[Forensic software tools]]></category>
		<category><![CDATA[R&D]]></category>
		<category><![CDATA[Alex Caithness]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[forensics]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Reverse Engineering]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[Session]]></category>
		<category><![CDATA[SNSS]]></category>
		<category><![CDATA[Tabs]]></category>
		<guid isPermaLink="false">http://digitalinvestigation.wordpress.com/?p=325</guid>

					<description><![CDATA[In this blog post Alex Caithness investigates the file format and contents of Chrome’s “Current Tabs”, “Current Session”, “Last Tabs” and “Last Session” files and discovers that, even with the original source code at your side, you can still end &#8230; <a href="https://digitalinvestigation.wordpress.com/2012/09/03/chrome-session-and-tabs-files-and-the-puzzle-of-the-pickle/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><em>In this blog post Alex Caithness investigates the file format and contents of Chrome’s “Current Tabs”, “Current Session”, “Last Tabs” and “Last Session” files and discovers that, even with the original source code at your side, you can still end up getting yourself into a Pickle. </em></p>
<p><em>A link to a Python script for automating the process can be found at the end of the post.</em></p>
<p>I’ve been on a bit of a browser artefacts kick as of late, digging around both on desktop and mobile platforms for stuff I haven’t tackled before. Taking a peek in my preferred browser’s (Chrome) “AppData” folder revealed that the ubiquitous-ness of SQLite as a storage format means that inspecting the data for a lot of artefacts has been made pretty simple. I had also recently tackled the Chromium web-cache format for another project (the format is now also used both on Android and RIM Playbooks) and, with the pain that caused me still fresh in my mind I had no desire to revisit it. There were, however, four likely looking candidates for a quick probing in the form of the “Current Tabs”, “Current Session”, “Last Tabs” and “Last Session” files.</p>
<div data-shortcode="caption" id="attachment_326" style="width: 594px" class="wp-caption aligncenter"><a href="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/chrome_appdata_folder.png"><img aria-describedby="caption-attachment-326" loading="lazy" data-attachment-id="326" data-permalink="https://digitalinvestigation.wordpress.com/2012/09/03/chrome-session-and-tabs-files-and-the-puzzle-of-the-pickle/chrome_appdata_folder/" data-orig-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/chrome_appdata_folder.png" data-orig-size="589,358" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="chrome_appdata_folder" data-image-description="" data-image-caption="&lt;p&gt;Hello there&amp;#8230;&lt;/p&gt;
" data-medium-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/chrome_appdata_folder.png?w=300" data-large-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/chrome_appdata_folder.png?w=584" class="size-full wp-image-326" title="chrome_appdata_folder" src="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/chrome_appdata_folder.png?w=584&#038;h=354" alt="Chrome AppData Folder" width="584" height="354" srcset="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/chrome_appdata_folder.png?w=584&amp;h=355 584w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/chrome_appdata_folder.png?w=150&amp;h=91 150w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/chrome_appdata_folder.png?w=300&amp;h=182 300w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/chrome_appdata_folder.png 589w" sizes="(max-width: 584px) 100vw, 584px" /></a><p id="caption-attachment-326" class="wp-caption-text">Hello there&#8230;</p></div>
<p>Broadly speaking, these files store the state of the opened tabs, their back-forward lists and the sites displayed therein. The files can be used by Chrome to restore your previous browsing session when you restart the browser (if that’s how you have it set up) or in the event of a crash. It turns out that these files can contain some really rich data, but first you had to do battle with the file format…</p>
<p><a title="Parsing Apple System Log (ASL) files on iOS and OSX for Fun and Evidence (and a Python script to do it for you)" href="https://digitalinvestigation.wordpress.com/2012/06/18/parsing-apple-system-log-files-osx-ios/">In </a><a title="Cracking Android PINs and passwords" href="https://digitalinvestigation.wordpress.com/2012/02/20/cracking-android-pins-and-passwords/">previous </a><a title="Unlocking Android Pattern Locks" href="https://digitalinvestigation.wordpress.com/2012/02/16/unlocking-android-pattern-locks/">posts </a>I’ve made mention of the usefulness of having access to the source code that governs the format in which the data is to be stored, and as Chrome is open source I was heartened. “This shouldn’t be too tricky,” I thought to myself as I set about finding the ‘few lines of code’ which would unlock the file’s secrets… Let me tell you now: the Chrome source is a sprawling behemoth and my journey across the codebase (and on one occasion, outside of it) was long and arduous, and, when it comes down to it, it all boils down to understanding the ‘Pickle’…</p>
<div data-shortcode="caption" id="attachment_327" style="width: 594px" class="wp-caption aligncenter"><a href="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_header.png"><img aria-describedby="caption-attachment-327" loading="lazy" data-attachment-id="327" data-permalink="https://digitalinvestigation.wordpress.com/2012/09/03/chrome-session-and-tabs-files-and-the-puzzle-of-the-pickle/hex_header/" data-orig-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_header.png" data-orig-size="593,337" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Hex_Header" data-image-description="" data-image-caption="&lt;p&gt;The file header&lt;/p&gt;
" data-medium-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_header.png?w=300" data-large-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_header.png?w=584" class="size-full wp-image-327" title="Hex_Header" src="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_header.png?w=584&#038;h=331" alt="Header of the Session file" width="584" height="331" srcset="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_header.png?w=584&amp;h=332 584w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_header.png?w=150&amp;h=85 150w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_header.png?w=300&amp;h=170 300w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_header.png 593w" sizes="(max-width: 584px) 100vw, 584px" /></a><p id="caption-attachment-327" class="wp-caption-text">The file header</p></div>
<p>The file header was easy to track down, I headed over to the definition for session_backend (<a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/sessions/session_backend.cc?view=markup">src/chrome/browser/sessions/session_backend.cc</a>) where we confirm that “SNSS” is simply a file signature followed by a 32bit integer giving the version of the file, which, at the time of writing, should always be 1 (all data is stored little-endian). Also in this file we encounter a method named “AppendCommandsToFile” which appears to be responsible for writing the details into the files. The method describes that for each record, a 16-bit integer is written to the file giving the size in bytes of the record (not including this value), followed by an 8-bit “id” (which appears to relate to the ‘type’ of the record) and the contents of the “SessionCommand”.</p>
<div data-shortcode="caption" id="attachment_328" style="width: 594px" class="wp-caption aligncenter"><a href="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_record_overview.png"><img aria-describedby="caption-attachment-328" loading="lazy" data-attachment-id="328" data-permalink="https://digitalinvestigation.wordpress.com/2012/09/03/chrome-session-and-tabs-files-and-the-puzzle-of-the-pickle/hex_record_overview/" data-orig-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_record_overview.png" data-orig-size="592,836" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Hex_record_overview" data-image-description="" data-image-caption="&lt;p&gt;Record structure overview&lt;/p&gt;
" data-medium-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_record_overview.png?w=212" data-large-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_record_overview.png?w=584" class="size-full wp-image-328" title="Hex_record_overview" src="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_record_overview.png?w=584&#038;h=824" alt="Record structure overview" width="584" height="824" srcset="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_record_overview.png?w=584&amp;h=825 584w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_record_overview.png?w=106&amp;h=150 106w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_record_overview.png?w=212&amp;h=300 212w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_record_overview.png 592w" sizes="(max-width: 584px) 100vw, 584px" /></a><p id="caption-attachment-328" class="wp-caption-text">Record structure overview</p></div>
<p>So now I knew what the overview of the structure in the file was: a nice simple size, contents, size, contents, size, contents… etc. file format, with the records written sequentially, one after another. But I still had no information about the structure of those contents. SessionBackend was operating with a SessionComand object so I tracked down the source code describing this object (<a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/sessions/session_command.h?view=markup">src/chrome/browser/sessions/session_command.h</a>) but was disappointed to find the following explanation in the source code’s comments:</p>
<p><em>“SessionCommand contains a command id and arbitrary chunk of data. The id and chunk of data are specific to the service creating them.”</em></p>
<p>OK, so the information I wanted isn&#8217;t going to be here, but the comments go on to say:</p>
<p><em>“Both TabRestoreService and SessionService use SessionCommands to represent state on disk”</em></p>
<p>Aha! So although I hadn’t quite found what I was looking for here, I have found a useful signpost pointing in the right direction. Now, neither “TabRestoreService“ (<a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/sessions/tab_restore_service.h?view=markup">src/chrome/browser/sessions/tab_restore_service.h</a>) nor “SessionService” (<a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/sessions/session_service.h?view=markup">src/chrome/browser/sessions/session_service.h</a>) themselves give us the information we’re after, but both of them &#8216;inherit&#8217; from a common base class called “BaseSessionService” (<a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/sessions/base_session_service.cc?view=markup">src/chrome/browser/sessions/base_session_service.cc</a>) (I gave a brief overview of object oriented principals including inheritance in a <a href="https://digitalinvestigation.wordpress.com/2012/04/04/geek-post-nskeyedarchiver-files-what-are-they-and-how-can-i-use-them/">previous blog post</a>)  and it is in BaseSessionService where we finally get what we’re after…</p>
<p>BaseSessionService contains a method called “CreateUpdateTabNavigationCommand” which is responsible for writing that “arbitrary chunk of data” into the SessionCommand which eventually gets written to disk. The record starts with a 32 bit integer which gives the length of the data (this is in addition to the length value outside the SessionCommand). The rest of the SessionCommand’s contents structure is described in the table below.</p>
<div data-shortcode="caption" id="attachment_329" style="width: 594px" class="wp-caption aligncenter"><a href="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_sessioncommand.png"><img aria-describedby="caption-attachment-329" loading="lazy" data-attachment-id="329" data-permalink="https://digitalinvestigation.wordpress.com/2012/09/03/chrome-session-and-tabs-files-and-the-puzzle-of-the-pickle/hex_sessioncommand/" data-orig-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_sessioncommand.png" data-orig-size="593,836" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Hex_SessionCommand" data-image-description="" data-image-caption="&lt;p&gt;SessionCommand Structure&lt;/p&gt;
" data-medium-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_sessioncommand.png?w=213" data-large-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_sessioncommand.png?w=584" class="size-full wp-image-329" title="Hex_SessionCommand" src="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_sessioncommand.png?w=584&#038;h=823" alt="SessionCommand serialisation" width="584" height="823" srcset="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_sessioncommand.png?w=584&amp;h=823 584w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_sessioncommand.png?w=106&amp;h=150 106w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_sessioncommand.png?w=213&amp;h=300 213w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_sessioncommand.png 593w" sizes="(max-width: 584px) 100vw, 584px" /></a><p id="caption-attachment-329" class="wp-caption-text">SessionCommand structure</p></div>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="310"><strong>Data type</strong></td>
<td valign="top" width="307"><strong>Meaning</strong></td>
</tr>
<tr>
<td valign="top" width="310">32 bit Integer</td>
<td valign="top" width="307">Tab ID</td>
</tr>
<tr>
<td valign="top" width="310">32 bit Integer</td>
<td valign="top" width="307">Index in this tab’s back-forward list</td>
</tr>
<tr>
<td valign="top" width="310">ASCII String (32 bit Integer giving the length of the string in characters followed by an ASCII string of that length)</td>
<td valign="top" width="307">Page URL</td>
</tr>
<tr>
<td valign="top" width="310">UTF-16 String (32 bit Integer giving the length of the string in characters followed by a UTF-16 string of that length)</td>
<td valign="top" width="307">Page Title</td>
</tr>
<tr>
<td valign="top" width="310">Byte string (32 bit Integer giving the length of the string in bytes followed by a byte string of that length)</td>
<td valign="top" width="307">“State” (A data structure provided by the WebKit engine describing the current state of the page. We will look at it in detail later)</td>
</tr>
<tr>
<td valign="top" width="310">32 bit Integer</td>
<td valign="top" width="307">Transition type (explained below)</td>
</tr>
<tr>
<td valign="top" width="310">32 bit Integer</td>
<td valign="top" width="307">1 if the page has POST data, otherwise 0</td>
</tr>
<tr>
<td valign="top" width="310">ASCII String (see above)</td>
<td valign="top" width="307">Referrer URL</td>
</tr>
<tr>
<td valign="top" width="310">32 bit Integer</td>
<td valign="top" width="307">Referrer’s Policy</td>
</tr>
<tr>
<td valign="top" width="310">ASCII String</td>
<td valign="top" width="307">Original Request URL (for example if a redirect took place)</td>
</tr>
<tr>
<td valign="top" width="310">32 bit Integer</td>
<td valign="top" width="307">1 if the user-agent was overridden, otherwise 0</td>
</tr>
</tbody>
</table>
<p>As SessionCommands contents can be populated by other means, not every Session command contains data formatted as shown above. During testing it was shown that it is the SessionCommand’s 8-bit ID which identifies whether the record contains this kind of data (when the ID was 1 or 6 then this data format was found). Those with other IDs were typically much shorter (usually around16-32 bytes in length) and did not appear to contain information which was of so much interest.</p>
<p>There are a few fields in the table above which are worth taking a closer look at; the “State” field we’ll explore in detail later as it’s a complicated one. The “Transition type” is a little easier to explain; this field tells Chrome how the page was arrived at. The field will be an integer number, the meaning of which is described in the tables below. The value is essentially split into two sections: the least significant 8-bits of the integer give a type of transition and the most-significant 24-bits form a bit-mask which gives other details. These details are gathered from page_transition_types (<a href="http://src.chromium.org/viewvc/chrome/trunk/src/content/public/common/page_transition_types.h?view=markup">content/public/common/page_transition_types.h</a>).</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="196"><strong>Least Significant 8-bits Value</strong></td>
<td valign="top" width="420"><strong>Meaning</strong></td>
</tr>
<tr>
<td valign="top" width="196">0</td>
<td valign="top" width="420">User arrived at this page by clicking a link on another page</td>
</tr>
<tr>
<td valign="top" width="196">1</td>
<td valign="top" width="420">User typed URL into the Omnibar, or clicked a suggested URL in the Omnibar</td>
</tr>
<tr>
<td valign="top" width="196">2</td>
<td valign="top" width="420">User arrived at page through a  bookmark or similar (eg. “most visited” suggestions on a new tab)</td>
</tr>
<tr>
<td valign="top" width="196">3</td>
<td valign="top" width="420">Automatic navigation within a sub frame (eg an embedded ad)</td>
</tr>
<tr>
<td valign="top" width="196">4</td>
<td valign="top" width="420">Manual navigation in a sub frame</td>
</tr>
<tr>
<td valign="top" width="196">5</td>
<td valign="top" width="420">User selected suggestion from Omnibar (ie. typed part of an address or search term then selected a suggestion which was not a URL)</td>
</tr>
<tr>
<td valign="top" width="196">6</td>
<td valign="top" width="420">Start page (or specified as a command line argument)</td>
</tr>
<tr>
<td valign="top" width="196">7</td>
<td valign="top" width="420">User arrived at this page as a result of submitting a form</td>
</tr>
<tr>
<td valign="top" width="196">8</td>
<td valign="top" width="420">Page was reloaded; either by clicking the refresh button, hitting F5 or hitting enter in the address bar. Also given this transition type if the tab was opened as a result of restoring a previous session.</td>
</tr>
<tr>
<td valign="top" width="196">9</td>
<td valign="top" width="420">Generated as a result of a keyword search, not using the default search provider (for example using tab-to-search on Wikipedia). Additionally a transition of type 10 (see below) may also be generated for the url: http:// + keyword</td>
</tr>
<tr>
<td valign="top" width="196">10</td>
<td valign="top" width="420">See above</td>
</tr>
</tbody>
</table>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="196"><strong>Bit mask</strong></td>
<td valign="top" width="420"><strong>Meaning</strong></td>
</tr>
<tr>
<td valign="top" width="196">0x01000000</td>
<td valign="top" width="420">User used the back or forward buttons to arrive at this page</td>
</tr>
<tr>
<td valign="top" width="196">0x02000000</td>
<td valign="top" width="420">User used the address bar to trigger this navigation</td>
</tr>
<tr>
<td valign="top" width="196">0x04000000</td>
<td valign="top" width="420">User is navigating to the homepage</td>
</tr>
<tr>
<td valign="top" width="196">0x10000000</td>
<td valign="top" width="420">The beginning of a navigation chain</td>
</tr>
<tr>
<td valign="top" width="196">0x20000000</td>
<td valign="top" width="420">Last transition in a redirect chain</td>
</tr>
<tr>
<td valign="top" width="196">0x40000000</td>
<td valign="top" width="420">Transition was a client-side redirect (eg. caused by JavaScript or a meta-tag redirect)</td>
</tr>
<tr>
<td valign="top" width="196">0x80000000</td>
<td valign="top" width="420">Transition was a server-side redirect (ie a redirect specified in the HTTP response header)</td>
</tr>
</tbody>
</table>
<p>NB during testing, although the transition types looked correct in the “Current Session” and “Last Session” files, in the “Current Tabs” and “Last Tabs” files the transition type was always recorded as type 8 (Reloaded page).</p>
<p>When it comes to the record structure, there is still a little more to the story, and yes, this is where the Pickles come in.</p>
<p>This data structure is not being written directly to a file, but rather to what Chrome calls a “Pickle” (<a href="http://src.chromium.org/viewvc/chrome/trunk/src/base/pickle.h?view=markup">src/base/pickle.h</a>). A Pickle is a sort of ‘managed buffer’; a way for Chrome to write (and read) a bunch of values, like those in the tables above, into an area of memory in a controlled way. Indeed, the “length-value” structure we see with the strings is down to the way Pickles write strings into memory, as is the, apparently superfluous, extra &#8216;length&#8217; field at the start of the record structure. One other pickle-related side-effect which isn’t necessarily immediately obvious when you look at the data in a hex editor is that pickles will always write data so it is uint32-aligned. This means that data will always occupy blocks of 4 bytes and if needed (such as in the case of strings) will be padded to ensure that the next data begins at the start of the next 4-byte block.</p>
<p>It turns out that the contents of the mysterious “State” field are also governed by a Pickle. This field contains serialised data from the WebKit engine. The data is held in a “NavigationEntry” (<a href="http://src.chromium.org/viewvc/chrome/trunk/src/content/public/browser/navigation_entry.h?view=markup">content/public/browser/navigation_entry.h</a>) “content state” field, but is originally populated by glue_serialize  (<a href="http://src.chromium.org/viewvc/chrome/trunk/src/webkit/glue/glue_serialize.cc?view=markup">webkit/glue/glue_serialize.cc</a>). It duplicates some of the data that we have already described from the outer record, but also contains some more detailed information regarding the state of the page, not least the contents of any forms on the page. The code describing the serialisation process is found in glue_serialize in the WriteHistoryItem method.</p>
<p>The state byte string begins with a 32 bit Integer giving the length of the rest of the record (this is in addition to the length defined in the outer record structure) and then continues with the “WebHistoryItem” structure shown in the table below:</p>
<div data-shortcode="caption" id="attachment_330" style="width: 594px" class="wp-caption aligncenter"><a href="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_state.png"><img aria-describedby="caption-attachment-330" loading="lazy" data-attachment-id="330" data-permalink="https://digitalinvestigation.wordpress.com/2012/09/03/chrome-session-and-tabs-files-and-the-puzzle-of-the-pickle/hex_state/" data-orig-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_state.png" data-orig-size="593,837" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Hex_State" data-image-description="" data-image-caption="&lt;p&gt;WebHistoryItem structure&lt;/p&gt;
" data-medium-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_state.png?w=213" data-large-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_state.png?w=584" class="size-full wp-image-330" title="Hex_State" src="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_state.png?w=584&#038;h=824" alt="WebHistoryItem structure" width="584" height="824" srcset="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_state.png?w=584&amp;h=824 584w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_state.png?w=106&amp;h=150 106w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_state.png?w=213&amp;h=300 213w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_state.png 593w" sizes="(max-width: 584px) 100vw, 584px" /></a><p id="caption-attachment-330" class="wp-caption-text">WebHistoryItem structure</p></div>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="310"><strong>Data type</strong></td>
<td valign="top" width="307"><strong>Meaning</strong></td>
</tr>
<tr>
<td valign="top" width="310">32 bit Integer</td>
<td valign="top" width="307">Format Version</td>
</tr>
<tr>
<td valign="top" width="310">String (see below)</td>
<td valign="top" width="307">Page URL</td>
</tr>
<tr>
<td valign="top" width="310">String (see below)</td>
<td valign="top" width="307">Original URL (for example if a redirect took place)</td>
</tr>
<tr>
<td valign="top" width="310">String (see below)</td>
<td valign="top" width="307">Page target</td>
</tr>
<tr>
<td valign="top" width="310">String (see below)</td>
<td valign="top" width="307">Page parent</td>
</tr>
<tr>
<td valign="top" width="310">String (see below)</td>
<td valign="top" width="307">Page title</td>
</tr>
<tr>
<td valign="top" width="310">String (see below)</td>
<td valign="top" width="307">Page alternative title</td>
</tr>
<tr>
<td valign="top" width="310">Floating point number (see below)</td>
<td valign="top" width="307">Last visited time</td>
</tr>
<tr>
<td valign="top" width="310">32 bit Integer</td>
<td valign="top" width="307">X scroll offset</td>
</tr>
<tr>
<td valign="top" width="310">32 bit Integer</td>
<td valign="top" width="307">Y scroll offset</td>
</tr>
<tr>
<td valign="top" width="310">32 bit Integer</td>
<td valign="top" width="307">1 if this is a target item otherwise 0</td>
</tr>
<tr>
<td valign="top" width="310">32 bit Integer</td>
<td valign="top" width="307">Visit count</td>
</tr>
<tr>
<td valign="top" width="310">String (see below)</td>
<td valign="top" width="307">Referrer URL</td>
</tr>
<tr>
<td valign="top" width="310">String Vector (see below)</td>
<td valign="top" width="307">Document state (form data) – explained in more detail below</td>
</tr>
<tr>
<td valign="top" width="310">Floating point number (see below)</td>
<td valign="top" width="307">Page scale factor (Only present if the version field is greater than or equal to 11)</td>
</tr>
<tr>
<td valign="top" width="310">64 bit Integer</td>
<td valign="top" width="307">“Item sequence number” (Only present if the version field is greater than or equal to 9)</td>
</tr>
<tr>
<td valign="top" width="310">64 bit Integer</td>
<td valign="top" width="307">“Document sequence number” (Only present if the version field is greater than or equal to 6)</td>
</tr>
<tr>
<td valign="top" width="310">32 bit Integer</td>
<td valign="top" width="307">1 if there is a “state object” otherwise 0 (Only present if the version field is greater than or equal to 7)</td>
</tr>
<tr>
<td valign="top" width="310">String (see below)</td>
<td valign="top" width="307">“State Object” (only present if the value above is 1 and the version field is greater than or equal to 7)</td>
</tr>
<tr>
<td valign="top" width="310">Form data (see below)</td>
<td valign="top" width="307">Form data</td>
</tr>
<tr>
<td valign="top" width="310">String (see below)</td>
<td valign="top" width="307">HTTP content type</td>
</tr>
<tr>
<td valign="top" width="310">String (see below)</td>
<td valign="top" width="307">Referrer URL (again, for backwards compatibility apparently)</td>
</tr>
<tr>
<td valign="top" width="310">32 bit Integer</td>
<td valign="top" width="307">Number of sub-items in the field below</td>
</tr>
<tr>
<td valign="top" width="310">WebHistoryItem Vector (see below)</td>
<td valign="top" width="307">A number of sub items (for example embedded frames). Each record has the same structure as this one</td>
</tr>
</tbody>
</table>
<p>That table has a lot of “See below” in it, so let’s get down to explaining some of the subtleties/oddities that this data structure provides.</p>
<p>Strings: strings are actually stored differently to those in the outer record. Despite the fact that the data is still being written into a Pickle, the source code uses a different mechanism to do so. The source code forsakes the Pickle’s built in string serialisation methods (for reasons best known to the Chrome programmers), instead taking a more direct route of writing the length of the string directly, followed by the in-memory representation of the string. Basically, this results in the string fields comprising a 32-bit Integer giving the length of the string followed by a UTF-16 string only, this time the length refers to the length in bytes, not the length in characters. To further confuse matters, if the length is -1 (0xFFFFFFFF) this indicates that the string is not present (or ‘null’ in programming terms) or un-initialised (and therefore empty). There is an exception to this structure: if the version field is 2, where, as the comments in the source code suggest, the format was “broken” and stored the number of characters, this was fixed in version 3 onwards.</p>
<p>String Vector: “Vector” in this case essentially means ‘List’. The vector begins with a 32-bit Integer giving the number of entries in the list which is then followed by that many strings in the format described above. In the data structure above this is used to serialise what is described as the “document state”. In testing this appeared to contain information regarding any form fields that may be present on the page (including hidden fields). The list of strings can be broken up into groups of 3 strings, the first of which gives the name of the form field, the second the type of field and the third the current contents of the field.</p>
<p>Floating Point Numbers: <a href="http://en.wikipedia.org/wiki/Floating_point#IEEE_754:_floating_point_in_modern_computers">IEEE 754 double-precision floating point numbers</a> are used as a representation, but Pickles do not directly support this data type. Because of this, the code uses the Pickle’s “WriteData” method, passing the internal, in-memory representation of the floating point number into the Pickle. The upshot of using the “WriteData” method is that the 64-bit floating point number is prefaced with a 32-bit integer giving the length of the data (which will always be 8 for a double-precision float).</p>
<p>Form Data: the (slightly convoluted) format for this data serialisation is detailed in the WriteFormData method in glue_serialize, however across testing this data was never populated so I can’t vouch for its contents.</p>
<p>Sub items: this contains further WebHistoryItems for any embedded pages or resources on the page. During testing I saw it used to store details of adverts, Facebook “like” buttons and so on. The structure for these sub items is identical to the structure described in the table (note, however, that unlike the top-level WebHistoryItem they do not begin with a size value).</p>
<p>So that’s the structure of the file – not the most pleasant file format I’ve ever dealt with and, even with the source code on hand, it was a lengthy task. So was it worth it?</p>
<p>Well first the case against: a lot of the data is duplicated in other places, not least the History database (which is SQLite so much nicer to work with), and between the “Current” and “Last” versions of the files you only have information regarding 2 sessions worth of browsing, although, increasingly in today’s “always-on” culture, this could still account for a significant period of browsing. Which brings me to the other significant disappointment for these files – timestamps (or rather the apparent lack of them); of course, this makes perfect sense when you consider what Chrome needs the files for – timestamps simply aren’t required for restoring sessions, all the same, it’d make the file more useful to us if they were there.</p>
<p>But it’s not all doom and gloom (which is lucky, otherwise this blog post would be a bit of a waste of time). Firstly, although we only have 2 sessions worth of browsing live on the system, colleagues have already demonstrated to me that there is plenty of scope for recovering previous examples of the files – especially from volume shadow copies, and the 8-byte long static header means that carving files from unallocated space may be possible (no footer though, so some judgement would need to be made regarding the length of the files). Probably more importantly these files give us access to information which it would be tricky to acquire otherwise (or at the very least another opportunity to recover information which may have been deleted); the form contents are obviously a nice additional source of intelligence, both in terms of user credentials, email addresses and possibly message contents (I was able to recover Facebook chat messages from the form data in the “document state” for example). Also, the presence of the transition types, referrer and requested URL fields means that you can build up detailed browsing behaviour profiles, tracking the movement between sites and tabs.</p>
<p>This is not a file format that I would want to parse by hand again, so to automate the process I have written a <a href="https://digitalinvestigation.wordpress.com/2012/02/23/an-analyst-enthuses-about-python-no-not-that-one-the-geeky-stuff/">Python script</a> which we&#8217;re happy to make available to the forensics community. The script is designed both as a command line tool which generates a simple HTML report and a class library in case anyone wishes to integrate it into other tools (or create a different reporting format). You can download the script from <a href="http://code.google.com/p/ccl-ssns/">http://code.google.com/p/ccl-ssns/</a>.</p>
<p>As always, if you have any comments or questions you can get in touch in the comments or by emailing <a href="mailto:research@ccl-forensics.com">research@ccl-forensics.com</a></p>
<p><strong>Alex Caithness</strong></p>
]]></content:encoded>
					
					<wfw:commentRss>https://digitalinvestigation.wordpress.com/2012/09/03/chrome-session-and-tabs-files-and-the-puzzle-of-the-pickle/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">325</post-id>
		<media:content url="https://0.gravatar.com/avatar/69d8d1e2b4b3bf7ff73bd8d2b0b9ac55b57cb85db73c1811cb0bc6053ecc3d0a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">digitalinvestigation</media:title>
		</media:content>

		<media:content url="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/chrome_appdata_folder.png" medium="image">
			<media:title type="html">chrome_appdata_folder</media:title>
		</media:content>

		<media:content url="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_header.png" medium="image">
			<media:title type="html">Hex_Header</media:title>
		</media:content>

		<media:content url="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_record_overview.png" medium="image">
			<media:title type="html">Hex_record_overview</media:title>
		</media:content>

		<media:content url="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_sessioncommand.png" medium="image">
			<media:title type="html">Hex_SessionCommand</media:title>
		</media:content>

		<media:content url="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/09/hex_state.png" medium="image">
			<media:title type="html">Hex_State</media:title>
		</media:content>
	</item>
		<item>
		<title>July 2012 cell site blog: The top five (potential!) pitfalls in cell site analysis.</title>
		<link>https://digitalinvestigation.wordpress.com/2012/07/27/july-2012-cell-site-blog-the-top-five-potential-pitfalls-in-cell-site-analysis/</link>
					<comments>https://digitalinvestigation.wordpress.com/2012/07/27/july-2012-cell-site-blog-the-top-five-potential-pitfalls-in-cell-site-analysis/#respond</comments>
		
		<dc:creator><![CDATA[CCL-Forensics]]></dc:creator>
		<pubDate>Fri, 27 Jul 2012 09:46:07 +0000</pubDate>
				<category><![CDATA[Cell site analysis]]></category>
		<category><![CDATA[Criminal defence]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[call data records]]></category>
		<category><![CDATA[CCL-Forensics]]></category>
		<category><![CDATA[CDR]]></category>
		<category><![CDATA[cell]]></category>
		<category><![CDATA[cell site analysis]]></category>
		<category><![CDATA[cell site survey]]></category>
		<category><![CDATA[data]]></category>
		<guid isPermaLink="false">http://digitalinvestigation.wordpress.com/?p=313</guid>

					<description><![CDATA[By Nicholas Patrick-Gleed, Cell Site Analyst This month’s cell site blog takes on a slightly different style.  The team here at CCL-Forensics has been discussing the most common potential pitfalls encountered in the world of cell site evidence, and thought &#8230; <a href="https://digitalinvestigation.wordpress.com/2012/07/27/july-2012-cell-site-blog-the-top-five-potential-pitfalls-in-cell-site-analysis/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><strong>By Nicholas Patrick-Gleed, <a href="http://www.ccl-forensics.com/Services/cell-site-analysis.html">Cell Site</a> Analyst</strong></p>
<p>This month’s cell site blog takes on a slightly different style.  The team here at <a href="http://www.ccl-forensics.com/">CCL-Forensics</a> has been discussing the most common potential pitfalls encountered in the world of cell site evidence, and thought it would be a useful exercise to commit some of them to the blogosphere.  So, rather than focusing on a particular topic, we’ll look at the top five (as we see them) issues which need to be at the forefront when planning and, more importantly, carrying out a cell site investigation.</p>
<p>We’ve touched on some of these in previous blogs, but they form a concise summary of some of the ‘issues’ we have seen experts (almost) experience.</p>
<p><strong>This Month’s Topic: Five things to be wary of in <a href="http://www.ccl-forensics.com/Services/cell-site-analysis.html">cell site analysis</a></strong></p>
<p><strong><span style="text-decoration:underline;">1. Exhibits without interpretation</span></strong></p>
<p>When working for the defence, we regularly see prosecution evidence which can best be described as “exhibits without interpretation”.  A good example of this is a series of maps plotted by an intelligence analyst, who has carried out a series of instructions based on some call data records, but presented them without any explanation of what they mean.  This not only causes confusion and delay within the criminal justice system (the defence will, no doubt, ask for the explanation at some point – so it may as well be provided at the outset) but also means that an opportunity could be missed as part of the investigation stage.  Simply ‘blindly’ plotting information on a map is hardly investigative – but we have seen it more than once.  What is the point of an exhibit without context?</p>
<p>From the prosecution’s perspective this is an obvious potential pitfall – as it means that the evidence does not include something which could enhance the prosecution’s case.</p>
<p>There have also been occasions where the defence leaves it until the 11<sup>th</sup> hour before ‘complaining’ that the person who has produced the exhibit is not an expert – and the judge could rule that the prosecution needs to carry out more expert analysis.</p>
<p>It’s simply not worth chancing these situations.  Moral of the story: produce exhibits which mean something; it makes for a smoother investigation.</p>
<p><strong><span style="text-decoration:underline;">2. Who’s who on the call data records?</span></strong></p>
<p><a href="http://www.ccl-forensics.com/Services/cell-site-analysis.html">Cell site</a> is full of idiosyncrasies.  It’s what keeps us experts on our toes.  But there are small variations between networks and circumstances can lead to major confusion.  The best example of this is when you are analysing a call data record, and the person is in contact with someone on the same network.  There are occasions when both parties cell IDs appear on the same CDR – which can immediately confuse things.  Furthermore, and lets use the ‘3’ network as an example here, if an incoming call to the subject phone is unsuccessful, then the cell ID for the person making the call still appears on the CDR.  This is particularly a problem, as the CRD doesn’t differentiate between the A and B phone (in columns) and so this needs to be taken into account.  It’s pretty easy to spot if there’s a day’s worth of cell IDs in London, and one in Edinburgh – but when both parties are geographically close, then vigilance is the watchword.</p>
<p>This is especially the case if the person plotting the calls is not trained in these nuances – as they may easily go unnoticed.</p>
<p>Moral of the story: be thorough.</p>
<p><strong><span style="text-decoration:underline;">3. Timely surveys</span></strong></p>
<p>Networks change and evolve.  Nothing new there, but the sooner the survey is carried out after the incident in question, the better.  It means the results will be more accurate and better reflect what happened.</p>
<p>We previously touched on our use of historic data, which may help to counteract this problem – and this is a benefit of the robust methodology which <a href="http://www.ccl-forensics.com/">CCL</a> uses.  But, timeliness is still a big potential pitfall for a number of reasons.</p>
<p>One of the biggest is the evolution of “Everything Everywhere” – or the merger of<br />
T-Mobile and Orange as most people still know it.  This means that “Everything Everywhere” now has many more channels available than each of their competitors – and consolidating cells seems like a sensible thing to do.  If there are two cells covering the same approximate area, it seems only prudent to use just one of them and either deactivate the other, or reallocate it to, say, the new 4G networks, which have been in the news recently.  This clearly impacts on the survey, especially if the cell in question is no longer transmitting.</p>
<p>Moral of the story: Consider the impact of the T-Mobile and Orange merger before surveying.  What are you expecting to see – and what are you expecting NOT to see?</p>
<p><strong><span style="text-decoration:underline;">4. Getting the whole picture – not just a small slice</span></strong></p>
<p>Cell site is all about focusing on a phone’s movements around the time of a crime, right?  Wrong.  Yes, this is often the best place to start, but it can also be vitally important to look at the patterns of usage within the data as a whole, rather than just isolating and concentrating on a small piece of evidence.</p>
<p>There may be no evidence of a phone being in an area of interest at a particular time, but the best advice here it to stop, look around and think.</p>
<p>There may be behaviour patterns, where the time in question shows some deviation from the norm. There may be evidence elsewhere of the use of ‘clean’ and ‘dirty’ phones.  There may be evidence someone ‘casing the joint’ before the crime, which goes against the usual pattern of usage.</p>
<p>One just doesn’t see these when points are blindly plotted on a map.  The solution is to have as much data available as possible at the outset of a cell site assignment (or as much as can be reasonably requested under RIPA).</p>
<p>At the end of the day, it depends on what question you are trying to answer, but the moral of this story is: Don’t just rely on data from the time of the incident.  More complex investigations need more data.</p>
<p><strong><span style="text-decoration:underline;">5. Surveying techniques</span></strong></p>
<p>Quite honestly, this is something of a bugbear of ours, and a topic which we have covered numerous times.  With that in mind, I won’t go into any major detail, but just summarise something which we think all cell site experts should adopt.  (And we’ve had this published in a peer-reviewed journal, so it’s more than just a passing fad!)</p>
<p>Movement is key to getting an accurate overall picture of how a phone interacts with cells.  The concept of ‘dragging’ a cell can be key to determining if a cell provides coverage at a location.  Driving to a location from a number of directions can result in a different cell providing coverage, depending on which direction you arrive from.  This is because the phone has a tendency to “hold onto” a cell, rather than chopping and changing – (to reduce the risk of a dropped call).  Spot samples (i.e. turning up at a location, surveying without moving, and then leaving, is hardly comprehensive).  This is about so much more than simply dotting the i’s and crossing the t’s.</p>
<p>While we’re on the subject, it’s worth touching on tracking frequencies.  Network Operators, typically use two or three 3G frequencies at their cell sites.  When moving geographically, a phone may use a new cell which uses a different frequency than the original one.  This created a potential pitfall when surveying, as the expert needs to be mindful of how many frequencies are available, and ensure the most appropriate survey is therefore carried out.  The moral of this part of the story: remember there is more than one available frequency – and be as thorough as the investigation requires.</p>
<p>I hope you’ve enjoyed our whistle-stop tour through the potential pitfalls of <a href="http://www.ccl-forensics.com/Services/cell-site-analysis.html">cell site analysis</a> – and as, ever, we’re always keen to hear your thoughts on the matter.  If you would like to discuss any aspect of <a href="http://www.ccl-forensics.com/Services/cell-site-analysis.html">cell site analysis</a>, please don’t hesitate to drop us a line at <a href="mailto:cellsite@ccl-forensics.com">cellsite@ccl-forensics.com</a></p>
<p><strong>Next month</strong></p>
<p>Next month, Dr Iain Brodie analyses comments made by a judge during a recent case, and highlights what the criminal justice system REALLY wants from cell site experts.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://digitalinvestigation.wordpress.com/2012/07/27/july-2012-cell-site-blog-the-top-five-potential-pitfalls-in-cell-site-analysis/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">313</post-id>
		<media:content url="https://0.gravatar.com/avatar/69d8d1e2b4b3bf7ff73bd8d2b0b9ac55b57cb85db73c1811cb0bc6053ecc3d0a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">digitalinvestigation</media:title>
		</media:content>
	</item>
		<item>
		<title>Cell site blog &#8211; Never mind the quality, feel the width</title>
		<link>https://digitalinvestigation.wordpress.com/2012/06/28/cell-site-blog-never-mind-the-quality-feel-the-width/</link>
					<comments>https://digitalinvestigation.wordpress.com/2012/06/28/cell-site-blog-never-mind-the-quality-feel-the-width/#respond</comments>
		
		<dc:creator><![CDATA[CCL-Forensics]]></dc:creator>
		<pubDate>Thu, 28 Jun 2012 11:15:08 +0000</pubDate>
				<category><![CDATA[Cell site analysis]]></category>
		<category><![CDATA[Computer forensics]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[call data records]]></category>
		<category><![CDATA[CCL-Forensics]]></category>
		<category><![CDATA[cell]]></category>
		<category><![CDATA[cell site analysis]]></category>
		<category><![CDATA[cell site survey]]></category>
		<category><![CDATA[digital evidence]]></category>
		<category><![CDATA[digital forensics]]></category>
		<category><![CDATA[evidence]]></category>
		<category><![CDATA[Matthew Tart]]></category>
		<guid isPermaLink="false">http://digitalinvestigation.wordpress.com/?p=300</guid>

					<description><![CDATA[Thoughts and observations on how ‘more’ could mean ‘less’ in the presentation of cell site analysis. By Matthew Tart, Cell Site Analyst This month – we look at quality over quantity in cell site analysis – with particular emphasis on &#8230; <a href="https://digitalinvestigation.wordpress.com/2012/06/28/cell-site-blog-never-mind-the-quality-feel-the-width/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><strong>Thoughts and observations on how ‘more’ could mean ‘less’ in the presentation of <a href="http://www.ccl-forensics.com/Services/cell-site-analysis.html">cell site analysis</a>.</strong></p>
<p><strong>By Matthew Tart, Cell Site Analyst</strong></p>
<p>This month – we look at quality over quantity in <a href="http://www.ccl-forensics.com/Services/cell-site-analysis.html">cell site analysis</a> – with particular emphasis on a recent example where a pile (literally) of maps could easily have left jurors’ heads spinning.  And cost the prosecution a considerable sum.</p>
<p><strong>This month’s topic: Getting the balance right in <a href="http://www.ccl-forensics.com/Services/cell-site-analysis.html">cell site analysis </a></strong></p>
<p>This blog starts with a case we were involved in recently, involving a high profile crime with a number of defendants.  On this occasion we were working for the defence, but this story acts as a useful pointer for the prosecution by illustrating techniques that experts used by the Crown should &#8211; and should not &#8211; be doing.  We’ll focus on a method used by a large number of cell site analysts (but not ourselves) which is not necessarily robust or stand up to close scrutiny.</p>
<p><strong>Q: What were the details of the case?</strong></p>
<p><strong>A:</strong> The prosecution were investigating the probability of a suspect being at a crime scene – a pub in an inner city location.  At the time of the crime, one of the suspects (we were working for that suspect’s defence solicitor in this case) made a phone call.  The call data records showed that this phone call was made on what we’ll call ‘cell A’, which was on a mast near the crime scene – but also near to his home address which was about 500m away.</p>
<p>The suspect’s alibi was that he was at home at the time of the crime and the phone call.</p>
<p>The prosecution’s outsourced expert carried out ‘spot samples’ (i.e. turned up at a location with a piece of equipment) at both the crime scene and the alibi location.  Their report showed a different cell serving at each location.  Cell A was shown as best serving at the crime scene – but not at the alibi location.</p>
<p><strong>Q: So what did we do differently?</strong></p>
<p><strong>A:</strong> We carried out a much more extensive survey i.e. a drive survey at the home address and the surrounding area.  This was carried out with regard to the cell of interest (Cell A), and we used multiple pieces of equipment and repeatedly moved in and out of the area.  We found that cell A provided coverage north, south, east and west of both locations (crime and alibi scene), and based upon this, could not distinguish between the mobile phone being at either location.  The evidence was simply not strong enough to suggest one or the other.</p>
<p><strong>Q:  So, were both sides saying something different?</strong></p>
<p><strong>A:</strong> Yes and no. Before the court date, the prosecution’s outsourced expert asked for a copy of our defence report, which we provided.  We then discussed the contents with the expert over the phone, who claimed that he wouldn’t expect cell A to provide coverage at the home address.  After looking at our evidence, he admitted that our assertion that the cell served at both addresses was actually the most valid interpretation of the evidence.  This is a worrying admission/u-turn to say the least.  This is despite his evidence not documenting that cell A also serves at that crucial home address.</p>
<p><strong>Q:  The other side claimed that a different cell provided service at the home address.  Did your survey find that cell as well?</strong></p>
<p><strong>A:</strong> Yes, but we found four cells which served at the home address.  Cell A, the one the other side claimed – AND two others.</p>
<p><strong>Q: How was this data presented by the prosecution’s expert?</strong></p>
<p><strong>A:</strong> In a rather cumbersome, and lengthy fashion, to say the least.  There were a number of suspects, and their report showed the same maps over and over – and over – again.  It showed the locations of interest, calls for varying time periods, and whether the cells used actually covered the locations.  This came to more than 100 (one hundred) maps.  All printed on A3 paper and bound into a daunting, unwieldy piece of physical evidence, which the jury would have to absorb.</p>
<p>I would defy even the most attentive juror to have easily made sense of this massive tome.  Notwithstanding the threatening size of the document, but all the pages were practically the same, or almost identical copies of other similar pages.  You simply wouldn’t be able to take it all in.  Especially as one wouldn’t expect jurors to be familiar with this type of evidence – making it all the more crucial to have it presented in a friendly form.</p>
<p><strong>Q: What would we have done differently?</strong></p>
<p><strong>A:</strong> Firstly, not produced a huge weighty un-jury-friendly document. The best way of presenting this evidence (for which we would have had MUCH more survey data, having done more than carry out simple spot samples) would have been a series of two or three detailed maps which can be presented interactively at court with the relevant points being highlighted by the expert in the course of presenting the evidence.  These maps would have covered specifically the period of interest – and would have a secondary, financial, benefit.</p>
<p>By not producing hundreds of maps, we would have saved a considerable amount of time – and therefore cost.  We would estimate that producing this unmanageable number of maps and documents would have potentially cost tens of thousands of pounds. Our approach would almost certainly have been cheaper AND more robust.</p>
<p><strong>Q:  So the lesson here is…</strong></p>
<p><strong>A:</strong> …to think about what you need to achieve, and the best way of doing it.  Don’t be held to ransom by an outsourced experts ‘way of doing something’.  Hopefully this example has shown two things.  One, that carrying out spot samples (as we’ve mentioned in previous blogs) may not be the most appropriate way of surveying.  And secondly, that the end product i.e. what the jury see and have to understand, can be something a little more sophisticated than a batch of similar-looking, repetitive &#8211; and quite frankly, uninspiring – maps and tables.  Technology has moved on.  So has cell site analysis.  And so has the presentation of evidence in court.</p>
<p>In terms of maps it is quality not quantity that delivers the most impactive conclusions in relation to the possible locations of a mobile phone.</p>
<p>For more information about this – or any aspect of <a href="http://www.ccl-forensics.com/Services/cell-site-analysis.html">cell site analysis</a>, please contact Matthew Tart (or any of our other cell site analysts) on 01789 261200 or by emailing <a href="cellsite@ccl-forensics.com">cellsite@ccl-forensics.com</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://digitalinvestigation.wordpress.com/2012/06/28/cell-site-blog-never-mind-the-quality-feel-the-width/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">300</post-id>
		<media:content url="https://0.gravatar.com/avatar/69d8d1e2b4b3bf7ff73bd8d2b0b9ac55b57cb85db73c1811cb0bc6053ecc3d0a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">digitalinvestigation</media:title>
		</media:content>
	</item>
		<item>
		<title>Parsing Apple System Log (ASL) files on iOS and OSX for Fun and Evidence (and a Python script to do it for you)</title>
		<link>https://digitalinvestigation.wordpress.com/2012/06/18/parsing-apple-system-log-files-osx-ios/</link>
					<comments>https://digitalinvestigation.wordpress.com/2012/06/18/parsing-apple-system-log-files-osx-ios/#comments</comments>
		
		<dc:creator><![CDATA[CCL-Forensics]]></dc:creator>
		<pubDate>Mon, 18 Jun 2012 10:20:52 +0000</pubDate>
				<category><![CDATA[Computer forensics]]></category>
		<category><![CDATA[Mobile phone forensics]]></category>
		<category><![CDATA[R&D]]></category>
		<category><![CDATA[Alex Caithness]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[Logs]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Python script]]></category>
		<category><![CDATA[Timeline]]></category>
		<guid isPermaLink="false">http://digitalinvestigation.wordpress.com/?p=282</guid>

					<description><![CDATA[(If you’re dying to get stuck in and are only after the links to the Python scripts, they can be found at the bottom of the post!) After every update to iOS I like to take a file system dump &#8230; <a href="https://digitalinvestigation.wordpress.com/2012/06/18/parsing-apple-system-log-files-osx-ios/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><em>(If you’re dying to get stuck in and are only after the links to the Python scripts, they can be found at the bottom of the post!)</em></p>
<p>After every update to iOS I like to take a file system dump of one of our test iDevices and have a poke around to see what’s changed and what’s new. Recently, on one of my excursions around the iOS file system, I came across something that looked promising that I hadn’t dug into before: a bunch of files with the “.asl” extension which were located on the data partition in “log/DiagnosticMessages”. There were lots of them too –each with a file name referring to a particular date – they went back months!</p>
<div data-shortcode="caption" id="attachment_283" style="width: 594px" class="wp-caption aligncenter"><a href="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/01-file-list.png"><img aria-describedby="caption-attachment-283" loading="lazy" data-attachment-id="283" data-permalink="https://digitalinvestigation.wordpress.com/2012/06/18/parsing-apple-system-log-files-osx-ios/01-file-list/" data-orig-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/01-file-list.png" data-orig-size="662,608" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="DiagnosticMessages file listing" data-image-description="" data-image-caption="&lt;p&gt;Log Files!&lt;/p&gt;
" data-medium-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/01-file-list.png?w=300" data-large-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/01-file-list.png?w=584" class="size-full wp-image-283" title="DiagnosticMessages file listing" src="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/01-file-list.png?w=584&#038;h=536" alt="DiagnosticMessages file listing" width="584" height="536" srcset="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/01-file-list.png?w=584&amp;h=536 584w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/01-file-list.png?w=150&amp;h=138 150w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/01-file-list.png?w=300&amp;h=276 300w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/01-file-list.png 662w" sizes="(max-width: 584px) 100vw, 584px" /></a><p id="caption-attachment-283" class="wp-caption-text">Log Files!</p></div>
<p>“Loads of lovely log files!” I thought to myself as I excitedly dropped one of the files into my current text editor of choice (Notepad++ if you’re interested) only to be disappointed by what was clearly a binary file format.</p>
<div data-shortcode="caption" id="attachment_284" style="width: 594px" class="wp-caption aligncenter"><a href="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/02-file-in-text-editor.png"><img aria-describedby="caption-attachment-284" loading="lazy" data-attachment-id="284" data-permalink="https://digitalinvestigation.wordpress.com/2012/06/18/parsing-apple-system-log-files-osx-ios/02-file-in-text-editor/" data-orig-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/02-file-in-text-editor.png" data-orig-size="658,262" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="ASLDB File in a text editor" data-image-description="" data-image-caption="&lt;p&gt;Curses!&lt;/p&gt;
" data-medium-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/02-file-in-text-editor.png?w=300" data-large-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/02-file-in-text-editor.png?w=584" class="size-full wp-image-284" title="ASLDB File in a text editor" src="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/02-file-in-text-editor.png?w=584&#038;h=232" alt="ASLDB File in a text editor" width="584" height="232" srcset="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/02-file-in-text-editor.png?w=584&amp;h=233 584w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/02-file-in-text-editor.png?w=150&amp;h=60 150w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/02-file-in-text-editor.png?w=300&amp;h=119 300w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/02-file-in-text-editor.png 658w" sizes="(max-width: 584px) 100vw, 584px" /></a><p id="caption-attachment-284" class="wp-caption-text">Curses!</p></div>
<p>So I headed over to Google and entered some hopeful sounding search queries and came across a very useful blog post (<a href="http://crucialsecurityblog.harris.com/2011/06/22/the-apple-system-log-%E2%80%93-part-1/">http://crucialsecurityblog.harris.com/2011/06/22/the-apple-system-log-%E2%80%93-part-1/</a>) which described the role of ASL files on OSX and listed some ways for accessing the logs from within OSX, but I was interested in gaining a better understanding of the file format (besides, the nearest Mac to me was on a different floor!).</p>
<p>A little more digging revealed that the code that governed the ASL logging, and the files it generated were part of the Open Source section of OSX, as a result I was able to view the code that was actually responsible for creating the file – my luck was looking up!</p>
<p>The two files I was particularly interested in were “asl.h” (most recent version at time of posting: <a href="http://opensource.apple.com/source/Libc/Libc-763.13/include/asl.h">http://opensource.apple.com/source/Libc/Libc-763.13/include/asl.h</a>) and “asl_file.h” (most recent version at time of posting: <a href="http://opensource.apple.com/source/Libc/Libc-763.13/gen/asl_file.h">http://opensource.apple.com/source/Libc/Libc-763.13/gen/asl_file.h</a>). C header files are great; basically, their purpose is to define the data structures that are subsequently used in the functional code, so when it comes to understanding file formats, quite often they’ll tell you all you need to know without having to try and follow the flow of the actual program. Better yet, these files were pretty well commented. I know that not everyone reading this is going to want to read through a bunch of C code, so I’ll summarise the file format below (all numeric data is big endian):</p>
<p>First, the file Header:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="153"><strong>Offset</strong></td>
<td valign="top" width="160"><strong>Length</strong></td>
<td valign="top" width="163"><strong>Data Type</strong></td>
<td valign="top" width="140"><strong>Description</strong></td>
</tr>
<tr>
<td valign="top" width="153">0</td>
<td valign="top" width="160">12</td>
<td valign="top" width="163">String</td>
<td valign="top" width="140">“ASL DB” followed by 6 bytes of 0x00</td>
</tr>
<tr>
<td valign="top" width="153">12</td>
<td valign="top" width="160">4</td>
<td valign="top" width="163">32bit Integer</td>
<td valign="top" width="140">File version (current version is: 2)</td>
</tr>
<tr>
<td valign="top" width="153">16</td>
<td valign="top" width="160">8</td>
<td valign="top" width="163">64bit Integer</td>
<td valign="top" width="140">File offset for the  first record in the file</td>
</tr>
<tr>
<td valign="top" width="153">24</td>
<td valign="top" width="160">8</td>
<td valign="top" width="163">64bit Integer</td>
<td valign="top" width="140">Unix seconds timestamp, appears to be a file creation time</td>
</tr>
<tr>
<td valign="top" width="153">32</td>
<td valign="top" width="160">4</td>
<td valign="top" width="163">32bit Integer</td>
<td valign="top" width="140">String cache size (not 100% sure what this refers to, may be maximum size for string entries in the records)</td>
</tr>
<tr>
<td valign="top" width="153">36</td>
<td valign="top" width="160">8</td>
<td valign="top" width="163">64bit Integer</td>
<td valign="top" width="140">File offset for the last record in the file</td>
</tr>
<tr>
<td valign="top" width="153">44</td>
<td valign="top" width="160">36</td>
<td valign="top" width="163">Padding</td>
<td valign="top" width="140">Should all be 0x00 bytes</td>
</tr>
</tbody>
</table>
<p>So nothing too ominous there, although all of those pad-bytes at the end of the header suggest redundancy in the file spec in case apple ever fancy changing something. Indeed the fact that the header tells us that we’re on version 2 of the file format suggests that this has already happened.</p>
<p>The records in the file are arranged in a “doubly linked list”, that is, that every record in the file contains a reference (ie. the file offset of) the next and previous records.  From a high level, the records themselves are made up of a fixed length data section, followed by a variable length section which allows the storage of additional data in a key-value type structure, finally followed by the offset of the previous record. The table below explains the structure in detail.</p>
<p>NB: The string storage mechanism the records use is a little bit…interesting – I’ll explain in detail later in this post, but for now if you see a reference to an “ASL String”, I mean one of these “interesting” strings!</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="154"><strong>Offset</strong></td>
<td valign="top" width="154"><strong>Length</strong></td>
<td valign="top" width="154"><strong>Data Type</strong></td>
<td valign="top" width="154"><strong>Description</strong></td>
</tr>
<tr>
<td valign="top" width="154">0</td>
<td valign="top" width="154">2</td>
<td valign="top" width="154">Padding</td>
<td valign="top" width="154">0x00 0x00</td>
</tr>
<tr>
<td valign="top" width="154">2</td>
<td valign="top" width="154">4</td>
<td valign="top" width="154">32bit Integer</td>
<td valign="top" width="154">Length of this record (excluding this and the previous field)</td>
</tr>
<tr>
<td valign="top" width="154">6</td>
<td valign="top" width="154">8</td>
<td valign="top" width="154">64bit Integer</td>
<td valign="top" width="154">File offset for next record</td>
</tr>
<tr>
<td valign="top" width="154">14</td>
<td valign="top" width="154">8</td>
<td valign="top" width="154">64bit Integer</td>
<td valign="top" width="154">Numeric ID for this record</td>
</tr>
<tr>
<td valign="top" width="154">22</td>
<td valign="top" width="154">8</td>
<td valign="top" width="154">64bit Integer</td>
<td valign="top" width="154">Record timestamp (as a Unix seconds timestamp)</td>
</tr>
<tr>
<td valign="top" width="154">30</td>
<td valign="top" width="154">4</td>
<td valign="top" width="154">32bit Integer</td>
<td valign="top" width="154">Additional nanoseconds for timestamp</td>
</tr>
<tr>
<td valign="top" width="154">34</td>
<td valign="top" width="154">2</td>
<td valign="top" width="154">16bit Integer</td>
<td valign="top" width="154">Level (see below)</td>
</tr>
<tr>
<td valign="top" width="154">36</td>
<td valign="top" width="154">2</td>
<td valign="top" width="154">16bit Integer</td>
<td valign="top" width="154">Flags</td>
</tr>
<tr>
<td valign="top" width="154">38</td>
<td valign="top" width="154">4</td>
<td valign="top" width="154">32bit Integer</td>
<td valign="top" width="154">Process ID that sent the log message</td>
</tr>
<tr>
<td valign="top" width="154">42</td>
<td valign="top" width="154">4</td>
<td valign="top" width="154">32bit Integer</td>
<td valign="top" width="154">UID that sent the log message</td>
</tr>
<tr>
<td valign="top" width="154">46</td>
<td valign="top" width="154">4</td>
<td valign="top" width="154">32bit Integer</td>
<td valign="top" width="154">GID that sent the log message</td>
</tr>
<tr>
<td valign="top" width="154">50</td>
<td valign="top" width="154">4</td>
<td valign="top" width="154">32bit Integer</td>
<td valign="top" width="154">User read access</td>
</tr>
<tr>
<td valign="top" width="154">54</td>
<td valign="top" width="154">4</td>
<td valign="top" width="154">32bit Integer</td>
<td valign="top" width="154">Group read access</td>
</tr>
<tr>
<td valign="top" width="154">58</td>
<td valign="top" width="154">4</td>
<td valign="top" width="154">32bit Integer</td>
<td valign="top" width="154">Reference PID (for processes under the control of launchd)</td>
</tr>
<tr>
<td valign="top" width="154">62</td>
<td valign="top" width="154">4</td>
<td valign="top" width="154">32bit Integer</td>
<td valign="top" width="154">Key-Value count: The total number of keys and values in the key-value storage of the record</td>
</tr>
<tr>
<td valign="top" width="154">66</td>
<td valign="top" width="154">8</td>
<td valign="top" width="154">ASL String</td>
<td valign="top" width="154">Host that the sender belongs to (usually the name of the device)</td>
</tr>
<tr>
<td valign="top" width="154">74</td>
<td valign="top" width="154">8</td>
<td valign="top" width="154">ASL String</td>
<td valign="top" width="154">Name of the sender (process) which send the log message</td>
</tr>
<tr>
<td valign="top" width="154">82</td>
<td valign="top" width="154">8</td>
<td valign="top" width="154">ASL String</td>
<td valign="top" width="154">The sender’s facility</td>
</tr>
<tr>
<td valign="top" width="154">90</td>
<td valign="top" width="154">8</td>
<td valign="top" width="154">ASL String</td>
<td valign="top" width="154">Log Message</td>
</tr>
<tr>
<td valign="top" width="154">98</td>
<td valign="top" width="154">8</td>
<td valign="top" width="154">ASL String</td>
<td valign="top" width="154">The name of the reference process (for processes under control of launchd)</td>
</tr>
<tr>
<td valign="top" width="154">106</td>
<td valign="top" width="154">8</td>
<td valign="top" width="154">ASL String</td>
<td valign="top" width="154">The session of the sender (set by launchd)</td>
</tr>
<tr>
<td valign="top" width="154">114</td>
<td valign="top" width="154">8 * Key-Value count</td>
<td valign="top" width="154">ASL String[Key-Value count]</td>
<td valign="top" width="154">The key-value storage: A key followed by a value, followed by a key followed by a value… and so on. All keys and values are strings</td>
</tr>
</tbody>
</table>
<p>The level field mentioned above will have a numerical value which refers to the levels shown below:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="308"><strong>Level</strong></td>
<td valign="top" width="308"><strong>Meaning</strong></td>
</tr>
<tr>
<td valign="top" width="308">0</td>
<td valign="top" width="308">Emergency</td>
</tr>
<tr>
<td valign="top" width="308">1</td>
<td valign="top" width="308">Alert</td>
</tr>
<tr>
<td valign="top" width="308">2</td>
<td valign="top" width="308">Critical</td>
</tr>
<tr>
<td valign="top" width="308">3</td>
<td valign="top" width="308">Error</td>
</tr>
<tr>
<td valign="top" width="308">4</td>
<td valign="top" width="308">Warning</td>
</tr>
<tr>
<td valign="top" width="308">5</td>
<td valign="top" width="308">Notice</td>
</tr>
<tr>
<td valign="top" width="308">6</td>
<td valign="top" width="308">Info</td>
</tr>
<tr>
<td valign="top" width="308">7</td>
<td valign="top" width="308">Debug</td>
</tr>
</tbody>
</table>
<p>As mentioned, the “ASL String” data type is a little odd. The ASL fields above take up 8 bytes, if the most significant bit in the 8 bytes is set (ie is 1), the rest of the most significant byte gives the length of the string, which occupies the remaining 7 bytes (unused bytes are set to 0x00). Conversely, if the top bit in the ASL String data type is not set (ie. Is 0) the entire 8 bytes should be interpreted as a 64bit Integer which gives the file offset where the string can be found. The string will be stored thusly:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="154"><strong>Offset</strong></td>
<td valign="top" width="154"><strong>Length</strong></td>
<td valign="top" width="154"><strong>Data Type</strong></td>
<td valign="top" width="154"><strong>Meaning</strong></td>
</tr>
<tr>
<td valign="top" width="154">0</td>
<td valign="top" width="154">2</td>
<td valign="top" width="154">Padding</td>
<td valign="top" width="154">Padding bytes 0x00 0x01</td>
</tr>
<tr>
<td valign="top" width="154">2</td>
<td valign="top" width="154">4</td>
<td valign="top" width="154">32bit Integer</td>
<td valign="top" width="154">String length</td>
</tr>
<tr>
<td valign="top" width="154">6</td>
<td valign="top" width="154">String length</td>
<td valign="top" width="154">UTF8 String (nul-terminated)</td>
<td valign="top" width="154">The string data</td>
</tr>
</tbody>
</table>
<p>In order to get a better grip of what can be held in these files I decided to create a Python module to read these files and used it to dump out the contents of the ASL files I found on the iPhone.</p>
<div data-shortcode="caption" id="attachment_285" style="width: 594px" class="wp-caption aligncenter"><a href="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/03-script-from-commandline.png"><img aria-describedby="caption-attachment-285" loading="lazy" data-attachment-id="285" data-permalink="https://digitalinvestigation.wordpress.com/2012/06/18/parsing-apple-system-log-files-osx-ios/03-script-from-commandline/" data-orig-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/03-script-from-commandline.png" data-orig-size="641,817" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Running the script" data-image-description="" data-image-caption="&lt;p&gt;Running the script&lt;/p&gt;
" data-medium-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/03-script-from-commandline.png?w=235" data-large-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/03-script-from-commandline.png?w=584" class="size-full wp-image-285" title="Running the script" src="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/03-script-from-commandline.png?w=584&#038;h=744" alt="Running the script" width="584" height="744" srcset="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/03-script-from-commandline.png?w=584&amp;h=744 584w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/03-script-from-commandline.png?w=118&amp;h=150 118w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/03-script-from-commandline.png?w=235&amp;h=300 235w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/03-script-from-commandline.png 641w" sizes="(max-width: 584px) 100vw, 584px" /></a><p id="caption-attachment-285" class="wp-caption-text">Running the script</p></div>
<div data-shortcode="caption" id="attachment_286" style="width: 594px" class="wp-caption aligncenter"><a href="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/04-output-from-script-iphone.png"><img aria-describedby="caption-attachment-286" loading="lazy" data-attachment-id="286" data-permalink="https://digitalinvestigation.wordpress.com/2012/06/18/parsing-apple-system-log-files-osx-ios/04-output-from-script-iphone/" data-orig-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/04-output-from-script-iphone.png" data-orig-size="1306,397" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Output from the script (iOS)" data-image-description="" data-image-caption="&lt;p&gt;A snippet of the output produced by processing an iPhone&amp;#8217;s &amp;#8216;DiagnosticMessages&amp;#8217; folder&lt;/p&gt;
" data-medium-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/04-output-from-script-iphone.png?w=300" data-large-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/04-output-from-script-iphone.png?w=584" class="size-full wp-image-286" title="Output from the script (iOS)" src="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/04-output-from-script-iphone.png?w=584&#038;h=177" alt="Output from the script (iOS)" width="584" height="177" srcset="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/04-output-from-script-iphone.png?w=584&amp;h=178 584w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/04-output-from-script-iphone.png?w=1168&amp;h=355 1168w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/04-output-from-script-iphone.png?w=150&amp;h=46 150w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/04-output-from-script-iphone.png?w=300&amp;h=91 300w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/04-output-from-script-iphone.png?w=768&amp;h=233 768w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/04-output-from-script-iphone.png?w=1024&amp;h=311 1024w" sizes="(max-width: 584px) 100vw, 584px" /></a><p id="caption-attachment-286" class="wp-caption-text">A snippet of the output produced by processing an iPhone&#8217;s &#8216;DiagnosticMessages&#8217; folder</p></div>
<p>The first thing that struck me after running the script was the volume of messages: 16161 log messages spanning 10 months – and this was on a test handset which had lay idle for weeks at a time. The second thing was the prevalence of messages sent by the “powerd” daemon, over 87% of the messages had been sent by this process. The vast majority of these messages related to the device waking and sleeping – not through user interaction, but while the device was idle. Most of these “Wake” events occurred 2-5 minute apart, presumably to allow brief data connectivity to receive updates and push messages from apps.</p>
<div data-shortcode="caption" id="attachment_287" style="width: 594px" class="wp-caption aligncenter"><a href="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/05-powerd-messages.png"><img aria-describedby="caption-attachment-287" loading="lazy" data-attachment-id="287" data-permalink="https://digitalinvestigation.wordpress.com/2012/06/18/parsing-apple-system-log-files-osx-ios/05-powerd-messages/" data-orig-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/05-powerd-messages.png" data-orig-size="856,237" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Output from the script (iOS powerd messages)" data-image-description="" data-image-caption="&lt;p&gt;Some powerd Wake and Sleep messages&lt;/p&gt;
" data-medium-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/05-powerd-messages.png?w=300" data-large-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/05-powerd-messages.png?w=584" class="size-full wp-image-287" title="Output from the script (iOS powerd messages)" src="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/05-powerd-messages.png?w=584&#038;h=161" alt="Output from the script (iOS powerd messages)" width="584" height="161" srcset="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/05-powerd-messages.png?w=584&amp;h=162 584w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/05-powerd-messages.png?w=150&amp;h=42 150w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/05-powerd-messages.png?w=300&amp;h=83 300w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/05-powerd-messages.png?w=768&amp;h=213 768w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/05-powerd-messages.png 856w" sizes="(max-width: 584px) 100vw, 584px" /></a><p id="caption-attachment-287" class="wp-caption-text">Some powerd Wake and Sleep messages</p></div>
<p>The key thing that interested me about these messages was that they also noted the current battery-charge percentage in their text: this is the sort of data that just begs to be graphed, so I knocked up a little script which utilised the parsing module I had just written to extract just this data and present it in a graph-friendly manner.</p>
<div data-shortcode="caption" id="attachment_288" style="width: 234px" class="wp-caption aligncenter"><a href="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/06-graph-friendly.png"><img aria-describedby="caption-attachment-288" loading="lazy" data-attachment-id="288" data-permalink="https://digitalinvestigation.wordpress.com/2012/06/18/parsing-apple-system-log-files-osx-ios/06-graph-friendly/" data-orig-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/06-graph-friendly.png" data-orig-size="224,836" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Graph Friendly powerd Data" data-image-description="" data-image-caption="&lt;p&gt;Graph Friendly Data&lt;/p&gt;
" data-medium-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/06-graph-friendly.png?w=80" data-large-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/06-graph-friendly.png?w=224" class="size-full wp-image-288" title="Graph Friendly powerd Data" src="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/06-graph-friendly.png?w=584" alt="Graph Friendly powerd Data"   srcset="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/06-graph-friendly.png 224w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/06-graph-friendly.png?w=40&amp;h=150 40w" sizes="(max-width: 224px) 100vw, 224px" /></a><p id="caption-attachment-288" class="wp-caption-text">Graph Friendly Data</p></div>
<p>After graphing it (you want to use a scatter graph in Excel for this, not line as I discovered after some shouting at my screen) you are left with a graph which gives you some insight into the device’s use.</p>
<div data-shortcode="caption" id="attachment_289" style="width: 594px" class="wp-caption aligncenter"><a href="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/07-ccl_iphone4_power.png"><img aria-describedby="caption-attachment-289" loading="lazy" data-attachment-id="289" data-permalink="https://digitalinvestigation.wordpress.com/2012/06/18/parsing-apple-system-log-files-osx-ios/07-ccl_iphone4_power/" data-orig-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/07-ccl_iphone4_power.png" data-orig-size="1232,806" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="iOS Battery Use Graph" data-image-description="" data-image-caption="&lt;p&gt;Some iPhone Power Usage&lt;/p&gt;
" data-medium-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/07-ccl_iphone4_power.png?w=300" data-large-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/07-ccl_iphone4_power.png?w=584" class="size-full wp-image-289" title="iOS Battery Use Graph" src="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/07-ccl_iphone4_power.png?w=584&#038;h=382" alt="iOS Battery Use Graph" width="584" height="382" srcset="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/07-ccl_iphone4_power.png?w=584&amp;h=382 584w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/07-ccl_iphone4_power.png?w=1168&amp;h=764 1168w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/07-ccl_iphone4_power.png?w=150&amp;h=98 150w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/07-ccl_iphone4_power.png?w=300&amp;h=196 300w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/07-ccl_iphone4_power.png?w=768&amp;h=502 768w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/07-ccl_iphone4_power.png?w=1024&amp;h=670 1024w" sizes="(max-width: 584px) 100vw, 584px" /></a><p id="caption-attachment-289" class="wp-caption-text">Some iPhone Power Usage (click for full-size)</p></div>
<p>The graph above shows around 3 weeks of battery usage data from the test handset. As noted previously, this test device would lay idle for days at a time (as suggested by the gentle downward gradients) but there were periods when the handset was in use, as shown by the steeper downward gradients on the 26<sup>th</sup> and 27<sup>th</sup> of April, which mostly took place within office hours. You can also clear see the points where the device was plugged in to be charged, suggested by the very steep upward gradients. As noted the power messages occur around ever 2-5 minutes, so the resolution is actually fairly good. The exception to this is while the device is plugged in as it no longer needs to sleep to preserve battery charge; typically I only saw an event when charging began and another when the device was unplugged and the battery began to discharge again.</p>
<p>There are a few other messages in the iOS ASL log that look interesting, but at this time I don’t have enough nice control data to make much of them. One thing that did hearten me somewhat was the fact that on the few extractions I’ve had the opportunity to take a look at from later revisions of iOS 5, there did seem to be some extra processes that were logging messages, so it’s my hope that we’ll see more and more useful data make its way into the ASL logs on iOS.</p>
<p>In addition to looking at iOS ASL files, I thought I’d take a look at some from an OSX installation. Pulling the logs from the “var/log/asl” on Lion (10.7.3) and running the parsing script across the whole directory brought back a far more varied selection of messages.</p>
<div data-shortcode="caption" id="attachment_290" style="width: 594px" class="wp-caption aligncenter"><a href="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/08-output-from-script-osx.png"><img aria-describedby="caption-attachment-290" loading="lazy" data-attachment-id="290" data-permalink="https://digitalinvestigation.wordpress.com/2012/06/18/parsing-apple-system-log-files-osx-ios/08-output-from-script-osx/" data-orig-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/08-output-from-script-osx.png" data-orig-size="1681,454" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Output from the script (OSX)" data-image-description="" data-image-caption="&lt;p&gt;Variety is the spice of life.&lt;/p&gt;
" data-medium-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/08-output-from-script-osx.png?w=300" data-large-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/08-output-from-script-osx.png?w=584" class="size-full wp-image-290" title="Output from the script (OSX)" src="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/08-output-from-script-osx.png?w=584&#038;h=157" alt="Output from the script (OSX)" width="584" height="157" srcset="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/08-output-from-script-osx.png?w=584&amp;h=158 584w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/08-output-from-script-osx.png?w=1168&amp;h=315 1168w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/08-output-from-script-osx.png?w=150&amp;h=41 150w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/08-output-from-script-osx.png?w=300&amp;h=81 300w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/08-output-from-script-osx.png?w=768&amp;h=207 768w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/08-output-from-script-osx.png?w=1024&amp;h=277 1024w" sizes="(max-width: 584px) 100vw, 584px" /></a><p id="caption-attachment-290" class="wp-caption-text">Variety is the spice of life.</p></div>
<p>The number of records returned was actually far less than on iOS, partially due to the iOS “powerd” being so chatty, but more crucially because OSX tidies up its logs on a weekly basis. That’s not to say that you will only recover a week’s worth of logs though &#8211; on this test machine I recovered logs spanning 7 months. Rather, OSX has short-term log files (those with file names which begin with a timestamp) which have a shelf-life of a week and long term log files (those with file names which begin with “bb” followed by a timestamp). The “bb” in the long term log’s file name presumably stands for “best before” and the date, which is always in the future, is the date that the file should be cleared out. The short term log files tend to hold more “intimate” entries, often debug messages sent from 3<sup>rd</sup> party applications; the long term logs err more on the side of system messages. One particularly useful set of messages in the long term log are records pertaining to booting, shutting down, logins and logouts (hibernating, waking and failed logins are recorded too, but they end up in the short-term logs).</p>
<p><em>(As an aside:  one of my favourite things that I discovered when looking through these logs was the action of waking a laptop running OSX by wiggling a finger on the trackpad is recorded in the logs as a “HID Tickle”. Lovely.)</em></p>
<p>Like I did with the iOS power profiling, I put together a script which extracted these login and power records and timelines them.</p>
<div data-shortcode="caption" id="attachment_291" style="width: 594px" class="wp-caption aligncenter"><a href="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/09-login-timeline.png"><img aria-describedby="caption-attachment-291" loading="lazy" data-attachment-id="291" data-permalink="https://digitalinvestigation.wordpress.com/2012/06/18/parsing-apple-system-log-files-osx-ios/09-login-timeline/" data-orig-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/09-login-timeline.png" data-orig-size="958,463" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="OSX Login and power timeline" data-image-description="" data-image-caption="&lt;p&gt;Login and power timeline&lt;/p&gt;
" data-medium-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/09-login-timeline.png?w=300" data-large-file="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/09-login-timeline.png?w=584" class="size-full wp-image-291" title="OSX Login and power timeline" src="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/09-login-timeline.png?w=584&#038;h=282" alt="OSX Login and power timeline" width="584" height="282" srcset="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/09-login-timeline.png?w=584&amp;h=282 584w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/09-login-timeline.png?w=150&amp;h=72 150w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/09-login-timeline.png?w=300&amp;h=145 300w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/09-login-timeline.png?w=768&amp;h=371 768w, https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/09-login-timeline.png 958w" sizes="(max-width: 584px) 100vw, 584px" /></a><p id="caption-attachment-291" class="wp-caption-text">Login and power timeline</p></div>
<p>A couple of things worth noting beyond the basic boot/shutdown/login records: firstly when the device wakes it records why it happened – this can be quite specific: a USB device, the lid of a laptop being opened, the power button being pressed, etc. Secondly, you can see terminal windows (tty) being opened and closed as opening a terminal window involves logging in to a terminal session (OSX does this transparently, but it’s still logged).</p>
<p>We’ve released the scripts mentioned in this post to the community and they can be downloaded from <a href="https://code.google.com/p/ccl-asl/">https://code.google.com/p/ccl-asl/</a>. The “ccl_asl” script is both a command line utility for dumping the contents of ASL files as well as a fully featured class module which you can use to write scripts along the lines of the battery profiler and login timeline scripts.</p>
<p>ASL files are, on the one hand, fairly dry system logs, but on the other, with a little work you can harvest some really insightful behavioural intelligence. As always if you have any questions, comments or suggestions you can contact us on <a href="mailto:research@ccl-forensics.com">research@ccl-forensics.com</a> or leave a comment below.</p>
<p><strong>Alex Caithness</strong></p>
]]></content:encoded>
					
					<wfw:commentRss>https://digitalinvestigation.wordpress.com/2012/06/18/parsing-apple-system-log-files-osx-ios/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">282</post-id>
		<media:content url="https://0.gravatar.com/avatar/69d8d1e2b4b3bf7ff73bd8d2b0b9ac55b57cb85db73c1811cb0bc6053ecc3d0a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">digitalinvestigation</media:title>
		</media:content>

		<media:content url="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/01-file-list.png" medium="image">
			<media:title type="html">DiagnosticMessages file listing</media:title>
		</media:content>

		<media:content url="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/02-file-in-text-editor.png" medium="image">
			<media:title type="html">ASLDB File in a text editor</media:title>
		</media:content>

		<media:content url="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/03-script-from-commandline.png" medium="image">
			<media:title type="html">Running the script</media:title>
		</media:content>

		<media:content url="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/04-output-from-script-iphone.png" medium="image">
			<media:title type="html">Output from the script (iOS)</media:title>
		</media:content>

		<media:content url="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/05-powerd-messages.png" medium="image">
			<media:title type="html">Output from the script (iOS powerd messages)</media:title>
		</media:content>

		<media:content url="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/06-graph-friendly.png" medium="image">
			<media:title type="html">Graph Friendly powerd Data</media:title>
		</media:content>

		<media:content url="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/07-ccl_iphone4_power.png" medium="image">
			<media:title type="html">iOS Battery Use Graph</media:title>
		</media:content>

		<media:content url="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/08-output-from-script-osx.png" medium="image">
			<media:title type="html">Output from the script (OSX)</media:title>
		</media:content>

		<media:content url="https://digitalinvestigation.wordpress.com/wp-content/uploads/2012/06/09-login-timeline.png" medium="image">
			<media:title type="html">OSX Login and power timeline</media:title>
		</media:content>
	</item>
		<item>
		<title>XML and plist parser – updated version available</title>
		<link>https://digitalinvestigation.wordpress.com/2012/06/12/xml-and-plist-parser-updated-version-available/</link>
					<comments>https://digitalinvestigation.wordpress.com/2012/06/12/xml-and-plist-parser-updated-version-available/#respond</comments>
		
		<dc:creator><![CDATA[CCL-Forensics]]></dc:creator>
		<pubDate>Tue, 12 Jun 2012 09:27:28 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://digitalinvestigation.wordpress.com/?p=280</guid>

					<description><![CDATA[We’ve updated PIP – our XML and plist parser. PIP has already proved incredibly popular, and is used by a number of investigation agencies across the world. The new version is available for download here (license key purchase required) – &#8230; <a href="https://digitalinvestigation.wordpress.com/2012/06/12/xml-and-plist-parser-updated-version-available/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p style="background:white;margin:0 0 7.5pt;"><span style="font-size:9pt;font-family:Helvetica;color:#333333;">We’ve updated PIP – our XML and plist parser.</span></p>
<p style="background:white;margin:0 0 7.5pt;"><span style="font-size:9pt;font-family:Helvetica;color:#333333;">PIP has already proved incredibly popular, and is used by a number of investigation agencies across the world.</span></p>
<p style="background:white;margin:0 0 7.5pt;"><span style="font-size:9pt;font-family:Helvetica;color:#333333;">The new version is available for download <a href="http://www.ccl-forensics.com/pip" target="_blank">here</a> (license key purchase required) – and is a free upgrade to those who have already bought PIP.</span></p>
<p style="background:white;margin:0 0 7.5pt;"><span style="font-size:9pt;font-family:Helvetica;color:#333333;">We’ve listened to feedback received from the family of PIP users, and have introduced the following improvements:</span></p>
<p style="background:white;margin:0 0 7.5pt;"><strong><span style="font-size:9pt;font-family:Helvetica;color:#333333;">Improved Interface </span></strong><span style="font-size:9pt;font-family:Helvetica;color:#333333;">– to improve work-flow, we have updated the application’s layout</span></p>
<p style="background:white;margin:0 0 7.5pt;"><strong><span style="font-size:9pt;font-family:Helvetica;color:#333333;">New Tree View</span></strong><span style="font-size:9pt;font-family:Helvetica;color:#333333;"> </span><span style="font-size:9pt;font-family:Helvetica;color:#333333;">– see, at-a-glance, the structure of your data</span></p>
<p style="margin:0 0 7.5pt;background-color:white;background-position:initial initial;background-repeat:initial initial;"><strong><span style="font-size:9pt;font-family:Helvetica;color:#333333;">Automatic building</span></strong><strong><span style="font-size:9pt;font-family:Helvetica;color:#333333;"> of XPaths </span></strong><span style="font-size:9pt;font-family:Helvetica;color:#333333;">– The Tree View can now be used to show PIP the data you are interested in &#8211; and PIP generates the XPath automatically.  This feature even works with Apple&#8217;s Property List &#8216;dictionary&#8217; structures.</span></p>
<p style="margin:0 0 7.5pt;background-color:white;background-position:initial initial;background-repeat:initial initial;"><strong><span style="font-size:9pt;font-family:Helvetica;color:#333333;">Import/Export Batch Jobs</span></strong><span style="font-size:9pt;font-family:Helvetica;color:#333333;"> </span><span style="font-size:9pt;font-family:Helvetica;color:#333333;">– Set-up a batch job of XPaths for a particular folder structure (iOS Library or Application folders for example) and then export the batch so that you, or anyone else in your lab can re-use it when you next come across the same data</span></p>
<p style="margin:0 0 7.5pt;background-color:white;background-position:initial initial;background-repeat:initial initial;"><strong><span style="font-size:9pt;font-family:Helvetica;color:#333333;">Command line version</span></strong><span style="font-size:9pt;font-family:Helvetica;color:#333333;"> </span><span style="font-size:9pt;font-family:Helvetica;color:#333333;">– version 1.1 of PIP comes with the &#8220;pipcmd&#8221; command-line utility, allowing you to integrate PIP into tool chains and other automated tasks</span></p>
<p style="background:white;margin:0 0 7.5pt;"><span style="font-size:9pt;font-family:Helvetica;color:#333333;">To find out more, or to purchase PIP, please visit our <a href="http://www.ccl-forensics.com/pip" target="_blank">PIP download</a> page.</span></p>
<p style="background:white;margin:0 0 7.5pt;"><span style="font-size:9pt;font-family:Helvetica;color:#333333;"> </span></p>
]]></content:encoded>
					
					<wfw:commentRss>https://digitalinvestigation.wordpress.com/2012/06/12/xml-and-plist-parser-updated-version-available/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">280</post-id>
		<media:content url="https://0.gravatar.com/avatar/69d8d1e2b4b3bf7ff73bd8d2b0b9ac55b57cb85db73c1811cb0bc6053ecc3d0a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">digitalinvestigation</media:title>
		</media:content>
	</item>
		<item>
		<title>Benefits of hindsight: Why ‘nurturing’ data can prove valuable for cell site analysts.</title>
		<link>https://digitalinvestigation.wordpress.com/2012/05/30/benefits-of-hindsight-why-nurturing-data-can-prove-valuable-for-cell-site-analysts/</link>
					<comments>https://digitalinvestigation.wordpress.com/2012/05/30/benefits-of-hindsight-why-nurturing-data-can-prove-valuable-for-cell-site-analysts/#respond</comments>
		
		<dc:creator><![CDATA[CCL-Forensics]]></dc:creator>
		<pubDate>Wed, 30 May 2012 14:57:46 +0000</pubDate>
				<category><![CDATA[Cell site analysis]]></category>
		<category><![CDATA[CCL-Forensics]]></category>
		<category><![CDATA[cell site analysis]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[digital evidence]]></category>
		<category><![CDATA[evidence]]></category>
		<category><![CDATA[Matthew Tart]]></category>
		<guid isPermaLink="false">http://digitalinvestigation.wordpress.com/?p=264</guid>

					<description><![CDATA[It’s at this time of year, when the sun is shining (well, it IS at the very moment these words are being written), that carrying out an intensive cell site survey seems almost like a perk of the job. But, &#8230; <a href="https://digitalinvestigation.wordpress.com/2012/05/30/benefits-of-hindsight-why-nurturing-data-can-prove-valuable-for-cell-site-analysts/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>It’s at this time of year, when the sun is shining (well, it IS at the very moment these words are being written), that carrying out an intensive cell site survey seems almost like a perk of the job. But, as everyone involved knows, a cell site expert shouldn’t expect that each assignment should come with such luxuries.  Surveys aren’t always necessary – and even where they are, there could be a smarter solution.  In this month’s cell site ‘blog’, Matthew Tart looks at the possibility of using data from previous cases.</p>
<p>This month’s topic: Use of historic cell site data</p>
<p>Q: First of all, precisely what do we mean by historic cell site data?</p>
<p>A: Simply, it’s data <a href="http://www.ccl-forensics.com/Services/cell-site-analysis.html">CCL-Forensics</a> has generated from carrying out previous cases, which we have organised and stored in an ever-growing database.  The reason we have this, is because we don’t carry out static surveys as we have found they have limited repeatability and failed validation (this is described in our previous blog <a href="http://www.ccl-forensics.com/Law-Enforcement-News/cell-site-research-published.html">here</a>), which I’ll go into in a little more detail later.  So if we’re interested in where a particular cell serves, there is a potential that we’ve already surveyed relevant areas.  We’re not (quite!) up to UK wide coverage yet, but the database is growing rapidly, plus we’re getting additional cell data every time we travel between our offices and the general area of the survey.  </p>
<p>Q: So, how does this actually benefit the case. Surely, all cases are different, and you may still have to do some surveying?</p>
<p>A:  This is not necessarily a replacement for any future survey, it is an enhancement, but it does have some significant advantages.  The first being that it can help us to scope out a case, and therefore produce a more accurate strategy – keeping costs down.  The more <a href="http://www.ccl-forensics.com/Services/cell-site-analysis.html">CCL-Forensics</a> know about the network infrastructure of the location in question, the more easily we can produce the most cost-effective forensic solution to the problem at hand. It’s also been useful in court, where very specific questions have been raised about the coverage of a cell; if we have relevant data, our expert in the witness box can easily (and with no cost to anyone involved), use that area information – adding value to proceedings.  In short, it means that we simply have more data with which to work – and scientifically, that’s a very good place to be.</p>
<p>Q: But isn’t there a risk that the data may be out of date?</p>
<p>A: The timeliness of data is always a consideration in cell site analysis.  One of the most common concerns tends to surround how the network may have changed in the (often) months between the incident and the survey.  By using data collected in the past, it could be <em>more</em> relevant to the time of the incident.  Additionally further surveys can be undertaken to assess whether that there have been changes in the network over a period of time – and not even the networks themselves can give us information as reliable as that.</p>
<p>Q:  Why aren’t all cell site analysts doing this?</p>
<p>A: I’m not saying it’s only <a href="http://www.ccl-forensics.com/Services/cell-site-analysis.html">CCL-Forensics</a> who are doing it, but there are analysts who practice certain surveying techniques where keeping a database would not be appropriate.  Earlier, I mentioned the concept of carrying out static surveys.  <a href="http://www.ccl-forensics.com/">CCL-Forensics</a> have gone through this at length before, but this just goes to reinforce why turning up at a scene, carrying out a few measurements and then leaving again, is not the strongest piece of science in the world.</p>
<p>Using static surveys each job stands alone and in isolation from any other examination.</p>
<p>Q: It must take up a serious amount of storage space</p>
<p>A: <a href="http://www.ccl-forensics.com/Services/cell-site-analysis.html">CCL-Forensics</a> had to buy a huge new server to hold this data, but it’s already been worth it.  We’ve saved so much time by having access to this data, and passed on significant cost savings as a result.  It also means that our clients are getting stronger evidence, effectively for free.  It’s stronger because we can more accurately assess service areas, and also get an educated idea of network changes, which can inform expectations at the outset of an investigation and same time during it.</p>
<p>For us, it’s definitely an investment in the future and ideally, we’d like to be a position where we have the whole country mapped, but that’s a little way away at the moment!</p>
<p>To finish with an example: There was an urgent pre case management hearing relating to an incident in a city 150 miles from our base.  We were asked to provide some analysis of call data records on a Wednesday morning, which were needed by the Thursday evening. </p>
<p><a href="http://www.ccl-forensics.com/">CCL-Forensics</a> checked our database and found extensive surveys in and around the locations of interest, and could make an informed estimate of cell service at those addresses without the disruption, delay and cost of travelling to the area and carrying out a survey.  Basically this would not have been possible, given the time constraint, had we not had the historic data. </p>
<p>Of course it is not just the survey time that causes delay, it’s the preparation, travelling, data manipulation, analysis and reporting of that data.  But, as we’d already surveyed the area, the client had the report they needed well ahead of the deadline: something which would have been practically impossible otherwise. </p>
<p>To summarise, every case we do makes <a href="http://www.ccl-forensics.com/Services/cell-site-analysis.html">CCL-Forensics</a> service stronger.</p>
<p>For more information about historical cell site data usage, or any of the other issues highlighted in this month’s blog, please email Matthew Tart at <a href="mailto:mtart@ccl-forensics.com">mtart@ccl-forensics.com</a> or call 01789 261200</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://digitalinvestigation.wordpress.com/2012/05/30/benefits-of-hindsight-why-nurturing-data-can-prove-valuable-for-cell-site-analysts/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">264</post-id>
		<media:content url="https://0.gravatar.com/avatar/69d8d1e2b4b3bf7ff73bd8d2b0b9ac55b57cb85db73c1811cb0bc6053ecc3d0a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">digitalinvestigation</media:title>
		</media:content>
	</item>
		<item>
		<title>Mystery box reveals digital secrets</title>
		<link>https://digitalinvestigation.wordpress.com/2012/05/17/mystery-box-reveals-digital-secrets/</link>
					<comments>https://digitalinvestigation.wordpress.com/2012/05/17/mystery-box-reveals-digital-secrets/#comments</comments>
		
		<dc:creator><![CDATA[CCL-Forensics]]></dc:creator>
		<pubDate>Thu, 17 May 2012 15:18:47 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<category><![CDATA[R&D]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Arun Prasannan]]></category>
		<category><![CDATA[CCL-Forensics]]></category>
		<category><![CDATA[digital investigation]]></category>
		<category><![CDATA[evidence]]></category>
		<category><![CDATA[forensic analysis]]></category>
		<guid isPermaLink="false">http://digitalinvestigation.wordpress.com/?p=258</guid>

					<description><![CDATA[Arun Prasannan, member of CCL-Forensics’ R&#38;D team.  Every now and again, an unusual device arrives for analysis at CCL-Forensics, which proves interesting – but above all, significant to an investigation. Earlier this month, a UK law enforcement agency submitted what &#8230; <a href="https://digitalinvestigation.wordpress.com/2012/05/17/mystery-box-reveals-digital-secrets/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>Arun Prasannan, member of <a href="http://www.ccl-forensics.com/">CCL-Forensics’ </a>R&amp;D team. </p>
<p>Every now and again, an unusual device arrives for analysis at <a href="http://www.ccl-forensics.com/">CCL-Forensics</a>, which proves interesting – but above all, significant to an investigation.</p>
<p>Earlier this month, a UK law enforcement agency submitted what can only be described as a ‘black box’.  It was plastic, no bigger than a packet of cigarettes, and from the outside, it had only a slot for a SIM card and a socket for power.</p>
<p>Working closely with the investigating agency, a member of <a href="http://www.ccl-forensics.com/">CCL-Forensics’ </a>R&amp;D team carried out an in-depth analysis of what was inside the device, and what data it was capable of storing.</p>
<p>It was initially suspected that it was some kind of tracking device, and when disassembled, it was found to contain a battery, and two separate circuit boards, to one of which was attached a mercury switch which detected movement.  One board contained all the circuitry one would normally expect on a mobile phone, and had everything it needed to connect to a GSM network.  When examined VERY closely, it was labelled (in very small print) with an IMEI number.  From this, we could identify the board, and then research all the available documents about that piece of hardware.</p>
<p>Interestingly, it was a widely used GSM module found in many mobile devices such as GPS trackers, Fax machines and even some phones.</p>
<p>The SIM card was analysed separately, and it was strongly suspected that there was additional data on the board itself.</p>
<p>Our analysts procured a test module, and carried out a comprehensive technical analysis to validate what data it could store.  It was found to have the capacity to store call data (made, received, missed), SMS and contacts – as well as some call timers.  It was also determined that SMS messages could be extracted without changing their status. </p>
<p>Following this comprehensive research, it was found that the suspect device DID contain a number of phone numbers and call times – which were presented back to the investigator in the case.  This was a level of potentially vital evidence which would have been missed without this very low-level investigation of the device and the data it contained.</p>
<p>It also highlights the talents of <a href="http://www.ccl-forensics.com/">CCL-Forensics</a>’ <a href="http://www.ccl-forensics.com/tools.html">R&amp;D department</a>, and the value investigators can derive by not simply opting for a ‘plug and play’ forensic examination.</p>
<p>For more information, please contact us at <a href="research@ccl-forensics.com">research@ccl-forensics.com</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://digitalinvestigation.wordpress.com/2012/05/17/mystery-box-reveals-digital-secrets/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">258</post-id>
		<media:content url="https://0.gravatar.com/avatar/69d8d1e2b4b3bf7ff73bd8d2b0b9ac55b57cb85db73c1811cb0bc6053ecc3d0a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">digitalinvestigation</media:title>
		</media:content>
	</item>
	</channel>
</rss>
