{"id":5075,"date":"2018-07-06T23:25:17","date_gmt":"2018-07-06T23:25:17","guid":{"rendered":"http:\/\/www.hexacorn.com\/blog\/?p=5075"},"modified":"2018-07-06T23:48:17","modified_gmt":"2018-07-06T23:48:17","slug":"beyond-good-ol-run-key-part-80","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2018\/07\/06\/beyond-good-ol-run-key-part-80\/","title":{"rendered":"Beyond good ol\u2019 Run key, Part 80"},"content":{"rendered":"<p>I talked about remapping keys a number of times (e.g. remapping <a href=\"https:\/\/www.hexacorn.com\/blog\/2017\/12\/08\/beyond-good-ol-run-key-part-68\/\">Win+E<\/a>, adding <a href=\"https:\/\/www.hexacorn.com\/blog\/2015\/03\/13\/beyond-good-ol-run-key-part-29\/\">sneaky hotkeys<\/a>, adding more <a href=\"https:\/\/www.hexacorn.com\/blog\/2018\/02\/09\/beyond-good-ol-run-key-part-72\/\">sneaky hotkeys<\/a>).<\/p>\n<p>Today I am describing one more Registry entry that is a subject to remapping, and as such, may be used as yet another persistence mechanism&#8230;<\/p>\n<p>Modern keyboards come with a variety of &#8216;media&#8217; buttons. Their assignment seems to be hardcoded, but in reality, one can change it by modifying the following entries in the Registry:<\/p>\n<pre>HKCU or HKLM\\software\\microsoft\\windows\\\r\ncurrentversion\\explorer\\appkey\\&lt;number&gt;\\\r\nShellExecute=&lt;program&gt;<\/pre>\n<p>The &lt;number&gt; is the crucial bit &#8211; e.g. the calculator button is number 18 so if you change it, anytime someone presses the Calc media button that chosen program will be launched instead.<\/p>\n<p>All the mappings are listed in <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/desktop\/inputdev\/wm-appcommand\">MSDN<\/a>.<\/p>\n<p>You may notice that 18 that belongs to Calculator is named as APPCOMMAND_LAUNCH_APP2, but such is life. Don&#8217;t trust the documentation \ud83d\ude42<\/p>\n<p>Note:<\/p>\n<p>I didn&#8217;t discover it, but I don&#8217;t recall seeing it mentioned in a context of persistence, so documenting it for the sake of it&#8230; Having said that, I must mention that googling around led me to <a href=\"http:\/\/blog.airbuscybersecurity.com\/post\/2015\/06\/Latest-improvements-in-PlugX\">this blog post<\/a> where the very same trick is described as being used to deliver a clever evasion &#8211; courtesy of PlugX.<\/p>\n<p>Note2:<\/p>\n<p>Turns out there is a <a href=\"http:\/\/ashish.vashisht.net\/2008\/01\/configuring-keyboard-multimedia-keys.html\">good post from Jan 2018<\/a> describing 2 additional registry entries that you may find under the same location:<\/p>\n<ul>\n<li>Association &#8211; the application associated with a particular file type will be opened<\/li>\n<li>RegisteredApp &#8211; the application registered for that function will be called.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>I talked about remapping keys a number of times (e.g. remapping Win+E, adding sneaky hotkeys, adding more sneaky hotkeys). Today I am describing one more Registry entry that is a subject to remapping, and as such, may be used as &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2018\/07\/06\/beyond-good-ol-run-key-part-80\/\">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,35,15,46,9],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/5075"}],"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=5075"}],"version-history":[{"count":5,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/5075\/revisions"}],"predecessor-version":[{"id":5080,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/5075\/revisions\/5080"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=5075"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=5075"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=5075"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}