{"id":1859,"date":"2013-04-30T20:16:05","date_gmt":"2013-04-30T20:16:05","guid":{"rendered":"http:\/\/www.hexacorn.com\/blog\/?p=1859"},"modified":"2016-01-08T11:21:51","modified_gmt":"2016-01-08T11:21:51","slug":"jumplists-file-names-and-appid-calculator","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2013\/04\/30\/jumplists-file-names-and-appid-calculator\/","title":{"rendered":"JumpLists file names and AppID calculator"},"content":{"rendered":"<p>JumpList files are an interesting forensic artifact and as such they have been thoroughly explored by many researchers over last 2-3 years. There is really a lot of material out there and there are also many tools that parse JumpList files&#8217; structure quite well. This is why in this post I will focus not on the content of JumpList files, but on their&#8230; file names.<\/p>\n<h2>Algorithm<\/h2>\n<p>The JumpList file names are created using hash-like values that in turn are based on something that is called <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/dd378459%28v=vs.85%29.aspx\">AppID<\/a>. The Forensics Wiki lists many known <a href=\"http:\/\/www.forensicswiki.org\/wiki\/List_of_Jump_List_IDs\">Jump List file names<\/a> based on AppIDs; examples include:<strong><br \/>\n<\/strong><\/p>\n<ul>\n<li><strong>918e0ecb43d17e23<\/strong> used by Notepad (32-bit)<\/li>\n<li><strong>9b9cdc69c1c24e2b<\/strong> used by Notepad (64-bit)<\/li>\n<li><strong>1bc392b8e104a00e <\/strong>used by Remote Desktop<\/li>\n<\/ul>\n<p>and so on and so forth. The data from Forensics Wiki has been harvested from many sources and it&#8217;s a very useful reference for further research.<\/p>\n<p>The algorithm to create a hash-like value is actually &#8216;sort of known&#8217;. There are posts out there suggesting that the AppID is a nothing but a CRC64 sum taken from the application path. For example, in this <a href=\"http:\/\/www.4n6k.com\/2011\/09\/jump-list-forensics-appids-part-1.html\">post<\/a>, an Anonymous poster provided a Hexrays Decompiler&#8217;s code snapshot taken from shell32.dll showing how the AppID is generated. When I came across this particular comment I decided to verify it. I applied CRC64 sum to an example path and compared it with an expected known file name, and since you are reading this post you are probably guessing that it failed miserably \ud83d\ude42<\/p>\n<p>Okay, so since it failed and since the algorithm didn&#8217;t t seem to be explored in-depth yet I thought I will give it a go. It turned out to be quite simple, but there were a few challenges on the way that may be interesting to know about so I describe it below. I also ended up writing a perl script that I called AppID calculator (appid_calc.pl). It allows you to calculate an AppID based on provided string &#8211; more about it below as well. You can find a download link to the script at the bottom of this post.<\/p>\n<h2>Challenges<\/h2>\n<p>Using the code snippet I referred to earlier as a guidance, I quickly found the code responsible for generating AppIDs, put the appropriate breakpoints in a debugger, and.. immediately understood why the CRC64 (path) didn&#8217;t work for me earlier \ud83d\ude42<\/p>\n<p>The CRC64 algorithm has been indeed applied to a path, but there are a few quirks:<\/p>\n<ul>\n<li>The path is first converted to Unicode<\/li>\n<li>If the path is located in one of locations that are recognized and treated by system in a special way, the path is normalized first<\/li>\n<li>The CRC64(Path) algorithm applies only to AppIDs automatically generated by the system; At any point of time any application can change its AppID either using the <em>SetCurrentProcessExplicitAppUserModelID<\/em> API, or can even apply window-specific AppID using \u00a0<em>IPropertyStore::SetValue<\/em> to change the <em>PKEY_AppUserModel_ID<\/em> property of\u00a0 the particular <a href=\"https:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2012\/08\/17\/10340743.aspx\">window<\/a><\/li>\n<li>On top of that, the CRC64 uses a non-standard polynomial<\/li>\n<\/ul>\n<p>First, let&#8217;s talk about the CRC64. There are many CRC algorithms out there. In fact, the difference is not only between the length in bits (CRC16, CRC32, CRC64), but also in the configuration of a particular implementation. There are obviously many standard configurations (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Cyclic_redundancy_check\">Wikipedia described quite a few<\/a>), but the one used in AppID generation is not on the standard list. I know, because the very first thing I tried was to use all standard configurations, but all of them failed :-).<\/p>\n<p>The actual code used by the system relies on a precalculated lookup table, but googling around for the numbers from the table only brought 2-3 hits. In such case, the usual way of solving the issue is to rip the code from the source and reimplement it e.g. in perl.\u00a0 This could be done easily. The 2-3 hits I mentioned earlier refer to a code that was created as a result of reverse engineering of thumbcache.dll\u00a0 file &#8211; turns out that the very exact CRC64 configuration\/implementation has been used in that DLL.<\/p>\n<p>Exploring the properties of CRC I eventually managed to deduce the CRC configuration and the actual polynomial used to generate the lookup table.<\/p>\n<p>The polynomial used by the AppID algorithm is <span style=\"color: #ff0000;\"><strong>0x92C64265D32139A4<\/strong><\/span>.<\/p>\n<p>Once I found out I went to google again and this time I also got 2-3 hits only. First two were on the Thumb Cache-related code I already mentioned. The last one was the Microsoft page describing the use of this particular polynomial in a <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/hh554834.aspx\">ADSStreamHeader<\/a> structure:<\/p>\n<p style=\"padding-left: 30px;\"><strong>Crc (8 bytes): <\/strong>A bit-reversed CRC-64 hash of the FCIADS stream from the <strong>TimeStamp<\/strong> field to the end of the structure that can be used to validate the integrity of the FCIADS stream. The cyclic redundancy check (CRC) polynomial is x**64 + x**61 + x**58 + x**56 + x**55 + x**52 + x**51 + x**50 + x**47 + x**42 + x**39 + x**38 + x**35 + x**33 + x**32 + x**31 + x**29 + x**26 + x**25 + x**22 + x**17 + x**14 + x**13 + x**9 + x**8 + x**6 + x**3 + 1, with the leading 1 implied. The normal representation is <span style=\"color: #ff0000;\">0x92C64265D32139A4<\/span>.<\/p>\n<p>That was a good sign and I could now start implementing the appid calculator w\/o ripping the lookup tables.<\/p>\n<p>The second issue to solve was the normalization.\u00a0 The paths are normalized using <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/dd378457%28v=vs.85%29.aspx\">KNOWNFOLDERIDs<\/a>, so it&#8217;s a simple search and replace before applying the CRC.<\/p>\n<p>One aspect of normalization I need to mention is&#8230; ambiguity. Depending on the OS (32 vs. 64 bit) different KNOWNFOLDERIDs are applied during the normalization path and it&#8217;s quite confusing. I suggest reading the Microsoft page I linked to above for further details.<\/p>\n<p>Last, but not least. &#8211; quite a lot applications use <em>SetCurrentProcessExplicitAppUserModelID<\/em> API to change their AppID after they are executed. For example, the following applications do it (AppID &#8211; application name):<\/p>\n<ul>\n<li><strong>Microsoft.Silverlight.Offline<\/strong> &#8211; Silverlight<\/li>\n<li><strong>Microsoft.InternetExplorer.Default<\/strong> &#8211; Internet Explorer<\/li>\n<li><strong>VMware.Workstation.vmplayer<\/strong> &#8211; VMWare Player<\/li>\n<li><strong>Microsoft.Windows.MediaPlayer32<\/strong> &#8211; Windows Media Player (32-bit)<\/li>\n<li><strong>Microsoft.Windows.MediaPlayer64<\/strong> &#8211; Windows Media Player (64-bit)<\/li>\n<\/ul>\n<p>For this reason, attempting to find e.g. AppID of <em>c:\\program files\\Internet Explorer\\iexplore.exe<\/em> doesn&#8217;t really make sense as all IE windows are grouped under <strong>Microsoft.InternetExplorer.Default<\/strong> AppID.<\/p>\n<h2>Examples<\/h2>\n<h4>AppIDs of InternetExplorer and Sticky Notes<\/h4>\n<p><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/04\/appid_1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1863\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/04\/appid_1.png\" alt=\"appid_1\" width=\"541\" height=\"323\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/04\/appid_1.png 541w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/04\/appid_1-300x179.png 300w\" sizes=\"(max-width: 541px) 100vw, 541px\" \/><\/a><\/p>\n<p>These can be confirmed by looking at Forensic Wiki:<\/p>\n<ul>\n<li><strong>Microsoft.InternetExplorer.Default<\/strong> &#8211; <strong>28C8B86DEAB549A1<\/strong><\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/04\/appid_2.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1864\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/04\/appid_2.png\" alt=\"appid_2\" width=\"665\" height=\"331\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/04\/appid_2.png 665w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/04\/appid_2-300x149.png 300w\" sizes=\"(max-width: 665px) 100vw, 665px\" \/><\/a><\/p>\n<ul>\n<li><strong>Microsoft.Windows.StickyNotes<\/strong> &#8211; <strong>337ED59AF273C758<\/strong><\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/04\/appid_3.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1865\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/04\/appid_3.png\" alt=\"appid_3\" width=\"591\" height=\"265\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/04\/appid_3.png 591w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/04\/appid_3-300x134.png 300w\" sizes=\"(max-width: 591px) 100vw, 591px\" \/><\/a><\/p>\n<h4>\u00a0Notepad<\/h4>\n<p><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/04\/appid_4.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1866\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/04\/appid_4.png\" alt=\"appid_4\" width=\"801\" height=\"324\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/04\/appid_4.png 917w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/04\/appid_4-300x121.png 300w\" sizes=\"(max-width: 801px) 100vw, 801px\" \/><\/a><\/p>\n<p>You may notice that in this example there are 2 different AppIDs shown. This is because of the ambiguity I mentioned earlier; applications running on 64-bit systems can be executed in more than one configuration and since there is WOW64 folder redirection happening AppID needs to be calculated in a context.<\/p>\n<p>The Notepad path looks the same to both 32- and 64-bit application (because of WOW64 folder redirection):<\/p>\n<ul>\n<li>c:\\windows\\system32\\notepad.exe<\/li>\n<\/ul>\n<p>but the AppID depends on a type of Notepad .exe file:<\/p>\n<ul>\n<li>if it is 32-bit, the AppID is <strong>918E0ECB43D17E23 <\/strong><\/li>\n<li>if 64-bit, the AppID is <strong>9B9CDC69C1C24E2B<\/strong>.<\/li>\n<\/ul>\n<p>This can be also confirmed via Forensic Wiki:<\/p>\n<p><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/04\/appid_6.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1869\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/04\/appid_6.png\" alt=\"appid_6\" width=\"768\" height=\"102\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/04\/appid_6.png 768w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/04\/appid_6-300x39.png 300w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/a><\/p>\n<h4>Internet Explorer &#8211; via path<\/h4>\n<p>It gets even more complicated with Program Files folder as it has two versions &#8211; with and without (X86) and 32-\/64- bit applications both &#8216;see&#8217; Program Files the same way. As an example we could try to generate a hash for Internet Explorer in various configurations by running appid calculator and providing to it a path to <em>c:\\Program Files\\Internet Explorer\\iexplore.exe<\/em>. As mentioned earlier IE uses an AppID that it sets up during the launch, so you should never see AppIDs shown on the screenshot below, but it is a simple example to show various configurations of <em>Program Files<\/em> folder using a well-known path.<\/p>\n<p><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/04\/appid_5.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1868\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/04\/appid_5.png\" alt=\"appid_5\" width=\"722\" height=\"351\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/04\/appid_5.png 861w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2013\/04\/appid_5-300x145.png 300w\" sizes=\"(max-width: 722px) 100vw, 722px\" \/><\/a><\/p>\n<p>Again, I strongly suggest reading the Microsoft Article about <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/dd378457%28v=vs.85%29.aspx\">KNOWNFOLDERIDs<\/a>, The appid calculator provides a link to it as well if the path is known to be ambiguous (system32, program files, program files\\common).<\/p>\n<h2>Download<\/h2>\n<p>You can find the script <a href=\"https:\/\/www.hexacorn.com\/tools\/appid_calc.pl\">here<\/a>. This is a first version, coded in a hurry so it may contain bugs. If you find any issues, please let me know. Thanks!<\/p>\n<p>To run:<\/p>\n<pre style=\"padding-left: 30px;\">perl appid_calc.pl<\/pre>\n<p>If no argument is passed to it, it will calculate a few sample AppIDs &#8211; the examples illustrate various ways one can provide the path to the script:<\/p>\n<ul>\n<li>c:\\windows\\notepad.exe<\/li>\n<li>c:\\windows\\system32\\notepad.exe<\/li>\n<li>c:\\windows\\syswow64\\notepad.exe<\/li>\n<li>{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\\notepad.exe<\/li>\n<li>c:\\program files\\Internet Explorer\\iexplore.exe<\/li>\n<li>MICROSOFT.INTERNETEXPLORER.DEFAULT<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>JumpList files are an interesting forensic artifact and as such they have been thoroughly explored by many researchers over last 2-3 years. There is really a lot of material out there and there are also many tools that parse JumpList &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2013\/04\/30\/jumplists-file-names-and-appid-calculator\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[50,19,5],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/1859"}],"collection":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/comments?post=1859"}],"version-history":[{"count":11,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/1859\/revisions"}],"predecessor-version":[{"id":3469,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/1859\/revisions\/3469"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=1859"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=1859"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=1859"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}