{"id":7715,"date":"2021-02-24T23:19:41","date_gmt":"2021-02-24T23:19:41","guid":{"rendered":"https:\/\/www.hexacorn.com\/blog\/?p=7715"},"modified":"2021-02-24T23:19:41","modified_gmt":"2021-02-24T23:19:41","slug":"beyond-good-ol-run-key-part-132","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2021\/02\/24\/beyond-good-ol-run-key-part-132\/","title":{"rendered":"Beyond good ol\u2019 Run key, Part 132"},"content":{"rendered":"\n<p>This is a very unpromising persistence mechanism relying on environment variables (again).<\/p>\n\n\n\n<p>Combing through OpenSSL source code I came across two variables that it relies on and they are described <a href=\"https:\/\/www.openssl.org\/docs\/manmaster\/man7\/openssl-env.html\">here<\/a>:<\/p>\n\n\n\n<ul><li>OPENSSL_MODULES &#8211; Specifies the directory from which cryptographic providers are loaded.<\/li><li>OPENSSL_ENGINES &#8211; Specifies the directory from which dynamic engines are loaded<\/li><\/ul>\n\n\n\n<p>Example of a code excerpt from a signed DLL that is compiled with a support for OPENSSL_MODULES is shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2021\/02\/openssl1.png\"><img decoding=\"async\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2021\/02\/openssl1.png\" alt=\"\" class=\"wp-image-7716\" width=\"500\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2021\/02\/openssl1.png 659w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2021\/02\/openssl1-300x199.png 300w\" sizes=\"(max-width: 659px) 100vw, 659px\" \/><\/a><\/figure>\n\n\n\n<p>The good news is that most of Windows-based executables and DLLs that are compiled from OpenSSL sources do not have these variables built-in. I have checked my repo and online repositories as well and it looks like there really are not too many of them available (barely a few). Second good news is that even if compiled with support for these variables, they won&#8217;t be used unless specific functions of OpenSSL are called. Despite some moderate efforts to produce a POC I couldn&#8217;t find any good candidate. As such, using them as a persistence mechanism is a poor choice indeed. Still, worth documenting, as usual.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a very unpromising persistence mechanism relying on environment variables (again). Combing through OpenSSL source code I came across two variables that it relies on and they are described here: OPENSSL_MODULES &#8211; Specifies the directory from which cryptographic providers &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2021\/02\/24\/beyond-good-ol-run-key-part-132\/\">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\/7715"}],"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=7715"}],"version-history":[{"count":1,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/7715\/revisions"}],"predecessor-version":[{"id":7717,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/7715\/revisions\/7717"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=7715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=7715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=7715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}