{"id":6303,"date":"2019-05-11T00:06:51","date_gmt":"2019-05-11T00:06:51","guid":{"rendered":"http:\/\/www.hexacorn.com\/blog\/?p=6303"},"modified":"2019-05-11T00:38:47","modified_gmt":"2019-05-11T00:38:47","slug":"old-hotfix-files-sfx-cab-dfir-artifacts","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2019\/05\/11\/old-hotfix-files-sfx-cab-dfir-artifacts\/","title":{"rendered":"Old HotFix files + SFX CAB + DFIR artifacts"},"content":{"rendered":"\n<p>I don&#8217;t have much to say in this post, but since I looked at a sample file for a few minutes, it&#8217;s good to earn some brownie points by just describing what I have observed. Especially that quick google search returned nothing on the topics I want to cover here &#8212; who knows, maybe one day it will be helpful to someone&#8230; + there are some pointers for further research anyway.<\/p>\n\n\n\n<p>The file I looked at is a very old (2003!) signed hotfix installer from Microsoft.  I got curious about these, because they are very old, and signed, hence a possible target for a good LOLBIN. <\/p>\n\n\n\n<p>Why? <\/p>\n\n\n\n<p>These Hotfixes were coded in ancient times, the modern security assumptions and considerations were simply not there, and it&#8217;s a possible goldmine for new, interesting ideas of Bring Your Own LOLBIN or Bring Your Own Vulnerability type of scenarios. <\/p>\n\n\n\n<p>As it is usually the case, my attention eventually got diverted and instead of looking at LOLBIN-ability of the file, I just started browsing the code and was pleasantly surprised with some quick &amp; imho interesting DFIRCE findings. Some of these could be actually handy to me ~10 years ago. <\/p>\n\n\n\n<p>Things observed are described below.<\/p>\n\n\n\n<p>If you see a &lt;drive&gt;:\\[hexdigits] folder during your exam, it is a high chance it is from a Hotfix\/Update. When the SFXCAB-based Hotfix\/Update is executed it just drops the installation files there f.ex.:<\/p>\n\n\n\n<ul><li>c:\\[hexdigits]\\$shtdwn$.req<\/li><li> c:\\[hexdigits]\\update\\eula.txt<\/li><li> c:\\[hexdigits]\\portcls.sys<\/li><li> c:\\[hexdigits]\\update\\q816650.cat<\/li><li> c:\\[hexdigits]\\update\\spcustom.dll<\/li><li> c:\\[hexdigits]\\spmsg.dll<\/li><li> c:\\[hexdigits]\\spuninst.exe<\/li><li> c:\\[hexdigits]\\update\\update.exe<\/li><li> c:\\[hexdigits]\\update\\update.inf<\/li><li> c:\\[hexdigits]\\update\\update.ver<\/li><\/ul>\n\n\n\n<p>This is not unusual, but I have seen similar folders so many times that I need to make a quick comment here. The perverted interest of many Windows HotFix\/Update packages (including redistributables) to either use a temporary folder in the root directory of C:\\, or any other available drive really is something I still don&#8217;t fully understand. <\/p>\n\n\n\n<p>(<em>I remember deleting many of these on my own systems at the time I was still updating my OS in an automated fashion. I simply don&#8217;t trust auto-updates anymore and often end up testing updates to anything let it be OS or a browser on VM before I deploy it on my main system. It&#8217;s crazy. it shouldn&#8217;t be like this. But luckily this post is not about this<\/em>; This <a href=\"https:\/\/www.hexacorn.com\/blog\/2018\/07\/08\/requiem-for-the-infosec-of-90s-and-2000s\/\">one<\/a> is about it tho). <\/p>\n\n\n\n<p>Anyway&#8230; It goes against the old Microsoft mantra of using the %TEMP% directory for this purpose &#8211; user- or SYSTEM-based, depending on the need.  Oh well&#8230;<\/p>\n\n\n\n<p>The installer uses\/expects a number of very characteristically named environment variables which I have not seen described online before:<\/p>\n\n\n\n<ul><li>_SFX_CAB_SHUTDOWN_REQUEST<\/li><li>SP_UPDATE_LOG_CABBUILD<\/li><li>_HFM_EXE_PATH<\/li><li>SP_UPDATE_WARN_BEFORE_INSTALLING_FILES<\/li><li>_SFX_NoDefaultURL<\/li><li>_SFX_SourceFilesURL<\/li><\/ul>\n\n\n\n<p>and, mutexes:<\/p>\n\n\n\n<ul><li>Global\\ServicePackOrHotfix<\/li><\/ul>\n\n\n\n<p>Again, I couldn&#8217;t find much info about these online, and I was not too inclined to find out what they are, but&#8230; the _SFX_SourceFilesURL is an interesting one as it adds additional source URLs for the updater\/fixer to consider while it is patching the system. Who knows&#8230; maybe it is a nice LOLBIN possibility after all? Will need to play with it a bit more&#8230;<\/p>\n\n\n\n<p>Other interesting DFIR artifacts are various log files created by these packages:<\/p>\n\n\n\n<ul><li>repair\\setup.log<\/li><li> setup.log<\/li><li> svcpack.log<\/li><li> ~req~.log<\/li><li> ~rsp~.log<\/li><\/ul>\n\n\n\n<p>If you see these files on the examined system, you may now have a better way to understand where they come from.<\/p>\n\n\n\n<p>Finally, the hotfix programs accept standard command line arguments:<\/p>\n\n\n\n<ul><li>\/f  Forces other programs to close at shutdown.  <\/li><li>\/n  Does not back up files for removing hotfixes.  <\/li><li>\/z  Does not restart the computer after the installation is completed.  <\/li><li>\/q  Uses quiet mode; no user interaction is required.  <\/li><li>\/m  Uses unattended Setup mode (Windows 2000).  <\/li><li>\/u  Uses unattended Setup mode (Windows XP).  <\/li><li>\/l  Lists installed hotfixes.<\/li><\/ul>\n\n\n\n<p>&#8211; these don&#8217;t provide much additional info, but if you see these in a context of a hotfix\/update e.g. via EDR\/sysmon logs, then you can at least decipher their meaning and understand what the setup program is doing. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I don&#8217;t have much to say in this post, but since I looked at a sample file for a few minutes, it&#8217;s good to earn some brownie points by just describing what I have observed. Especially that quick google search &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2019\/05\/11\/old-hotfix-files-sfx-cab-dfir-artifacts\/\">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":[53,21,19,64],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/6303"}],"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=6303"}],"version-history":[{"count":6,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/6303\/revisions"}],"predecessor-version":[{"id":6309,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/6303\/revisions\/6309"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=6303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=6303"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=6303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}