{"id":5986,"date":"2019-02-15T00:14:45","date_gmt":"2019-02-15T00:14:45","guid":{"rendered":"http:\/\/www.hexacorn.com\/blog\/?p=5986"},"modified":"2019-02-15T00:14:47","modified_gmt":"2019-02-15T00:14:47","slug":"beyond-good-ol-run-key-part-103","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2019\/02\/15\/beyond-good-ol-run-key-part-103\/","title":{"rendered":"Beyond good ol\u2019 Run key, Part 103"},"content":{"rendered":"\n<p>This is yet another feature of Windows. This time it is a configuration settings for Event Viewer.<\/p>\n\n\n\n<p>When you open the program via <em>eventvr.exe\/msc<\/em> it will launch the <em>mmc.exe<\/em> which in turn will load an Event Viewer snap-in. The Event Viewer allows to view the system \/ application logs that we all should be familiar with.<\/p>\n\n\n\n<p>As part of an user experience the Event Viewer offers a clickable <em>Event Log Online Help<\/em> link:<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/02\/eventviewer.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/02\/eventviewer.png\" alt=\"\" class=\"wp-image-5987\" width=\"364\" height=\"119\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/02\/eventviewer.png 512w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/02\/eventviewer-300x98.png 300w\" sizes=\"(max-width: 364px) 100vw, 364px\" \/><\/a><\/figure>\n\n\n\n<p>When the link is clicked, the <em>mmc.exe <\/em>will open a default help Microsoft link which will be rendered by the currently set up (default) browser. <\/p>\n\n\n\n<p>It turns out that the default setting of this feature can be changed. It is very nicely described <a href=\"https:\/\/winintro.ru\/eventviewer.en\/html\/28cd5e13-e955-4941-91d9-fec2525e96c7.htm\">here<\/a>, but the bottom line is that we can launch a program of our choice instead of the default browser; we just need to modify one, or more of the following registry entries:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">HKLM\\SOFTWARE\\Microsoft\\Windows NT\\<br>CurrentVersion\\Event Viewer\\<\/pre>\n\n\n\n<ul><li>MicrosoftRedirectionURL=&lt;url><\/li><li>MicrosoftRedirectionProgramCommandLineParameters=&lt;args><\/li><li>MicrosoftRedirectionProgram=&lt;program><\/li><\/ul>\n\n\n\n<p>The <em>MicrosoftRedirectionURL <\/em>can be changed to e.g. <em>file:\/\/c:\\windows\\system32\\notepad.exe<\/em>, or <em>MicrosoftRedirectionProgram<\/em> can point to the executable directly. One can also tinker with the command line parameters e.g. in a combo with a lolbin.<\/p>\n\n\n\n<p>There is one gotcha moment while setting up this thing &#8211; there exist <em>Wow6432Node<\/em> equivalent for these entries, but they don&#8217;t seem to be usable; even if entries under this key are changed, and the Event Viewer is launched from a <em>syswow64<\/em> directory (to enforce 32-bit version), the OS will still launch the proper 64-bit version anyway. Perhaps there is a way to enforce the 32-bit version to run, but I have not explored it<\/p>\n\n\n\n<p>Also, we want to ensure the user is not asked for approval to send the data from the log to Microsoft (this dialog box shows up before the program is ran):<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/02\/eventviewer2.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/02\/eventviewer2.png\" alt=\"\" class=\"wp-image-5989\" width=\"420\" height=\"223\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/02\/eventviewer2.png 590w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/02\/eventviewer2-300x160.png 300w\" sizes=\"(max-width: 420px) 100vw, 420px\" \/><\/a><\/figure>\n\n\n\n<p>To do so, we just need to ensure this DWORD is changed to 0:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">HKCU\\Software\\Microsoft\\Windows NT\\<br>CurrentVersion\\Event Viewer\\ConfirmUrl=0<br> <\/pre>\n\n\n\n<p>And that&#8217;s it. Plus, it&#8217;s time for a small bonus.<\/p>\n\n\n\n<p>While I was playing around with Event Viewer, I noticed that it uses Richedit control to render the data it shows. One of the features of this control is that it is automatically recognizing URLs embedded inside the data. As such, it highlights them and make them clickable.<\/p>\n\n\n\n<p>A malicious user could inject a malicious link pointing to a full path on a disk into the logs (e.g. if sysmon is logging, or 4688+cmd line logging is enabled), and then make the richedit convert this path into a clickable link. When I <a href=\"https:\/\/twitter.com\/Hexacorn\/status\/1091108507234025473\">posted<\/a> this discovery on Twitter, it got immediately evilriched by <a href=\"https:\/\/twitter.com\/bsmuir\">Brent Muir<\/a>, who asked if it could be used as a privilege escalation. This was confirmed by me and <a href=\"https:\/\/twitter.com\/theevilbit\">Csaba Fitzl<\/a> in the same <a href=\"https:\/\/twitter.com\/theevilbit\/status\/1091579201646460928\">thread<\/a>. Thanks to everyone who chipped in on that thread.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is yet another feature of Windows. This time it is a configuration settings for Event Viewer. When you open the program via eventvr.exe\/msc it will launch the mmc.exe which in turn will load an Event Viewer snap-in. The Event &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2019\/02\/15\/beyond-good-ol-run-key-part-103\/\">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":[13,35],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/5986"}],"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=5986"}],"version-history":[{"count":2,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/5986\/revisions"}],"predecessor-version":[{"id":5990,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/5986\/revisions\/5990"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=5986"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=5986"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=5986"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}