{"id":32159,"date":"2023-11-01T00:04:14","date_gmt":"2023-10-31T23:04:14","guid":{"rendered":"http:\/\/159.69.82.204\/win\/?p=32159"},"modified":"2023-10-31T05:03:28","modified_gmt":"2023-10-31T04:03:28","slug":"lolbin-with-workfolders-exe-under-windows","status":"publish","type":"post","link":"https:\/\/borncity.com\/win\/2023\/11\/01\/lolbin-with-workfolders-exe-under-windows\/","title":{"rendered":"LOLBin with WorkFolders.exe under Windows"},"content":{"rendered":"<p><img decoding=\"async\" style=\"float: left; margin: 0px 10px 0px 0px; display: inline;\" title=\"Windows\" src=\"https:\/\/www.borncity.com\/blog\/wp-content\/uploads\/2021\/04\/Windows-klein.jpg\" alt=\"Windows\" width=\"200\" \/>[<a href=\"https:\/\/www.borncity.com\/blog\/2023\/10\/24\/lolbin-mit-workfolders-exe-unter-windows\/\" target=\"_blank\" rel=\"noopener\">German<\/a>]I do not know if it's widely known, but the legitimate Windows application WorkFolders.exe can be used to launch other .exe programs in the Windows System32 folder or the current folder. This allows malware to launch so-called LOLBin attacks, where legitimate operating system files are misused to execute malicious programs. WorkFolders.exe can be abused as a RunDLL substitute.<\/p>\n<p><!--more--><\/p>\n<h2>LOLBin, a brief insight<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/vg05.met.vgwort.de\/na\/428607cabec845159aa89c757a1c3198\" alt=\"\" width=\"1\" height=\"1\" \/>The acronym LOL stands for \"living off the land,\" a term coined by malware researchers Christopher Campbell and Matt Greaber to explain the use of trusted, pre-installed system tools to spread malware. This <a href=\"https:\/\/www.cynet.com\/attack-techniques-hands-on\/what-are-lolbins-and-how-do-attackers-use-them-in-fileless-attacks\/\" target=\"_blank\" rel=\"noopener\">Cynet page<\/a> explains that there are different types of LOL techniques. Among them are so-called LOLBins, which use Windows binaries to hide malicious activities. LOLLibs use libraries, and LOLScripts use scripts to execute malware. Kaspersky has listed the most popular LOLBins in<a href=\"https:\/\/www.kaspersky.de\/blog\/most-used-lolbins\/27489\/\" target=\"_blank\" rel=\"noopener\"> this article<\/a>. And there is a <a href=\"https:\/\/github.com\/LOLBAS-Project\/LOLBAS\" target=\"_blank\" rel=\"noopener\">GitHub project<\/a> that aims to document every binary, library and script that can be abused for LOL techniques.<\/p>\n<h2>What does WorkFolders.exe do?<\/h2>\n<p>There is a executable file called <em>WorkFolders.exe <\/em>included in the <em>System32<\/em> subfolder of Windows. It is a legitimate Windows application and the .exe file can be seen in the screenshot below in the Windows folder in question.<\/p>\n<p><img decoding=\"async\" title=\"WorkFolders.exe \" src=\"https:\/\/www.borncity.com\/blog\/wp-content\/uploads\/2023\/10\/image-9.png\" alt=\"WorkFolders.exe \" \/><\/p>\n<p>If you call this program file, the Working Folders window appears to manage these working folders in Windows (see the following screenshot of a German Windows 10). The text indicates that in the dialog you can manage the working folders to make \"online\" working files available on all devices used, even if you are offline.<\/p>\n<p><img decoding=\"async\" title=\"WorkFolders.exe dialog\" src=\"https:\/\/www.borncity.com\/blog\/wp-content\/uploads\/2023\/10\/image-10.png\" alt=\"WorkFolders.exe dialog\" \/><\/p>\n<p>Microsoft explains <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows-server\/storage\/work-folders\/work-folders-overview\" target=\"_blank\" rel=\"noopener\">here<\/a>, that Work Folders is a Windows Server role service for file servers, and provides users with a consistent way to access work files from PCs and devices. With Work Folders, users are supposed to be able to store and access their work files not only on company PCs, but also on personal computers and devices, often referred to as bring-your-own-device (BYOD).<\/p>\n<p>Users should have a convenient place to store work files and can access them from anywhere. Organizations use Work Folders to maintain control over corporate data. They can store files on centrally managed file servers and set policies for user devices such as encryption and screen lock passwords. The service is available on Windows 11, Windows 10, Windows Server 2022, Windows Server 2019 and Windows Server 2016.<\/p>\n<h2>LOLBin with WorkFolders.exe<\/h2>\n<p>A few dasy ago I came across the following tweet, which left me quite pensive. Elliot shows how the <em>WorkFolders.exe<\/em> program file can be misused to call other program files.<\/p>\n<p><a href=\"https:\/\/twitter.com\/ElliotKillick\/status\/1449812843772227588\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" title=\"LOLBin with WorkFolders.exe\" src=\"https:\/\/i.postimg.cc\/2jsK6hTc\/image.png\" alt=\"LOLBin with WorkFolders.exe\" \/><\/a><\/p>\n<p>In his test scenario, he copies <em>calc.exe<\/em> as <em>control.exe<\/em> from the Windows <em>System32<\/em> folder to a local folder and then calls <em>WorkFolders.exe<\/em>. The animation then shows that instead of the <em>Manage Working Folders<\/em> dialog box, Windows calc opens. The trick is to simply rename the \"target data\" in question to <em>control.exe<\/em>.<\/p>\n<p>I then ran a test of my own and instead of using the Windows folder <em>Shell32<\/em> as the target, I saved a copy of the file <em>calc.exe<\/em> as <em>control.exe <\/em>under my user account in the profile folder <em>Downloads\/Test<\/em>.<\/p>\n<p>Then I entered the <em>workfolders.exe<\/em> command in a PowerShell console. Windows\u00a0 calc was also called (because the search for the .exe is done via the preset path from the above profile folder to the Windows folders) &#8211; with the program <em>notepad.exe<\/em> my short test did not work.<\/p>\n<p><a href=\"https:\/\/www.borncity.com\/blog\/wp-content\/uploads\/2023\/10\/image-12.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" title=\"Calc permissions\" src=\"https:\/\/www.borncity.com\/blog\/wp-content\/uploads\/2023\/10\/image-12.png\" alt=\"Calc permissions\" width=\"617\" height=\"653\" \/><\/a><\/p>\n<p>Subsequently, I used <em>accessschk.exe<\/em> from the Sysinternals tools to view the permissions of the calc.exe process in question. If I am not completely misinterpreting, an increase in permissions still requires approval via User Account Control. But the situation may allow the launch of malware by chaining other applications, without security software possibly not noticing &#8211; because they trust <em>workfolders.exe<\/em>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[German]I do not know if it's widely known, but the legitimate Windows application WorkFolders.exe can be used to launch other .exe programs in the Windows System32 folder or the current folder. This allows malware to launch so-called LOLBin attacks, where &hellip; <a href=\"https:\/\/borncity.com\/win\/2023\/11\/01\/lolbin-with-workfolders-exe-under-windows\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[580,2],"tags":[69,194],"class_list":["post-32159","post","type-post","status-publish","format-standard","hentry","category-security","category-windows","tag-security","tag-windows"],"_links":{"self":[{"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/posts\/32159","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/comments?post=32159"}],"version-history":[{"count":0,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/posts\/32159\/revisions"}],"wp:attachment":[{"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/media?parent=32159"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/categories?post=32159"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/tags?post=32159"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}