{"id":22806,"date":"2022-01-04T00:11:00","date_gmt":"2022-01-03T23:11:00","guid":{"rendered":"http:\/\/159.69.82.204\/win\/?p=22806"},"modified":"2022-01-04T22:46:11","modified_gmt":"2022-01-04T21:46:11","slug":"sicherheit-windows-format-befehl-ermglicht-dll-loading-missbrauch","status":"publish","type":"post","link":"https:\/\/borncity.com\/win\/2022\/01\/04\/sicherheit-windows-format-befehl-ermglicht-dll-loading-missbrauch\/","title":{"rendered":"Security: Windows Format command allows DLL loading abuse"},"content":{"rendered":"<p><img decoding=\"async\" style=\"float: left; margin: 0px 10px 0px 0px; display: inline;\" title=\"Sicherheit (Pexels, allgemeine Nutzung)\" src=\"https:\/\/www.borncity.com\/blog\/wp-content\/uploads\/2021\/04\/Sicherheit_klein.jpg\" alt=\"Sicherheit (Pexels, allgemeine Nutzung)\" width=\"200\" \/>[<a href=\"https:\/\/www.borncity.com\/blog\/?p=261114\" target=\"_blank\" rel=\"noopener\">German<\/a>]It is almost unbelievable what can be hidden behind Windows functions and commands. The format command for formatting disks, which has been available in the command prompt for ages, has a side effect. With a parameter the call of an arbitrary DLL can be forced, which is then loaded from the search path. I could hardly believe this when it was brought to my attention.<\/p>\n<p><!--more--><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/vg09.met.vgwort.de\/na\/1fb340423ce14f178bea614ef5283a26\" alt=\"\" width=\"1\" height=\"1\" \/>The facts came to my attention from Grzegorz Tworek on Twitter in a <a href=\"https:\/\/twitter.com\/0gtweet\/status\/1477925112561209344\" target=\"_blank\" rel=\"noopener\">short post<\/a>. The statement in the following tweet is: If you specify the name of any DLLs with a preceding letter U at the parameter \/FS in the command line, the DLL is loaded from the search path.<\/p>\n<p><a href=\"https:\/\/twitter.com\/0gtweet\/status\/1477925112561209344\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" title=\"Abusing Format for DLL load\" src=\"https:\/\/i.imgur.com\/KjMVVx0.png\" alt=\"Abusing Format for DLL load\" \/><\/a><\/p>\n<p>The DOS format command allows various parameters which are described in <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows-server\/administration\/windows-commands\/format\" target=\"_blank\" rel=\"noopener\">this Microsoft document<\/a>. With the switch \/FS:filesystem the desired file system can be specified. According to Microsoft, the following file systems can be specified for formatting via the switch: FAT, FAT32, NTFS, exFAT, ReFS, or UDF.<\/p>\n<p>Grzegorz Tworek has now noticed that there is an undocumented possibility, over which theoretically arbitrary file systems can be used when formatting. Only an appropriate DLL must be present, which takes over the formatting. As parameter for \/FS then the name of this DLL with a prefix U is to be indicated. A command line of the type:<\/p>\n<p>format I: \/fs:MyDll.dll<\/p>\n<p>would then load the library file <em>U<\/em><em>MyDll.<\/em>dll and cause it to be listed. This DLL is then executed in the search path, i.e. the program folder and other folders. Grzegorz Tworek has demonstrated this on his own DLL called <em>Pwning.dll<\/em>, which then displays a message box with the word Pwned! There are certainly a few ways in which this can be abused.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[German]It is almost unbelievable what can be hidden behind Windows functions and commands. The format command for formatting disks, which has been available in the command prompt for ages, has a side effect. With a parameter the call of an &hellip; <a href=\"https:\/\/borncity.com\/win\/2022\/01\/04\/sicherheit-windows-format-befehl-ermglicht-dll-loading-missbrauch\/\">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-22806","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\/22806","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=22806"}],"version-history":[{"count":0,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/posts\/22806\/revisions"}],"wp:attachment":[{"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/media?parent=22806"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/categories?post=22806"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/tags?post=22806"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}