{"id":5873,"date":"2019-01-27T22:36:07","date_gmt":"2019-01-27T22:36:07","guid":{"rendered":"http:\/\/www.hexacorn.com\/blog\/?p=5873"},"modified":"2019-01-28T01:28:06","modified_gmt":"2019-01-28T01:28:06","slug":"too-much-makes-event-viewer-drunk","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2019\/01\/27\/too-much-makes-event-viewer-drunk\/","title":{"rendered":"Too much % makes Event Viewer drunk"},"content":{"rendered":"\n<p><strong>Update:<\/strong><\/p>\n\n\n\n<p>After I posted it <a href=\"https:\/\/twitter.com\/danielhbohannon\">Daniel Bohannon<\/a> provided a <a href=\"http:\/\/www.danielbohannon.com\/blog-1\/2018\/3\/19\/test-your-dfir-tools-sysmon-edition\">link<\/a> to his earlier research (March 2018) where he described the very same problem. He has some interesting examples so please have a look!<\/p>\n\n\n\n<p><strong>Old Post:<\/strong><\/p>\n\n\n\n<p>This is a short post about a funny side effect of using the % sign and how these are being interpreted by Windows Events Log Viewer.<\/p>\n\n\n\n<p>When you use this character as a part of a file name, or as a Registry data the program will assume these % signs are referring to actual parameters and will resolve them into actual strings.<\/p>\n\n\n\n<p>I know it doesn&#8217;t make any sense, so let&#8217;s do a test.<\/p>\n\n\n\n<p>Name your program %1.exe. Run it. This is what the Viewer will show:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/01\/sysmon6_1.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/01\/sysmon6_1.png\" alt=\"\" class=\"wp-image-5874\" width=\"323\" height=\"499\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/01\/sysmon6_1.png 431w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/01\/sysmon6_1-194x300.png 194w\" sizes=\"(max-width: 323px) 100vw, 323px\" \/><\/a><\/figure><\/div>\n\n\n\n<p>Now try to add this Registry value:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">reg add HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run \/v Foo \/t reg_sz \/d test%1%2%3%4%5%6%7%8%9%10%100<\/pre>\n\n\n\n<p>The result? Very strange details:<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/01\/sysmon6_2.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/01\/sysmon6_2-1024x60.png\" alt=\"\" class=\"wp-image-5875\" width=\"256\" height=\"15\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/01\/sysmon6_2-1024x60.png 1024w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/01\/sysmon6_2-300x18.png 300w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/01\/sysmon6_2-768x45.png 768w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/01\/sysmon6_2.png 1147w\" sizes=\"(max-width: 256px) 100vw, 256px\" \/><\/a><\/figure>\n\n\n\n<p>What about naming the program %1%2%3.exe?<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/01\/sysmon6_3.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/01\/sysmon6_3.png\" alt=\"\" class=\"wp-image-5876\" width=\"372\" height=\"207\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/01\/sysmon6_3.png 744w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/01\/sysmon6_3-300x167.png 300w\" sizes=\"(max-width: 372px) 100vw, 372px\" \/><\/a><\/figure>\n\n\n\n<p>Look at the image and the command line. One is: <em>C:\\Test\\2019-01-27 22:28:29.601{670b5bbc-308d-5c4e-0000-00105f407c03}.exe<\/em>, and the other <em>&#8220;C:\\Test\\Incorrect function.The system cannot find the file specified.The system cannot find the path specified..exe&#8221;<\/em>.<\/p>\n\n\n\n<p>Only the viewer is fooled, because the actual data is logged properly (although there is an inconsistency in the way %s are doubled in command line) &#8212; one just needs to go to Details tab and see what it really shows:<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/01\/sysmon6_4.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/01\/sysmon6_4.png\" alt=\"\" class=\"wp-image-5877\" width=\"186\" height=\"83\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/01\/sysmon6_4.png 371w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/01\/sysmon6_4-300x134.png 300w\" sizes=\"(max-width: 186px) 100vw, 186px\" \/><\/a><\/figure>\n\n\n\n<p> That&#8217;s it. Yet another quirky behavior to be aware of.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Update: After I posted it Daniel Bohannon provided a link to his earlier research (March 2018) where he described the very same problem. He has some interesting examples so please have a look! Old Post: This is a short post &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2019\/01\/27\/too-much-makes-event-viewer-drunk\/\">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":[43,13,19,46,9],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/5873"}],"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=5873"}],"version-history":[{"count":4,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/5873\/revisions"}],"predecessor-version":[{"id":5883,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/5873\/revisions\/5883"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=5873"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=5873"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=5873"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}