{"id":2339,"date":"2014-04-27T11:24:55","date_gmt":"2014-04-27T11:24:55","guid":{"rendered":"http:\/\/www.hexacorn.com\/blog\/?p=2339"},"modified":"2014-09-20T22:22:52","modified_gmt":"2014-09-20T22:22:52","slug":"beyond-good-ol-run-key-part-11","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2014\/04\/27\/beyond-good-ol-run-key-part-11\/","title":{"rendered":"Beyond good ol\u2019 Run key, Part 11"},"content":{"rendered":"<p>I must admit that finding new paths that could be exploited as a persistence mechanism is a silly hobby of mine. When I started this series I thought that a few posts will suffice, but to my surprise it&#8217;s already #11. For your convenience, these are links to the older posts::<\/p>\n<ul>\n<li><a title=\"Beyond good ol\u2019 Run key\" href=\"https:\/\/www.hexacorn.com\/blog\/2012\/07\/23\/beyond-good-ol-run-key\/\">Beyond good ol\u2019 Run key, Part 1<\/a><\/li>\n<li><a title=\"Beyond good ol\u2019 Run key, Part 2\" href=\"https:\/\/www.hexacorn.com\/blog\/2012\/09\/16\/beyond-good-ol-run-key-part-2\/\">Beyond good ol\u2019 Run key, Part 2<\/a><\/li>\n<li><a title=\"Beyond good ol\u2019 Run key, Part 3\" href=\"https:\/\/www.hexacorn.com\/blog\/2013\/01\/19\/beyond-good-ol-run-key-part-3\/\">Beyond good ol\u2019 Run key, Part 3<\/a><\/li>\n<li><a title=\"Beyond good ol\u2019 Run key, Part 4\" href=\"https:\/\/www.hexacorn.com\/blog\/2013\/09\/19\/beyond-good-ol-run-key-part-4\/\">Beyond good ol\u2019 Run key, Part 4<\/a><\/li>\n<li><a title=\"Beyond good ol\u2019 Run key, Part 5\" href=\"https:\/\/www.hexacorn.com\/blog\/2013\/12\/08\/beyond-good-ol-run-key-part-5\/\">Beyond good ol\u2019 Run key, Part 5<\/a><\/li>\n<li><a title=\"Beyond good ol\u2019 Run key, Part 6\" href=\"https:\/\/www.hexacorn.com\/blog\/2014\/01\/10\/beyond-good-ol-run-key-part-6-2\/\">Beyond good ol\u2019 Run key, Part 6<\/a><\/li>\n<li><a title=\"Beyond good ol\u2019 Run key, Part 7\" href=\"https:\/\/www.hexacorn.com\/blog\/2014\/02\/09\/beyond-good-ol-run-key-part-7\/\">Beyond good ol\u2019 Run key, Part 7<\/a><\/li>\n<li><a title=\"Beyond good ol\u2019 Run key, Part 8\" href=\"https:\/\/www.hexacorn.com\/blog\/2014\/02\/21\/beyond-good-ol-run-key-part-8-2\/\">Beyond good ol\u2019 Run key, Part 8<\/a><\/li>\n<li><a title=\"Beyond good ol\u2019 Run key, Part 9\" href=\"https:\/\/www.hexacorn.com\/blog\/2014\/03\/02\/beyond-good-ol-run-key-part-9\/\">Beyond good ol\u2019 Run key, Part 9<\/a><\/li>\n<li><a title=\"Beyond good ol\u2019 Run key, Part 10\" href=\"https:\/\/www.hexacorn.com\/blog\/2014\/04\/16\/beyond-good-ol-run-key-part-10\/\">Beyond good ol\u2019 Run key, Part 10<\/a><\/li>\n<\/ul>\n<p>You may also want to have a look at &#8216;A Collection of Autostart Locations&#8217; &#8211; a very large and comprehensive list of autostart entries collected by Tony Klein<\/p>\n<ul>\n<li><a href=\"http:\/\/gladiator-antivirus.com\/forum\/index.php?showtopic=24610\">http:\/\/gladiator-antivirus.com\/forum\/index.php?showtopic=24610<\/a><\/li>\n<\/ul>\n<p>Back to the #11.<\/p>\n<p>In the part #10 (Office Test) I mentioned that Microsoft products seem to be heavily integrated with various testing platforms. I also referenced various aspects of performance analysis, profiling, monitoring and debugging in parts #4 (various debuggers), #6 (VBA Monitors), #7 (OAClient). There is one more trick that we can add to the list &#8211; legitimate, developer-friendly profiling mechanisms that can be enabled on non-developer systems and&#8230; act as a persistence mechanism.<\/p>\n<p>The profiling mechanisms described further require a persistent environment variable to be set. This can be achieved by setting the respective values under HKCU or HKLM:<\/p>\n<ul>\n<li>HKEY_CURRENT_USER\\Environment<\/li>\n<li>HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment<\/li>\n<\/ul>\n<p>The values that need to be placed under the Environment keys depend on the profiling mechanism &#8211; these are listed below:<\/p>\n<ul>\n<li>JS_PROFILER\u00a0&#8211; <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/cc843609%28v=vs.94%29.aspx\">Active Script Profiling<\/a> (I believe it was introduced in IE 8.0)<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li>COR_ENABLE_PROFILING &amp; COR_PROFILER &amp; COR_PROFILER_PATH &amp;<br \/>\nCOMPLUS_ProfAPI_ProfilerCompatibilitySetting &amp;<br \/>\nCORECLR_ENABLE_PROFILING &amp; CORECLR_PROFILER &amp;\u00a0 CORECLR_PROFILER_PATH<br \/>\n&#8211; <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/bb384689%28v=vs.110%29.aspx\">.NET Profiling<\/a><br \/>\nsee also<br \/>\n<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ee471451%28v=vs.110%29.aspx\">Registry-Free Profiler Startup and Attach<br \/>\n<\/a><a href=\"http:\/\/blogs.msdn.com\/b\/davbr\/archive\/2010\/01\/21\/writing-a-profiler-for-silverlight-4.aspx\">Writing a Profiler for Silverlight 4<br \/>\n<\/a><a href=\"http:\/\/blogs.msdn.com\/b\/davbr\/archive\/2011\/02\/01\/clrprofiler-v4-released.aspx\">CLRProfiler V4<\/a> and<br \/>\n<a href=\"http:\/\/go.microsoft.com\/fwlink\/?LinkID=271485\">Writing a Profiler of Windows Store apps (PDF)<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong>Example for JS_PROFILER:<\/strong><\/p>\n<p>Adding the following Registry entries:<\/p>\n<pre>[HKEY_CLASSES_ROOT\\CLSID\\{12345678-1234-1234-1234-123456789abc}\\InprocServer32]\r\n@=hex(2):63,00,3A,00,5C,00,74,00,65,00,73,00,74,00,5C,00,74,00,65,00,\\\r\n  73,00,74,00,2E,00,64,00,6C,00,6C,00,00,00\r\n\r\n[HKEY_CURRENT_USER\\Environment]\r\n\"JS_PROFILER\"=\"{12345678-1234-1234-1234-123456789abc}\"<\/pre>\n<p>will ensure that c:\\test\\test.dll (added as a REG_EXPAND_SZ value using &#8216;@=hex(2):&#8230;&#8217;) is loaded anytime Internet Explorer is executed or its control instantiated (JS_PROFILER is used internally by JSCRIPT*.DLLs &#8211; they handle scripting and they are used by Internet Explorer).<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I must admit that finding new paths that could be exploited as a persistence mechanism is a silly hobby of mine. When I started this series I thought that a few posts will suffice, but to my surprise it&#8217;s already &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2014\/04\/27\/beyond-good-ol-run-key-part-11\/\">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,15,19,9],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/2339"}],"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=2339"}],"version-history":[{"count":9,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/2339\/revisions"}],"predecessor-version":[{"id":2348,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/2339\/revisions\/2348"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=2339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=2339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=2339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}