{"id":7176,"date":"2020-05-14T22:53:39","date_gmt":"2020-05-14T22:53:39","guid":{"rendered":"http:\/\/www.hexacorn.com\/blog\/?p=7176"},"modified":"2020-05-15T10:17:27","modified_gmt":"2020-05-15T10:17:27","slug":"new-code-injection-execution-marsh-mellow","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2020\/05\/14\/new-code-injection-execution-marsh-mellow\/","title":{"rendered":"New Code Injection\/Execution &#8211; Marsh&#8230;mellow"},"content":{"rendered":"\n<p>All righty&#8230; this is a cool one, because it&#8217;s so&#8230; vague.<\/p>\n\n\n\n<p>How do you describe a generic code execution technique without showing examples?<\/p>\n\n\n\n<p>You show le video&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"686\" height=\"364\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2020\/05\/marshmellow.gif\" alt=\"\" class=\"wp-image-7177\"\/><\/figure>\n\n\n\n<p>Then you explain that&#8230; any windows message above WM_USER is a potential code execution massacre. Yes. The GIF you looked at is just a simple example of enumerating all windows and their children, and then running a simple loop on all the windows handles. Each iteration of that loop sends a Window Message WM_USER (up to WM_USER+1000) to these windows owned by various processes.<\/p>\n\n\n\n<p>It sounds stupid but it&#8217;s not. It counter-marshals (pun intended) the whole system of windows message marshaling&#8230; <\/p>\n\n\n\n<p>Common controls use WM_USER+ messages. Custom controls use WM_USER+ messages. Every app is most likely using _some_ controls that are relying on WM_USER+ message. So yeah.. you just narrow this one down that allows you to swap content of a pointer of your choice and you have your code running inside another process user space.<\/p>\n\n\n\n<p>This is the most vague code injection post you will probably come across, but let me tell you this: it describes a whole class of shatter attacks that are either happening, or are going to happen.<\/p>\n\n\n\n<p>Hint: a good message to start playing with is <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/controls\/em-settextex\">EM_SETTEXTEX<\/a> (WM_USER+97).<\/p>\n\n\n\n<p>People pointing out Brett Moore&#8217;s work are absolutely right. The above idea is identical in principle, just generalized to cover the whole WM_USER spectrum (that includes custom messages that are application-specific &amp; may require per-app research which opens up a lot of pathways to custom code injections e.g. Nvidia, AMD, Intel, Dell etc. GUI applications that are always on).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>All righty&#8230; this is a cool one, because it&#8217;s so&#8230; vague. How do you describe a generic code execution technique without showing examples? You show le video&#8230; Then you explain that&#8230; any windows message above WM_USER is a potential code &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2020\/05\/14\/new-code-injection-execution-marsh-mellow\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[57],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/7176"}],"collection":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/comments?post=7176"}],"version-history":[{"count":6,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/7176\/revisions"}],"predecessor-version":[{"id":7185,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/7176\/revisions\/7185"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=7176"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=7176"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=7176"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}