{"id":9201,"date":"2019-04-02T02:02:40","date_gmt":"2019-04-02T00:02:40","guid":{"rendered":"http:\/\/159.69.82.204\/win\/?p=9201"},"modified":"2024-07-26T17:33:07","modified_gmt":"2024-07-26T15:33:07","slug":"security-windows-spoofing-via-reg-files","status":"publish","type":"post","link":"https:\/\/borncity.com\/win\/2019\/04\/02\/security-windows-spoofing-via-reg-files\/","title":{"rendered":"Security: Windows-Spoofing via .reg files"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" style=\"float: left; margin: 0px 10px 0px 0px; display: inline;\" src=\"https:\/\/www.borncity.com\/blog\/wp-content\/uploads\/2015\/01\/Schutz.jpg\" width=\"40\" height=\"47\" align=\"left\" \/>[<a href=\"https:\/\/www.borncity.com\/blog\/2019\/04\/02\/windows-spoofing-ber-reg-dateien\/\" target=\"_blank\" rel=\"noopener noreferrer\">German<\/a>]Windows users can be spoofed into importing<em> .reg<\/em> files, as I just verified. You can send manipulated messages to the user via the dialog box shown before a <em>.reg<\/em> file is imported.<\/p>\n<p><!--more--><\/p>\n<h2>What is it about?<\/h2>\n<p>.reg files are small text files, that can be created and saved with an editor. The files may contain commands to set or delete entries in the registry. In Windows such <em>.reg <\/em>files may be imported using the Windows registry editor <em>regedit.exe. <\/em>This allows you to import the contents of a <em>.reg<\/em> file by double-clicking on it.<\/p>\n<p><img decoding=\"async\" title=\".reg file import warning\" src=\"https:\/\/i.imgur.com\/nZab3Dx.jpg\" alt=\".reg file import warning\" \/><\/p>\n<p>Then the dialog box shown above will be displayed to warn the user about the import of the <em>.reg<\/em> file. And the user have to agree to the import via the <em>Yes<\/em> button. For certain keys,\u00a0 also administrative rights are necessary for the import. So the Registry Editor must request increased rights via the User Account Control.<\/p>\n<h2>Spoofing the import dialog box<\/h2>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Spoofing_attack\" target=\"_blank\" rel=\"noopener noreferrer\">Spoofing<\/a>\u00a0 is a situation in which a person or program successfully masquerades as another by falsifying data, to gain an illegitimate advantage. Security researcher John Page (aka hyp3rlinx) has now <a href=\"https:\/\/seclists.org\/fulldisclosure\/2019\/Mar\/21\" target=\"_blank\" rel=\"noopener noreferrer\">discovered<\/a> that the registry editor <em>regedit.exe<\/em> can be used to create a<em> .reg<\/em> file with a specially designed filename. This file name can be used to manipulate the text shown within the displayed dialog box.<\/p>\n<p><img decoding=\"async\" title=\"manipulierted .reg file import warning\" src=\"https:\/\/i.imgur.com\/Z6t24Co.jpg\" alt=\"manipulierted .reg file import warning\" \/><\/p>\n<p>The above dialog shows a manipulated text message when importing a <em>.reg<\/em> file. Text parts of the original message were simply suppressed.\u00a0 Using such a manipulated message, attackers could trick inexperienced users to click the <em>Yes <\/em>button to import a <em>.reg<\/em> file containing dangerous content. In addition, Windows 10 seems to offer the ability to suppress the display of the second status dialog box, which indicates that an import was successful.<\/p>\n<h2>Spoofing attacks<\/h2>\n<p>To delete the default text displayed and display your own text in the dialog box, you can use %-encoded characters such as %n or %r and %0 in the <em>.reg<\/em> file name. For example, the text passages \"Do not trust &#8230;\" and \"Do you want to continue?\" shown within the default warning messages can be removed by using %0 characters.<\/p>\n<p>Normally, after a successful import, the Registry Editor opens another window with a corresponding status message. This can be suppressed by inserting a (zero) value directly before the dot at the end of the file name. This can be achieved with %1 or %25. The file name:<\/p>\n<p>\"Microsoft-Security-Update v1.2-Windows-10.r%e%g%r%nC%l%i%c%k%b%Y%e%s%b%b%b%b%1%0.reg\"<\/p>\n<p>not only suppresses the second status window that displays the successful import. It also creates a dialog box with the manipulated test shown above in the display. Here is a list of characters that can be used for manipulation.<\/p>\n<ul>\n<li>% &#8211; can be used for obfuscation e.g. %h%a%t%e = hate<\/li>\n<li>%b will create white-space<\/li>\n<li>%n makes a newline<\/li>\n<li>%r makes a newline<\/li>\n<li>%1 creates (null) &#8211; important as we prevent the second registry dialog from<br \/>\nappearing after a successful import!<\/li>\n<li>%0 Important terminates string<\/li>\n<li>%25 (Windows 10) creates (null) &#8211; Important as we prevent the second<br \/>\nregistry dialog from appearing after a successful import!<\/li>\n<li>%3 &#8211; Important as we prevent the second registry dialog from appearing<br \/>\nafter a successful import! (but shows asian char)<\/li>\n<li>%5 (Windows 10) duplicates the default registry dialog box message by \"n\"<br \/>\namount of times per amount of %5 injected into the filename<\/li>\n<li>%25 (Windows 7) duplicates the default registry dialog box message by \"n\"<br \/>\namount of times per amount of %25 injected into the filename<\/li>\n<li>%2525 prevents registry editor from opening<\/li>\n<li>%169 will show our junky filename in the dialog box (we don't want that)<\/li>\n<li>%3, %197, %17 and some others change the default language shown in the<br \/>\nregistry dialog box to asian characters etc.<\/li>\n<\/ul>\n<p>The security researcher describes the details and some attacks on <a href=\"https:\/\/seclists.org\/fulldisclosure\/2019\/Mar\/21\" target=\"_blank\" rel=\"noopener noreferrer\">Seclists.org<\/a>, and and has also published there the above list with characters for the manipulating the dialog box message. Below is a video demonstrating such a spoofing attack.<\/p>\n<p><a href=\"https:\/\/vimeo.com\/322684636\">Windows .Reg File Dialog Box Spoofing 0day<\/a> from <a href=\"https:\/\/vimeo.com\/user43117749\">hyp3rlinx<\/a> on <a href=\"https:\/\/vimeo.com\">Vimeo<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[German]Windows users can be spoofed into importing .reg files, as I just verified. You can send manipulated messages to the user via the dialog box shown before a .reg file is imported.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[580,2],"tags":[69,194],"class_list":["post-9201","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\/9201","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=9201"}],"version-history":[{"count":1,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/posts\/9201\/revisions"}],"predecessor-version":[{"id":34629,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/posts\/9201\/revisions\/34629"}],"wp:attachment":[{"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/media?parent=9201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/categories?post=9201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/tags?post=9201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}