{"id":202,"date":"2021-11-13T18:51:00","date_gmt":"2021-11-13T18:51:00","guid":{"rendered":"https:\/\/www.davincivirus.com\/?p=202"},"modified":"2021-11-14T22:24:46","modified_gmt":"2021-11-14T22:24:46","slug":"insecure-path","status":"publish","type":"post","link":"https:\/\/www.davincivirus.com\/?p=202","title":{"rendered":"Insecure PATH"},"content":{"rendered":"\n<p>The &#8220;standard search order&#8221; is a list of directories that an operating system iterates through to locate supporting files.  An attacker that possess write privileges to any directory within the standard search order can potentially execute arbitrary code.  This vulnerability is often utilized to escalate privilege or gain persistent access.<\/p>\n\n\n\n<p>The <em>PATH <\/em>environment variable is the most integral component of a standard search order; containing a prioritized list of default locations to be searched by the OS. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" width=\"625\" height=\"156\" src=\"https:\/\/www.davincivirus.com\/wp-content\/uploads\/2021\/11\/PATH_CMD.jpg\" alt=\"\" class=\"wp-image-203\" srcset=\"https:\/\/www.davincivirus.com\/wp-content\/uploads\/2021\/11\/PATH_CMD.jpg 625w, https:\/\/www.davincivirus.com\/wp-content\/uploads\/2021\/11\/PATH_CMD-300x75.jpg 300w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/figure><\/div>\n\n\n\n<h2>Exploitation<\/h2>\n\n\n\n<p>DLL hijacking is a technique that exploits insecure an insecure PATH.  An attacker initially scours system directories in search of write access to a relevant folder.  Upon discover, a maliciously crafted DLL will be uploaded to usurp a trusted DLL.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"934\" height=\"474\" src=\"https:\/\/www.davincivirus.com\/wp-content\/uploads\/2021\/11\/DLL_Hijacking.jpg\" alt=\"\" class=\"wp-image-205\" srcset=\"https:\/\/www.davincivirus.com\/wp-content\/uploads\/2021\/11\/DLL_Hijacking.jpg 934w, https:\/\/www.davincivirus.com\/wp-content\/uploads\/2021\/11\/DLL_Hijacking-300x152.jpg 300w, https:\/\/www.davincivirus.com\/wp-content\/uploads\/2021\/11\/DLL_Hijacking-768x390.jpg 768w\" sizes=\"(max-width: 934px) 100vw, 934px\" \/><\/figure>\n\n\n\n<p>The DLL hijacking process is exponentially simplified when DLLs are missing on the target system; as the OS will scour each directory in the PATH.  This scenario predictably unfolds in older version of Microsoft Windows (Vista, 7, and 8) with the wlbsctrl.dll.  Newer versions of Windows have a similarly predictable issue with the &#8220;schedule&#8221; service WptsExtensions.dll.<\/p>\n\n\n\n<h2>Remediation<\/h2>\n\n\n\n<p>Write-access should be heavily restricted to all directories in the standard search order; the application&#8217;s startup folder and all folders itemized in the PATH variable.  Application source code should also depict the full path for supporting files whenever technically feasible.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The &#8220;standard search order&#8221; is a list of directories that an operating system iterates through to locate supporting files. An&hellip; <a class=\"read-more\" href=\"https:\/\/www.davincivirus.com\/?p=202\">Continue Reading<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[9],"tags":[],"_links":{"self":[{"href":"https:\/\/www.davincivirus.com\/index.php?rest_route=\/wp\/v2\/posts\/202"}],"collection":[{"href":"https:\/\/www.davincivirus.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.davincivirus.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.davincivirus.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.davincivirus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=202"}],"version-history":[{"count":1,"href":"https:\/\/www.davincivirus.com\/index.php?rest_route=\/wp\/v2\/posts\/202\/revisions"}],"predecessor-version":[{"id":206,"href":"https:\/\/www.davincivirus.com\/index.php?rest_route=\/wp\/v2\/posts\/202\/revisions\/206"}],"wp:attachment":[{"href":"https:\/\/www.davincivirus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=202"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.davincivirus.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=202"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.davincivirus.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=202"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}