{"id":5176,"date":"2018-07-21T00:22:30","date_gmt":"2018-07-21T00:22:30","guid":{"rendered":"http:\/\/www.hexacorn.com\/blog\/?p=5176"},"modified":"2018-07-21T01:10:30","modified_gmt":"2018-07-21T01:10:30","slug":"sysmon-doing-lines-part-5","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2018\/07\/21\/sysmon-doing-lines-part-5\/","title":{"rendered":"Sysmon doing lines, part 5"},"content":{"rendered":"<p>This is a lame, cute, not-only-sysmon evasion that is not really an evasion, but more a social engineering trick &#8211; still, it may fool some junior analysts&#8230;<\/p>\n<p>As I mentioned in my <a href=\"https:\/\/www.hexacorn.com\/blog\/2018\/06\/25\/url-schemes-in-win-10\/\">older post<\/a>, there are tones of URL Schemes available in Win10. When you look at them, you will most likely think that anyone using them will always use the &#8216;start&#8217; command, or the &#8216;ShellExecute*&#8217; APIs.<\/p>\n<p>And that&#8217;s the opportunity.<\/p>\n<p>If you write a launcher that leverages these built-in, very well known schemes e.g. &#8216;ms-settings:defaultapps&#8217; to create a dummy &#8216;host&#8217; file (e.g. &#8216;ms-settings&#8217;) with the ADS attached to it called according to the second part of the URL Scheme (e.g. &#8216;defaultapps&#8217;), you will be able to launch &#8216;ms-settings:defaultapps&#8217;\u00a0 that is actually not a protocol, but a real PE file.<\/p>\n<p>Let&#8217;s have a look at an example:<\/p>\n<pre>copy notepad.exe ms-settings\r\ntype &lt;yourexe&gt; &gt; ms-settings:defaultapps<\/pre>\n<p>This will create a copy of a legitimate (and signed) notepad.exe called &#8216;ms-settings&#8217; and will append the ADS &#8216;ms-settings:defaultapps&#8217; that is acting as an actual payload.<\/p>\n<p>All you have to do is to launch it not via ShellExec, but directly via CreateProcess, and if you place the .exe in a &#8216;strategically named&#8217; folder you may end up with a sysmon log like this:<\/p>\n<p><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2018\/07\/URLScheme_ADS1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-5178\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2018\/07\/URLScheme_ADS1.png\" alt=\"\" width=\"364\" height=\"259\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2018\/07\/URLScheme_ADS1.png 364w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2018\/07\/URLScheme_ADS1-300x213.png 300w\" sizes=\"(max-width: 364px) 100vw, 364px\" \/><\/a>Now&#8230; show me a junior analyst that won&#8217;t conclude it&#8217;s just one of the safe URL Schemes&#8230; because&#8230;\u00a0 the first result for &#8216;ms-settings:defaultapps&#8217; in Google is <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/uwp\/launch-resume\/launch-settings-app\">this<\/a>.<\/p>\n<p>They may even test it on their systems &#8211; launching &#8216;ms-settings:defaultapps&#8217; from a command line will bring this innocent window:<\/p>\n<p><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2018\/07\/URLScheme_ADS0.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-5185\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2018\/07\/URLScheme_ADS0.png\" alt=\"\" width=\"500\" height=\"300\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2018\/07\/URLScheme_ADS0.png 865w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2018\/07\/URLScheme_ADS0-300x180.png 300w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2018\/07\/URLScheme_ADS0-768x461.png 768w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a>A simple launcher that you can use for test can be downloaded from <a href=\"https:\/\/hexacorn.com\/examples\/2018-07-21_test.exe\">here<\/a>. It simply launches &#8216;ms-settings:defaultapps&#8217; ADS in its current directory.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a lame, cute, not-only-sysmon evasion that is not really an evasion, but more a social engineering trick &#8211; still, it may fool some junior analysts&#8230; As I mentioned in my older post, there are tones of URL Schemes &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2018\/07\/21\/sysmon-doing-lines-part-5\/\">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":[43,13,52,19,46,9],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/5176"}],"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=5176"}],"version-history":[{"count":9,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/5176\/revisions"}],"predecessor-version":[{"id":5188,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/5176\/revisions\/5188"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=5176"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=5176"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=5176"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}