{"id":6986,"date":"2020-03-04T00:02:25","date_gmt":"2020-03-04T00:02:25","guid":{"rendered":"http:\/\/www.hexacorn.com\/blog\/?p=6986"},"modified":"2020-03-04T00:06:14","modified_gmt":"2020-03-04T00:06:14","slug":"beyond-good-ol-run-key-part-124","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2020\/03\/04\/beyond-good-ol-run-key-part-124\/","title":{"rendered":"Beyond good ol\u2019 Run key, Part 124"},"content":{"rendered":"\n<p>Most of persistence tricks rely on a modification of Registry, adding files, dropping phantom DLLs, lolbins, etc. Today (for a change), I will describe a trick that is a) a close relative of Office macros &amp; b) introduces yet another file format that security product may need to learn to scan.<\/p>\n\n\n\n<p>The target is Ultraedit &#8211; pretty much my favorite editor.<\/p>\n\n\n\n<p>It supports a lot of different mechanisms that could be used for persistence and trickery, but I will describe only one which meets the criteria I specified above.<\/p>\n\n\n\n<p>The editor supports a mechanism of macros. Macros can be easily edited using a dedicated Macro panel. While the commands are primarily editing-related, there is one command that is interesting to us &#8211; RunTool:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2020\/03\/ue_1.png\"><img decoding=\"async\" loading=\"lazy\" width=\"548\" height=\"459\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2020\/03\/ue_1.png\" alt=\"\" class=\"wp-image-6987\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2020\/03\/ue_1.png 548w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2020\/03\/ue_1-300x251.png 300w\" sizes=\"(max-width: 548px) 100vw, 548px\" \/><\/a><\/figure><\/div>\n\n\n\n<p>The macro on the screenshot is called &#8216;foo&#8217; and runs a tool called &#8216;notepad&#8217;. What is the &#8216;notepad&#8217; tool you may ask? It is actually not the Windows Notepad, but a reference to a task one can set up in UE Tool Configuration panel:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2020\/03\/ue_2.png\"><img decoding=\"async\" loading=\"lazy\" width=\"516\" height=\"423\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2020\/03\/ue_2.png\" alt=\"\" class=\"wp-image-6988\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2020\/03\/ue_2.png 516w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2020\/03\/ue_2-300x246.png 300w\" sizes=\"(max-width: 516px) 100vw, 516px\" \/><\/a><\/figure><\/div>\n\n\n\n<p>Not surprisingly, I set it up to actually execute c:\\windows\\system32\\notepad.exe.<\/p>\n\n\n\n<p>Okay, now we have a macro that runs our task called &#8216;notepad&#8217; and that task in turn runs the actual Windows Notepad.<\/p>\n\n\n\n<p>We can save our macro to a .mac file which is using a proprietary format:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"631\" height=\"84\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2020\/03\/ue_3.png\" alt=\"\" class=\"wp-image-6989\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2020\/03\/ue_3.png 631w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2020\/03\/ue_3-300x40.png 300w\" sizes=\"(max-width: 631px) 100vw, 631px\" \/><\/figure><\/div>\n\n\n\n<p>And now we are ready for a final piece of a puzzle&#8230;<\/p>\n\n\n\n<p>UE allows us to automatically set macros to run during startup (via command line):<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2020\/03\/ue_5.png\"><img decoding=\"async\" loading=\"lazy\" width=\"340\" height=\"258\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2020\/03\/ue_5.png\" alt=\"\" class=\"wp-image-6991\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2020\/03\/ue_5.png 340w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2020\/03\/ue_5-300x228.png 300w\" sizes=\"(max-width: 340px) 100vw, 340px\" \/><\/a><\/figure><\/div>\n\n\n\n<p> as well as during load and save file events (works in GUI): <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2020\/03\/ue_4.png\"><img decoding=\"async\" loading=\"lazy\" width=\"340\" height=\"242\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2020\/03\/ue_4.png\" alt=\"\" class=\"wp-image-6990\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2020\/03\/ue_4.png 340w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2020\/03\/ue_4-300x214.png 300w\" sizes=\"(max-width: 340px) 100vw, 340px\" \/><\/a><\/figure><\/div>\n\n\n\n<p>With all that in place&#8230; Notepad will be running a lot&#8230; perhaps as a celebration of these events. <\/p>\n\n\n\n<p>Feels like Office macros &#8211; tick. Proprietary file format &#8211; tock. <\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most of persistence tricks rely on a modification of Registry, adding files, dropping phantom DLLs, lolbins, etc. Today (for a change), I will describe a trick that is a) a close relative of Office macros &amp; b) introduces yet another &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2020\/03\/04\/beyond-good-ol-run-key-part-124\/\">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":[13,35],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/6986"}],"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=6986"}],"version-history":[{"count":8,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/6986\/revisions"}],"predecessor-version":[{"id":6999,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/6986\/revisions\/6999"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=6986"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=6986"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=6986"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}