Windows Library Files
Theory
Windows Library files (.library-ms files) are a virtual container for user content. It can be used to point to a remote or local storage location.
We may send this file by e-mail and use social engineering to get the recipient to open the container (it will appear as a normal directory in Windows Explorer) and then to double-click on our hosted payload to execute it.
By delivering our payload via a Windows Library File rather than directly sending a link directly to a remote server hosting our payload, we may avoid IDS/IPS/Anti-spam solutions.
When SearchConnectorDescription section of the library-ms file points to a remote location, it will force authentication through explorer when opening the container folder.
Practice
In this scenario, we'll create a .library-ms
file pointing to our WebDAV server that is hosting a malicious .lnk
file. The user will need to open both container and shortcut files to execute our payload.
First, let's create our malicious .lnk
shortcut using lnk.py (Python).
Then, start a WebDAV server to host our payload
We can now create our evil.library-ms
file with the following content
If you created this file on linux, we may need to change the text encoding as follow
We can now send the evil.library-ms file to the target !
Resources
Last updated