{"id":6329,"date":"2019-05-22T23:19:50","date_gmt":"2019-05-22T23:19:50","guid":{"rendered":"http:\/\/www.hexacorn.com\/blog\/?p=6329"},"modified":"2019-06-12T22:13:35","modified_gmt":"2019-06-12T22:13:35","slug":"vs2005_vcredist_x86-exe-as-a-lolbin","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2019\/05\/22\/vs2005_vcredist_x86-exe-as-a-lolbin\/","title":{"rendered":"VS2005_vcredist_x86.exe as a LOLBIN"},"content":{"rendered":"\n<p>This is a completely random find. I was installing this old package on a test system, and out of habit checked if it takes any command line arguments. It actually does:<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/05\/vcredist2005.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/05\/vcredist2005.png\" alt=\"\" class=\"wp-image-6330\" width=\"317\" height=\"198\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/05\/vcredist2005.png 423w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/05\/vcredist2005-300x187.png 300w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/05\/vcredist2005-80x50.png 80w\" sizes=\"(max-width: 317px) 100vw, 317px\" \/><\/a><\/figure>\n\n\n\n<p>This is too good to be true. Guess what happens when you run:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">VS2005_vcredist_x86.exe \/q \/c:c:\\windows\\system32\\calc.exe<\/pre>\n\n\n\n<p>btw. it doesn&#8217;t work for newer ones:<\/p>\n\n\n\n<ul><li>VS2008_vcredist_x86.exe<\/li><li>VS2010_vcredist_x86.exe<\/li><li>VS2013_vcredist_x86.exe<\/li><\/ul>\n\n\n\n<p>There may be some possibilities for VS2010_vcredist_x86.exe as it takes a lot of different command line arguments:<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/05\/vcredist2010.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/05\/vcredist2010.png\" alt=\"\" class=\"wp-image-6332\" width=\"365\" height=\"614\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/05\/vcredist2010.png 486w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2019\/05\/vcredist2010-178x300.png 178w\" sizes=\"(max-width: 365px) 100vw, 365px\" \/><\/a><\/figure>\n\n\n\n<p>To be precise, these options are actually taken by setup.exe after the VS2010_vcredist_x86.exe unpacks files to c:\\&lt;random hex&gt; folder.<\/p>\n\n\n\n<p>Just a quick code review of various versions of redistributable installers immediately highlights plenty of ideas for sideloading as well e.g. signed install.exe from VS2008_vcredist_x86.exe loads one of the language-specific resource DLLs placed in the same directory via LoadLibrary, hence they can be swapped with a payload DLL:<\/p>\n\n\n\n<ul><li>install.res.1028.dll<\/li><li>install.res.1031.dll<\/li><li>install.res.1033.dll<\/li><li>install.res.1036.dll<\/li><li>install.res.1040.dll<\/li><li>install.res.1041.dll<\/li><li>install.res.1042.dll<\/li><li>install.res.2052.dll<\/li><li>install.res.3082.dll<\/li><\/ul>\n\n\n\n<p>And last update: it turns out that VS2005_vcredist_x86.exe was packaged with IExpress Setup, so any installer from that era created with iexpress.exe should have a lolbin functionality.<\/p>\n\n\n\n<p><strong>Update<\/strong><\/p>\n\n\n\n<p>After I posted this piece Stefan Kanthak pointed me to his <a href=\"http:\/\/seclists.org\/fulldisclosure\/2015\/Sep\/21\">older research<\/a> from 2015 that actually describes the very same issue + discussed the UAC bypass that can be achieved via this method as well. Nice work!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a completely random find. I was installing this old package on a test system, and out of habit checked if it takes any command line arguments. It actually does: This is too good to be true. Guess what &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2019\/05\/22\/vs2005_vcredist_x86-exe-as-a-lolbin\/\">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":[56,64],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/6329"}],"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=6329"}],"version-history":[{"count":9,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/6329\/revisions"}],"predecessor-version":[{"id":6439,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/6329\/revisions\/6439"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=6329"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=6329"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=6329"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}