{"id":4573,"date":"2018-01-04T20:23:28","date_gmt":"2018-01-04T20:23:28","guid":{"rendered":"http:\/\/www.hexacorn.com\/blog\/?p=4573"},"modified":"2018-01-04T20:23:28","modified_gmt":"2018-01-04T20:23:28","slug":"yet-another-way-to-hide-from-sysinternals-tools","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2018\/01\/04\/yet-another-way-to-hide-from-sysinternals-tools\/","title":{"rendered":"Yet another way to hide from Sysinternals&#8217; tools"},"content":{"rendered":"<p>The recipe is simple:<\/p>\n<ul>\n<li>Pick up one of the environment variables.<\/li>\n<li>Name your executable as &#8216;%environment variable%.exe&#8217;<\/li>\n<li>Drop it in a place where system will find it (as per PATH)<\/li>\n<li>Set e.g. Run key to point to it.<\/li>\n<\/ul>\n<p>Example:<\/p>\n<ul>\n<li>Drop c:\\WINDOWS\\%USERNAME%.exe<\/li>\n<\/ul>\n<p>And add:<\/p>\n<ul>\n<li>HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run<br \/>\n&#8220;foobar&#8221;=&#8221;%USERNAME%&#8221;<\/li>\n<\/ul>\n<p>Both Autoruns and Process Explorer (autorun location) won&#8217;t be able to locate the file, because they expand the environment variables. They will also mislead the user by showing a path to an executable that is definitely not on the system e.g. if the user&#8217;s name is JOHN, the entry I listed above will show up as &#8216;File not found: john.exe&#8217;. Looking for &#8216;john.exe&#8217; on the system will not bring any relevant results.<\/p>\n<p><strong>Bonus #1:<\/strong><\/p>\n<p>You could concatenate a number of environment variables &#8211; the file will run, but the entry in the Autoruns will look like a bug. Only visiting the actual entry in the Registry will allow you to spot the trick.<\/p>\n<p><strong>Bonus #2:<\/strong><\/p>\n<p>Using less common environment variables can give even more random misleading information eg. &#8216;%PROCESSOR_LEVEL%&#8217; can resolve to &#8216;6.exe&#8217;. Finding that &#8216;6.exe&#8217; on the system will be pretty tricky.<\/p>\n<p><strong>Bonus #3:<\/strong><\/p>\n<p>Using &#8216;%ComSpec%&#8217; gives the most intriguing result.<\/p>\n<p>Autoruns will resolve it to &#8216;c:\\WINDOWS\\System32\\cmd.exe&#8217; instead of &#8216;c:\\WINDOWS\\%ComSpec%.exe&#8217; and&#8230; since the resolved binary is native OS signed executable&#8230; it will be hidden from the view, unless you Unhide the &#8216;Hide Windows Entries&#8217;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The recipe is simple: Pick up one of the environment variables. Name your executable as &#8216;%environment variable%.exe&#8217; Drop it in a place where system will find it (as per PATH) Set e.g. Run key to point to it. Example: Drop &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2018\/01\/04\/yet-another-way-to-hide-from-sysinternals-tools\/\">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,35,15,19,46,9],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/4573"}],"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=4573"}],"version-history":[{"count":1,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/4573\/revisions"}],"predecessor-version":[{"id":4574,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/4573\/revisions\/4574"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=4573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=4573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=4573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}