<?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 Cormac Conlon on Medium]]></title>
        <description><![CDATA[Stories by Cormac Conlon on Medium]]></description>
        <link>https://medium.com/@coormac?source=rss-48ba9f718b24------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Cormac Conlon on Medium</title>
            <link>https://medium.com/@coormac?source=rss-48ba9f718b24------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 01:36:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@coormac/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[Edgecution — Teams Social Engineering Delivers Malicious Browser Extension and Python RAT]]></title>
            <link>https://medium.com/@coormac/edgecution-teams-social-engineering-delivers-malicious-browser-extension-and-python-rat-794afa9f6c36?source=rss-48ba9f718b24------2</link>
            <guid isPermaLink="false">https://medium.com/p/794afa9f6c36</guid>
            <dc:creator><![CDATA[Cormac Conlon]]></dc:creator>
            <pubDate>Fri, 07 Aug 2026 19:09:48 GMT</pubDate>
            <atom:updated>2026-08-19T23:54:04.036Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9GHNrzGSdkAeBx3uo1rIIg.png" /></figure><p>I recently came across a Microsoft Teams social engineering incident wherein an external threat actor posed themselves as a Data Engineer. The threat actor registered a domain under <strong>MailCorpEngineer[.]onmicrosoft[.]com</strong> and contacted end-users which subsequently resulted in a call being established with the victims, shortly followed by Quickassist.exe execution on a victim asset. The observed QuickAssist.exe execution provided the external actor with remote control over the victims machine.</p><p>Execution of Quickassist.exe triggered the download of three files: a renamed AutoHotkey executable <strong>set42963821.exe</strong>, a malicious script <strong>set42963821.ahk</strong>, and a malformed archive <strong>set42963821a</strong>.</p><p>Once launched, the renamed AutoHotkey binary executed the payload script, which repaired the corrupted header of <strong>set42963821a</strong> and unpacked its contents—a portable Python environment, a Python-based Remote Access Trojan <strong>native_host.py</strong> and a malicious browser extension.</p><p>It was noted that the malicious script <strong>set42963821.ahk </strong>extracts several browser extension components and registers <strong>native_host.py </strong>as part of a Native Messaging Host payload which allows execution every time the malicious browser extension is loaded, which is every time the user logs on, thanks to a scheduled task created by the malware.</p><h3>Indicators of Compromise:</h3><h4>Host Based Indicators (HBI):</h4><ul><li>set42963821.exe — a2a54b8abc476d7671d4de0771bb54bf5f2373d79ff6871d0ba6a62c3b88ae00</li><li>set42963821.ahk — 9db4d54fa78764fab9cb9fb55894cc5ec22908b814d58d852a91d50828bb2c23</li><li>set42963821.a — 985333d368ebdaf48fe42f12f0697ad5b71299a765629e3e1fa26436304949b4</li><li>native_host.py — 55fb55cf47f666010a1299f30e8dfc90791c7b4e05d3d0cba39e4a1de26256e2</li><li>background.js — 6f63b9e9bf4121065adc4f825e0a183ef4064569f9b02ca6f85fbe38d4266a42</li><li>com.guzptoacnojymk.api.json — 86792d0d6fd4668424fc1c8d12a2c53a09a99c389704508b9268f0408e6a4ba2</li><li>native_host.bat — 2d568658c80a1c33ca078ec7f69474a3511b6dac087b11834b89c8f9b76f8b02</li></ul><h4>Network Based Indicators (NBI):</h4><ul><li>hxxps://app5363[.]s3[.]us-east-1[.]amazonaws[.]com/patch.html</li><li>wss[:]//dmypzouyuf61w[.]cloudfront[.]net/ws</li></ul><h3>Investigation/Analysis:</h3><p>During a recent incident investigation, an external threat actor leveraged Microsoft Teams to social-engineer end-users while impersonating a Data Engineer. The attacker convinced victims to enter a live call and execute QuickAssist.exe, successfully establishing remote control over the compromised endpoints.</p><p>Following the QuickAssist execution, it was observed that the threat actor had navigated to their malicious infrastructure via Microsoft Edge, which was serving a fake ‘Outlook Updates Management Console’ hosted on <strong>hxxps://app5363[.]s3[.]us-east-1[.]amazonaws[.]com/patch.html.</strong></p><p>Interacting with the landing page’s hyperlinked boxes triggered the download of three primary payloads (<strong>set42963821.exe</strong>, <strong>set42963821.ahk</strong>, and <strong>set42963821.a</strong>). The <strong>Outlook Version Verification</strong> and <strong>OS Version Verification</strong> buttons displayed benign-looking version pop-ups and the <strong>Updates Registration</strong> button launched a fake login prompt used for credential harvesting:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hUjmbPcTDaRVuvSbg3MAXA.png" /><figcaption>Infrastructure Serving Malware/Credential Harvesting</figcaption></figure><p>Since I was able to gather the malicious files for analysis, lets move over to analysing <strong>set42963821.ahk.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RdyAOgKKO9PChX6v0mz7fA.png" /><figcaption>Malicious AHK Script Obfuscation</figcaption></figure><p>Opening <strong>set42963821.ahk</strong> in a code editor, we can see that the primary functionality is obfuscated using XOR encrypted integer values. The decryption routine works by taking an array of integer values, decrypting it with the hardcoded constant value of 89 and converting the result from charcode to build the ASCII string at runtime.</p><p>Once the integer values have been decrypted, understanding the functionality of the malware becomes a lot easier. For example, we can see that the malware creates the following paths:</p><ul><li>(“LOCALAPPDATA”) “\Microsoft\Edge\User Data\WorkspacesNavigation\TrustProtectExtension” “\extension”</li><li>(“LOCALAPPDATA”) “\Microsoft\Edge\User Data\WorkspacesNavigation\TrustProtectExtension” “\native”</li><li>(“LOCALAPPDATA”) “\Microsoft\Edge\User Data\WorkspacesNavigation\TrustProtectExtension” “\native” “\com.guzptoacnojymk.api”</li><li>(“LOCALAPPDATA”) “\Microsoft\Edge\User Data\WorkspacesNavigation\TrustProtectExtension” “\native” “\kwnbquabzqerfrrolmfrbpo.txt”</li><li>(“LOCALAPPDATA”) “\Microsoft\Edge\User Data\WorkspacesNavigation\TrustProtectExtension” “\native” “\native_host.bat”</li></ul><p>Next, <strong>set42963821.ahk</strong> communicates with the external URL <strong>hxxps[:]//app5363[.]s3[.]us-east-1[.]amazonaws[.]com/js/set42963821.a </strong>in order to download the malformed archive <strong>set42963821.a</strong>. Then the script executes a previously defined function to prepend the hexadecimal values 0x50 and 0x4B (PK header in ASCII) to the file header so that <strong>set42963821.a</strong> mimics a ZIP archive.</p><p>The newly formed archive file is then extracted to the directory <strong>Microsoft\Edge\User Data\WorkspacesNavigation\TrustProtectExtension </strong>using the tar utility with the hardcoded passphrase <strong>s2Tesy061OIJUuokcf1XaqRB3WpTYVNOAW64h. </strong>As part of its clean up, the zip archive is then deleted from disk.</p><p>It was then observed that the malware sets its working directory to the directory noted above and renames a number of randomized files to known browser extension components, along with renaming randomized directories:</p><pre>SetWorkingDir(EnvGet(&quot;LOCALAPPDATA&quot;) &quot;\Microsoft\Edge\User Data\WorkspacesNavigation\TrustProtectExtension&quot;)<br>SetWorkingDir(&quot;esleafme&quot;)<br>FileMove &quot;wdhonj.zil&quot;, &quot;background.js&quot;<br>FileMove &quot;xppkxcnrf.fuu&quot;, &quot;icon128.png&quot;<br>FileMove &quot;xtzld.gex&quot;, &quot;manifest.json&quot;<br>FileMove &quot;ieqjosmb.aat&quot;, &quot;popup.html&quot;<br>FileMove &quot;gamla.khr&quot;, &quot;popup.js&quot;<br>SetWorkingDir(&quot;..\rgaigvbreu&quot;)<br>FileMove &quot;wrrlge.nvm&quot;, &quot;native_host.py&quot;<br>SetWorkingDir(&quot;..&quot;)<br>FileMove &quot;tujdhgy.xiy&quot;, &quot;a.zip&quot;<br>DirMove &quot;esleafme&quot;, &quot;extension&quot;<br>DirMove &quot;rgaigvbreu&quot;, &quot;native&quot;</pre><p>The AHK script then extracts the embedded Python environment to the directory <strong>PROGRAMDATA\python-3.13.3. </strong>It was observed that the malware also creates and writes content to the file <strong>native_host.bat </strong>located in the directory <strong>Microsoft\Edge\User Data\WorkspacesNavigation\TrustProtectExtension\native\native_host.bat. </strong>The content of the .bat file was confirmed to be a launcher for the Python based RAT <strong>native_host.py.</strong></p><p>Next the malware writes the C2 URL <strong>wss[:]//dmypzouyuf61w[.]cloudfront[.]net/ws </strong>to a file located in the same directory as above <strong>\Microsoft\Edge\User Data\WorkspacesNavigation\TrustProtectExtension\native\kwnbquabzqerfrrolmfrbpo.txt.</strong></p><p>Lastly, the malware creates a Native Messaging Host Manifest file located in the same directory <strong>Microsoft\Edge\User Data\WorkspacesNavigation\TrustProtectExtension\native\com.guzptoacnojymk.api</strong> and writes the following data to it:</p><pre> <br>{<br>  &quot;name&quot;: &quot;com.guzptoacnojymk.api&quot;,<br>  &quot;description&quot;: &quot;Spam Fighter Extension Native Host&quot;,<br>  &quot;path&quot;: &quot;%LOCALAPPDATA%\\Microsoft\\Edge\\User Data\\WorkspacesNavigation\\TrustProtectExtension\\native\\native_host.bat&quot;,<br>  &quot;type&quot;: &quot;stdio&quot;,<br>  &quot;allowed_origins&quot;: [<br>    &quot;chrome-extension://aghgkclfhncibffcodcmggdmciakmhpi/&quot;<br>  ]<br>}</pre><p>The above data may indicate that the malicious browser extension will attempt to masquerade as ‘Spam Fighter Extension’. It was noted that the newly created manifest file is then added to the following registry key <strong>HKCU\Software\Microsoft\Edge\NativeMessagingHosts\com.guzptoacnojymk.api </strong>so that is is registered as a Native Messaging Host.</p><p>The malware then writes the value <strong>d798fc19171bf9831375271ea417ee17 </strong>to the registry key <strong>HKCU\SOFTWARE\Microsoft\Edge\DatabaseToken. </strong>This will be used later on to decrypt base64 encoded strings in the Python RAT.</p><p>This sample does have EDR detection capabilities where it will search for processes such as:</p><ul><li>CSFalconService.exe</li><li>CSFalconContainer.exe</li><li>SophosHealth.exe</li><li>Sophos UI.exe</li><li>SophosFS.exe</li></ul><p>If any of the above are identified on the system, the browser will launch with a visible window and if none are found, it will launch with a headless window.</p><p>To ensure that the malware persists, a function is then called which creates a scheduled task via COM object to launch a task named ‘Автозапуск’ under the current user, at the current user privileges, using the logon trigger 9 to ensure that Edge launches at logon. When the scheduled task is launched, Microsoft Edge is executed with the following command line arguments, invoking the newly created malicious brower extension:</p><p><strong>EDR Detected:</strong></p><pre>msedge.exe --user-data-dir=&quot;%LOCALAPPDATA%\Microsoft\Edge\User Data\WorkspacesNavigation&quot; --load-extension=&quot;%LOCALAPPDATA%\Microsoft\Edge\User Data\WorkspacesNavigation\TrustProtectExtension\extension&quot; --no-first-run --no-startup-window --disable-sync</pre><p><strong>EDR Not Detected:</strong></p><pre>msedge.exe --user-data-dir=&quot;%LOCALAPPDATA%\Microsoft\Edge\User Data\WorkspacesNavigation&quot; --load-extension=&quot;%LOCALAPPDATA%\Microsoft\Edge\User Data\WorkspacesNavigation\TrustProtectExtension\extension&quot; --no-first-run --headless=new --disable-sync</pre><p>The malicious AHK file then performs self deletion in order to remove on disk artifacts after infection.</p><p>Given we know that the malicious extension is loaded via the command line arguments mentioned above, how is the RAT actually executed and where does Native Messaging Host come into play?</p><p>Navigating to the directory <strong>Microsoft\Edge\User Data\WorkspacesNavigation\TrustProtectExtension\extension, </strong>it was noted that there are several files here:</p><ul><li>background.js</li><li>icon128.png</li><li>manifest.json</li><li>popup.html</li><li>popup.js</li></ul><p>While viewing <strong>background.js </strong>in a code editor it is clear that this component of the browser extension is heavily obfuscated:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kCENGFJPxG7iq7zaPVU-qw.png" /><figcaption>Background.js Browser Extension Component</figcaption></figure><p>At first glance of background.js, it is a mess of short random variable names, hex numbers, and a big array of strings. To make this easier to read, I ran the JavaScript though js-beautify.</p><p>While looking through the code I noticed the malware used an Immediately invoked function expression (IIFE) and a custom push/shift algorithm to manipulate a block of obfuscated data until the value matched a predefined checksum. Once the predefined checksum is hit, the values are then parsed in place of their hexadecimal aliases. From here the script uses string fragmentation to avoid static signatures/scanners:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fD7lrEnIaMy0vDTbOZLCDA.png" /><figcaption>Obfuscated Snippet</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-dR1G8oV4kzPiGqHhVaxqg.png" /><figcaption>Deobfuscated Snippet</figcaption></figure><p>Once the script has been deobfuscated, the functionality of the background.js script became more apparent — it seems to act as a two part RAT, connecting to the C2 <strong>wss[:]//dmypzouyuf61w[.]cloudfront[.]net/ws</strong> over web-socket connections. The script has a predefined command list which the C2 uses to talk to the extension with further functionality to communicate to the Native Messaging Host for more intrusive on host execution (File execution, File Transfer, Command Execution).</p><p><strong>Browser Extension Commands: (100–112)<br></strong> 0x64 — 100 — Add Surveillance Keywords<br>0x65 — 101 — Remove Surveillance Keywords<br>0x66 — 102 — Get Keyword Trigger Stats<br>0x67 — 103 — Get Total Open Tabs Count<br>0x68 — 104 — Spy on Active Tab URL/Title<br>0x70 — 112 — Redirect to New C2 Server URL</p><p><strong>Native-Host Commands: (1–10)<br></strong>0x1 — 1 — Fingerprint victim<br>0x2 — 2 — Ping/pong health check<br>0x3 — 3 — Execute arbitrary shell command<br>0x4 — 4 — Decode Base64 payload from C2 and write it to disk<br>0x5 — 5 — Run arbitrary Python code<br>0x6 — 6 — Enumerate running processes<br>0x7 — 7 — Execute arbitrary PowerShell code<br>0x8 — 8 — Read C2 WebSocket URL from kwnbquabzqerfrrolmfrbpo.txt<br>0x9 — 9 — Delete the C2 config file kwnbquabzqerfrrolmfrbpo.txt<br>0xa — 10 — Append a line (supplied by C2) to the log file</p><p>This particular malware provides a wide range of functionality to the operator, ranging from reconnaissance to full command execution and more.</p><p>Analysis of the Python RAT confirms that the strings are encrypted using a rolling XOR algorithm with the value previously written to the registry key <strong>HKCU\SOFTWARE\Microsoft\Edge\DatabaseToken</strong>. The Python RAT acts as an agent so the malicious browser extension can execute commands on the victim machine as seen above:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iNj9IhGFQcqS2sJhIQVHFg.png" /><figcaption>Snippet of Encrypted Python RAT</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q8vhBxAdgM31CHKBwfnuXg.png" /><figcaption>Python Process Exec + B64 File Write Functions</figcaption></figure><p>To reconstruct the infection chain:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ccIfcTPo94Y6m7wfzbbBMg.png" /><figcaption>Infection Chain</figcaption></figure><h3><strong>Conclusion:</strong></h3><p>This infection highlights a trend in post-exploitation techniques by leveraging trusted browser mechanisms (<strong>Native Messaging Hosts</strong>) alongside custom browser extensions to establish persistence.</p><p>By abusing Microsoft QuickAssist for initial access and abusing legitimate administrative utilities like tar.exe and AutoHotKey, the attacker successfully staged a dual-layer RAT capable of browser surveillance and full host takeover.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=794afa9f6c36" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Malware Analysis: DarkWatchman]]></title>
            <link>https://medium.com/@coormac/malware-analysis-darkwatchman-77da40574f6a?source=rss-48ba9f718b24------2</link>
            <guid isPermaLink="false">https://medium.com/p/77da40574f6a</guid>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[malware]]></category>
            <dc:creator><![CDATA[Cormac Conlon]]></dc:creator>
            <pubDate>Fri, 10 Oct 2025 13:05:32 GMT</pubDate>
            <atom:updated>2025-10-10T13:15:10.276Z</atom:updated>
            <content:encoded><![CDATA[<p>To start off this analysis lets discuss what is coming up. The sample we are analyzing today is a 32 bit .NET compiled executable.</p><p>Opening the file in Dnspy we can see the program uses ‘Marcar Consulta’ in many of its namespaces, which when translated from Portuguese means ‘Book an appointment’. We also observed phrases in the Russian language, mostly around message box pop-ups which may hint the target victims for the malware are Russian based.</p><p>Looking through the code we can see the sample uses reflection to build a the next stage in memory (reflective injection). We see multiple stages built in memory, followed by scripts written to disk which act as the main RAT/Keylogger. We also noted a byte array that contained what appears to be a ‘PureLogStealer’ sample (MerryDristos.exe) however we did not observe this executed in our analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*t0iiQJijeKXshAlH" /></figure><h3><strong>Indicators of Compromise:</strong></h3><p><strong>Host Based:</strong></p><ul><li><strong>aNzn.exe — </strong>833ea9a9192929cf352b05aca3946ca474004e0b9ff2f566d957e183cdcb8915</li><li><strong>CreativeAI.dll — </strong>3a8235adcf5c014204b3c7f9bc74cdc5628617fbca4edfd0a89e61bd368598d3</li><li><strong>DriverFix Pro.dll — </strong>801529bc43d94a1dbcdfbbcb3e723b68df7e742a3004553c39580364c8027b3a</li><li><strong>Dump1.dll — </strong>72e2279af77b32d06e062a719209e9b5c68fc14b4e0502a99bbcf9727774e45b</li><li><strong>MerryDristos.exe (Purelogstealer) — </strong>d0e156e62f8bc022fabf6f4a7014ee3381653856ec45ccc14a90d1ec05dd9559</li><li><strong>5d0d16ca0.js —</strong> 819336adff50997ea0985118e48871f3b3aec724c3119e7d6eaf97dcaaf873f9</li><li><strong>dynwrapx.dll (Used for malicious loading of additional payloads) — </strong>6dc40233d81640f532a1cbc1feb74d116b034db7c2871f2b0fe0124bcc542d8e</li></ul><p><strong>Network Based:</strong></p><ul><li>The sample uses a DGA algorithm to connect to C2 domains using the TLDs noted at the bottom of this report.</li><li><strong>User Agent — </strong>Mozilla/5.0(Windows NT 10.0;WOW64;Trident/7.0;rv:11.1)like Gecko’)</li></ul><h3><strong>Analysis:</strong></h3><p>To kick off the analysis here lets drop the sample into Pestudio, doing so can give us an idea of what functionality the malware might use at runtime:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*--3CgVGRjO9Y480I8pZt_A.png" /><figcaption>Pestudio View</figcaption></figure><p>In the above image we can see that Pestudio has detected 5 counts of reflection used in the file, along with a reference to resources. A lot of times .NET malware will load an object from its resource section using reflection which is most likely the next stage of the infection. So lets focus here.</p><p>We can take a look at the resources embedded in the application using Dnspy, doing so leaves us with a number of different bitmaps however, some stand out more than the rest:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*pabijWQOgp-g3xvZmAAB4g.png" /><figcaption>Suspicious Resources</figcaption></figure><p>The above resources named ‘paOb’ and ‘WR’ are both bitmap images embedded within our sample, this is something to keep in mind but for now, lets keep looking for references to reflection in the program.</p><p>While doing some digging through the different classes in the program, we came across something quite interesting located in the ‘MainForm’ method. It seems that the program uses a mathematical expression called ‘<strong>Lagrange polynomial interpolation</strong>’ to gather pixels from the two bitmap images observed above, uses the resulting numbers to build a pseudo-random seed, and then iterates over an image’s pixels — extracting and shuffling some RGB bytes into an output list until it reaches a set limit. The resulting bytes are stored into a byte list called ‘OutputPool’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CQ070p_w0rSvswLpviPDYg.png" /><figcaption>Equation</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*RnZQECUPvMN6U-ROIc0qOw.png" /><figcaption>Equation 2</figcaption></figure><p>Taking the above into consideration its pretty safe to say that the result of the above equations is going to end up building the next stage from pixels embedded within the bitmap images and reflectively loading them into memory.</p><p>We can prove this by setting some breakpoints on:</p><ul><li>outputPool.Add(array3[num19]);</li><li>outputPool.Add(array3[num20]);</li><li>outputPool.Add(array3[num21]);</li></ul><p>Doing so will allow us to observe the pixels gathered from the images, and the resulting bytes stored in array 3:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-y5_rKGSWG4X32aow43ong.png" /><figcaption>Magic Bytes</figcaption></figure><p>After running the sample and hitting our first breakpoint, we can see the data populate in the locals tab. Array 3 has been populated with those magic bytes, as we expected. We can also add a watch on ‘Array 3’ for easier visibility of each iteration through the loop:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cNfaW4wSOvVmt65TkmzgFw.png" /><figcaption>Watch on Array3</figcaption></figure><p>I suppose its also worth noting that the ‘MainForm’ class is where we see reflection being used. After some more digging through the program we came across references to loading an assembly, which was nested within a bunch of benign code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k0Wdgc9lqNQ0Ulhp1NGqSg.png" /><figcaption>Reflection Nested</figcaption></figure><p>We can see that this code is essentially going to do what we expected, build a byte array from the pixels gathered in the bitmap image and reflectively load the byte array into the memory of the running process. We can run the program until we hit a breakpoint here, and view the locals tab where we can see the ‘byte list’ created earlier:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dKKXlFYLNsGvyCEU-O8nvg.png" /><figcaption>List Seen Earlier</figcaption></figure><p>Running the program to the next breakpoint then loads the bytes into memory giving us our next stage ‘CreativeAI.dll’</p><h4><strong>Stage 2 Analysis:</strong></h4><p>I kind of expected this to be the case, as it always is with .NET malware. The next stage is pretty much completely obfuscated with very little human readable strings. Lets drop it into DetectItEasy for a quick look:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Js8o6_7gEHCIJgCAajsbNg.png" /><figcaption>DIE Analysis</figcaption></figure><p>We can see that the dll is using .NET reactor for protection, along with a bunch of other anti-analysis techniques.</p><p>Analyzing the next stage in Dnspy is pretty difficult considering most of the content looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tXZ3a7I7pelCUuIHqNS0LQ.png" /><figcaption>Stage 2 Content</figcaption></figure><p>However, lets try break it down — we know we are likely going to be looking for more references to resources, byte arrays and reflection capabilities so lets try that. I am essentially going to step through the mess of code and set breakpoints on anything that may be of use, including any references to byte arrays and ‘return’, not pretty but it may be sufficient.</p><p>Funny enough, there is no shortage of suspicious looking code even though the majority of it is not human readable. It’s quite easy to identify ‘unpacking’ or data manipulation code, so we set quite a lot of breakpoints on areas like this, including the below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gcv5FETD00WHA7I5o3iMqg.png" /><figcaption>Suspicious Code Block</figcaption></figure><p>Throughout stepping through the program we did come across references to importing kernel32.dll, GetProcAddress, FindResource, VirtualProtect and OpenProcess.</p><p>It’s worth noting here that this obfuscated stage performs a number of XOR, Cryptographic and data manipulation techniques against byte arrays which is likely the decoding/unpacking of important artifacts. Trying to understand and decipher all of these is not feasible so instead we will turn to our trusty breakpoints in the hopes we strike gold!</p><p>In our hypothesis with the mathematic equation at the beginning of the analysis, we stated that the initial assembly used pixels from both bitmap images, performed some mathematical equation and transformed them into a byte array. This may not have been the case, and it is probable that the bytes were gathered from one bitmap ‘<strong>WR</strong>’. We hit a breakpoint in our stage 2 where the program builds out the string ‘<strong>paOb</strong>’ which was a bitmap embedded in our initial program, so it may be setting up to utilize this next:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nbigGnWog0JRBkVerknUqg.png" /><figcaption>paOb Reference in Stage 2</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_vF1gP4wK8dy4XbLb-3b8Q.png" /><figcaption>More References</figcaption></figure><p>Next up we hit another one of our breakpoints. This time after data manipulation was performed and the resulting bytes were stored into an array. Checking the locals tab we see both ‘array2’ and ‘array3’ populated. Both of these arrays store executable files, both are dlls and both are .NET compiled and once again, obfuscated:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*crkX77s4NAkOlCQ26XOyDQ.png" /><figcaption>Arrays Storing More Artifacts</figcaption></figure><p>Our next breakpoint then loaded the next stage ‘DriverFix Pro’ into memory:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*suIrJkTF7mWNiSq_D2u8Gg.png" /><figcaption>Next Stage Loaded into Memory</figcaption></figure><p>I took a quick look at the next stage which was just loaded into memory and it is more obfuscated than the last. Saying that, I went ahead and followed the same process as above, step through each class looking for anything that might be of interest, there was quite a bit.</p><h4><strong>Stage 3 Analysis:</strong></h4><p>First off we hit one of our <strong>many </strong>breakpoints that we set, in this case the program just gets an object from its resource section, said object is ‘ngfJTfpdMye’. We then hit another breakpoint, this time data was written to a byte array ‘<strong>\u0020</strong>’ — no surprise that this is once again another obfuscated dll:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XYEXygRgMIZWrsg4af_rYQ.png" /><figcaption>More Stages</figcaption></figure><p>Again, stepping through our sample with the breakpoints we set, we notice that our malware spawns a child process of itself in a suspended state. This may be a precursor for further unpacking/reflection:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BEV4okKc1V85S-fPcOZjdw.png" /><figcaption>Child Process Spawned</figcaption></figure><p>Just after this breakpoint we encountered an issue. We got a message box pop up from Wscript stating the program cannot be run however, this referenced a JS file located in our users %APPDATA% directory, so our next step was to look here. Sure enough, we noted a JS file along with a DLL situated in the Local directory:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zHIsLr6Nl8YHBPNV8wQcIw.png" /><figcaption>Files Written to Disk</figcaption></figure><p>I decided to take a look in our temp directory as this is usually a good staging folder for malware and noticed bits of different files with unusual extensions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fX6uPoieXNF1xOrfnjea6w.png" /><figcaption>Bits of Files Written to Temp</figcaption></figure><p>We also observed this JS file be registered as a scheduled task which appears to mimic a CLSID however, when checking registry entries for the value, nothing was found:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CQ370syLUVM0TH5CM7Qj1A.png" /><figcaption>Scheduled Task</figcaption></figure><p>As far as our .NET analysis goes, I think we have reached the limit. The program writes a number of files to disk and then appears to exit, so lets move over to analyzing the JS file now.</p><h4><strong>JavaScript Analysis:</strong></h4><p>Opening the JS file in VS code we can see a blob of hexadecimal data passed in after some charcode obfuscation. The blob of data is passed in as a variable called ‘<strong>j134</strong>’:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PyNeL6AW72ysyaOLoio7oA.png" /><figcaption>Blob of Data</figcaption></figure><p>Scrolling down to the bottom of the script we can see that it uses an eval statement to execute a variable named ‘<strong>k139</strong>’. This variable is essentially made up of an array added to our blob. To decode the data, we can replace the ‘<strong>eval</strong>’ statement with a ‘<strong>console.log</strong>’ statement to write the decoded data to the terminal:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eW-ofIlHK7hx_x30cbCOZA.png" /><figcaption>Eval Statement</figcaption></figure><p>I decoded the data and wrote the output to a new JS file and doing so provided us with a clean script, 1300+ lines of malicious code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y1YUcVbhj1V_KD1ll9gYPw.png" /><figcaption>Decoded Script</figcaption></figure><p>The script is pretty big and analysis of each aspect would be pretty difficult, so for this section I used AI to summarize the technical capabilities of the malware:</p><h4><strong>Executive summary:</strong></h4><h3>Initialization and Environment Setup:</h3><ul><li>Creates multiple COM objects:</li><li>WScript.Shell, Scripting.FileSystemObject, WinHttp.WinHttpRequest.5.1, Schedule.Service, SWbemDateTime, Shell.Application, and GetObject(&quot;winmgmts:...&quot;).</li><li>Derives a <strong>unique host identifier (UID)</strong> from HKLM\SOFTWARE\Microsoft\Cryptography\MachineGuid.</li><li>Checks for administrative privileges via a registry write test.</li><li>Determines OS version, architecture, and environment paths.</li><li>Creates a working directory in %APPDATA% or another writable location.</li></ul><h3>Persistence Mechanisms:</h3><p><strong>Scheduled Task Creation</strong></p><ul><li>Registers a hidden task via Schedule.Service COM API.</li><li>Executes wscript.exe &lt;installed_script_path&gt; on logon or at boot.</li></ul><p><strong>File Installation</strong></p><ul><li>Moves the script to a hidden location in %APPDATA% as &lt;uid&gt;0.js.</li></ul><p><strong>Registry Storage</strong></p><ul><li>Stores configuration, payloads, and runtime state in:</li><li>HKCU\Software\Microsoft\Windows\DWM\&lt;uid&gt;*</li><li>Common keys:</li><li>&lt;uid&gt;c: Cached C2 URL</li><li>&lt;uid&gt;t: Polling interval</li><li>&lt;uid&gt;v: Autostart JS blob</li><li>&lt;uid&gt;a: Keylogger data</li><li>&lt;uid&gt;r: Pending result data</li></ul><p><strong>Optional DLL Registration</strong></p><ul><li>Registers a local copy of dynwrapx.dll via regsvr32.exe /i /s, which is used for in-memory DLL execution.</li></ul><h3>C2 Communication:</h3><ul><li>Outbound connections via <strong>WinHTTP</strong> (WinHttp.WinHttpRequest.5.1).</li><li>Sends HTTP POSTs to URLs of the form:</li><li>https://&lt;domain&gt;/&lt;path&gt;/index.php</li><li>Uses custom HTTP headers:</li><li>X-Client-Id: UID</li><li>X-Client-Controller: command context</li><li>X-Client-Ut: system uptime</li><li>X-Client-Status: operation result code</li><li><strong>Fallback C2 resolution</strong> through <strong>Domain Generation Algorithm (DGA)</strong>:</li><li>Generates deterministic domains based on date + seed from registry or hardcoded salt.</li><li>Tries multiple TLDs (.xyz, .cfd, .sbs, .fun, .space, .biz.ua).</li></ul><h3>Command Handling:</h3><p>Commands are delivered via HTTP response status codes (820–840 range).</p><h4>CodeAction:</h4><p>820 — Execute binary (EXE)821Load and execute DLL via rundll32</p><p>822 — Execute shell command</p><p>823 — Execute process (generic)</p><p>824 — Execute WSH script (JScript/VBScript)</p><p>825 — Evaluate JavaScript code in memory</p><p>826 — Execute encoded PowerShell payload</p><p>827 — Stop process</p><p>828 — Uninstall (remove persistence and files)</p><p>829 — Upload file to victim</p><p>830 — Change polling interval</p><p>831 — Update C2 URL</p><p>832 — Self-update (replace script and restart)</p><p>833 — Update keylogger payload</p><p>834 — Store autostart JS in registry</p><p>835 — Execute binary with output capture</p><p>840 — Reflectively load DLL in memory</p><h3>Data Collection &amp; Keylogging:</h3><h4>Collects:</h4><ul><li>Host information (OS, architecture, user, domain, AV software via WMI).</li><li>Keylogs (stored under registry &lt;uid&gt;a, sent to C2 periodically).</li><li>Possibly “smart card” data under &lt;uid&gt;d.</li><li>Keylogger component is a PowerShell payload stored in registry and executed hidden via:</li><li>powershell.exe -NoP -NonI -W Hidden -Exec Bypass -enc &lt;encoded payload&gt;</li></ul><h3>Anti-Forensics &amp; System Modification:</h3><ul><li>Deletes files securely by overwriting with zeros.</li><li>Clears:</li><li>Windows Event Logs (wevtutil el/cl)</li><li>Browser history (Chrome, Firefox, Yandex)</li><li>Shadow copies (vssadmin Delete Shadows /All /Quiet)</li><li>Sets restrictive ACLs on selected directories (hidden/system/read-only flags).</li></ul><h3>Network and Host Artifacts:</h3><p><strong>Registry</strong></p><pre>HKCU\Software\Microsoft\Windows\DWM\&lt;uid&gt;*<br>HKCU\Software\Classes\CLSID\{89565275-A714-4A43-912E-978B935EDCCC}</pre><p><strong>Filesystem</strong></p><pre>%APPDATA%\&lt;uid&gt;0.js<br>%APPDATA%\dynwrapx.dll<br>%TEMP%\*.exe / *.dll / *.js</pre><p><strong>Network</strong></p><ul><li>HTTPS POST requests to dynamically generated domains (DGA).</li><li>Custom headers containing X-Client-Id and X-Client-Controller.</li></ul><p><strong>Processes</strong></p><ul><li>wscript.exe (main script)</li><li>powershell.exe -enc …</li><li>rundll32.exe &lt;dll&gt;,&lt;export&gt;</li><li>regsvr32.exe /i /s dynwrapx.dll</li><li>wevtutil.exe, vssadmin.exe</li></ul><h3><strong>Summary:</strong></h3><p>I’m going to end this here however we did gather quite a few IOCs and determined the functionality of the sample in question.</p><p>We observed an initial .NET program executed which gathered pixels from an embedded resource, performed a mathematical equation on them to transform them into a byte list which was later loaded into memory as an assembly. The next stage was heavilly obfuscated however the reflection techniques observed were somewhat similar. The sample used data manipulation techniques to build multiple byte arrays which did hold additional executable files however, only one was observed being loaded into memory (<strong>CreativeAI.dll</strong>).</p><p>One of the files we observed being built into a byte array appears to a sample of the ‘<strong>PureLogStealer</strong>’, which was interesting to see being packaged along with the JS RAT/Keylogger.</p><p>The last stage of reflection (<strong>DriverFix Pro.dll</strong>) was similar to the second stage wherein it was heavily obfuscated and utilized similar techniques for infection however, we observed files being written to disk in this case. The files written to disk included a JS file which acted as a RAT with a lot of functionality to cater for follow on activity.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77da40574f6a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Formbook: Malware Analysis]]></title>
            <link>https://medium.com/@coormac/formbook-malware-analysis-e46b3d62683b?source=rss-48ba9f718b24------2</link>
            <guid isPermaLink="false">https://medium.com/p/e46b3d62683b</guid>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <dc:creator><![CDATA[Cormac Conlon]]></dc:creator>
            <pubDate>Tue, 16 Sep 2025 20:52:06 GMT</pubDate>
            <atom:updated>2025-09-16T20:52:06.165Z</atom:updated>
            <content:encoded><![CDATA[<h3>Summary:</h3><p>In this write up we will be analyzing a financial phishing lure that led to a drive by download of a malicious document file. The file in question was an RTF document which exploited CVE-2017–11882. The MS equation editor is vulnerable to stack buffer overflow and as such, can lead to the execution of malicious commands as we will see in this write up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tSvKS3J9v1CwxEVF" /></figure><h3>IOCs:</h3><h4>Host based:</h4><ul><li><strong>Funding-Guide.doc — </strong>cb283b9b9a95d17298e0e996ecf5006629a70e926d406280540691f33e7ea7e8</li><li><strong>Funding.exe / U6533ks.exe.exe —</strong> 0f300bbb9ae586f438ef75fe284ce0818111c1515923d27e7c1986b5dba6dce5</li><li><strong>Unregister.dll -</strong>a7dc51113a52145315d35403b7f1106875957b29fbca4f2d496c2a902e62bcab</li><li><strong>8rmjl4kd.exe (Payload) — </strong>1cec8555ebb8fbaab7c269f2b07c6f4cc475515474448dac91cb5580c6a2ff1a</li><li><strong>RP8SH.dll — </strong>14b81752a5f9d22a40850c6d9a92a6bd255c3321646dd5e584db2bf9d32748d4</li><li><strong>ayUlXCoOqqAoUlwbCLMxlsOFtUit.exe — </strong>da4cb91d96214c7134a9e8799fdf241bd6b8103eecd4efb1b8c228ca3c8e7e91</li></ul><h4>Network Based:</h4><ul><li>hxxps://ypawspa[.]com/2/Funding-Guide[.]html</li><li>hxxps://proteccionrino[.]com/1/Funding-Guide[.]doc</li><li>hxxps://proteccionrino[.]com/1/Funding[.]exe</li></ul><h3>Analysis:</h3><p>Kicking off the analysis lets start with the initial drive by download. The lure used here was a financial themed phishing email that contained the above URL. Once clicked, the victim is directed to the above html page. This then redirects the victim to the download of our first stage in this analysis which was hosted on the second URL mentioned above.</p><h4>RTF Analysis:</h4><p>Looking at the downloaded file we can confirm that it is in fact an RTF file, these differ from your typical maldocs due to their structure. Typically with office documents we can use tools such as oledump, olevba however, these tools are not compatible with RTF documents. To get around this we can use document specific tools such as rtfdump.py or rtfobj.py.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HdXIzjX3SB6DuJWJTKX6LA.png" /><figcaption>rtfdump Output</figcaption></figure><p>The above output shows us the streams contained in our .doc file, we can see that there appears to be 3 streams embedded within, all of which reference the equation editor. For the most part, the stream we are interested in should be the one that references ‘\object’, as that is where the exploit is typically stored. We can easily extract the object by using another tool called ‘rtfobj.py’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4FtnUng2TMNYR7Wii8hXxw.png" /><figcaption>rtfobj.py Object</figcaption></figure><p>We can see that our tool has detected a possible CVE-2017–11882 exploit in one of the streams, lets extract that and do some more analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qmbLjnQA6lvhbLI5qk6eIQ.png" /><figcaption>Saved Object</figcaption></figure><p>We extracted the object, saved it to disk and ran another tool called ‘xorsearch’ against it, this tool is quite useful when it comes to identifying shellcode. The output has detected a ‘GetEIP’ method at the offset ‘0x0000004C’, for shellcode to run correctly without any issues, it needs to identify where it is being executed in memory. A common technique it uses to do so is ‘GetEIP’. Now we know the offset at which the shellcode is being executed, lets emulate it using scdbg.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yOAVGhfAZZ5Sylfkz22t3A.png" /><figcaption>Shellcode Emulation</figcaption></figure><p>From emulating the shellcode we identified within the embedded object, we can see the machine instructions that will be used to download our second stage payload. Skimming over the instructions we can see that it uses ‘GetProcAddress’ to locate the API ‘URLDownloadToFileW’. This is then called to download our next payload to the ‘APPDATA’ location on disk. The newly downloaded stage 2 is then executed using the ‘CreateProcessW’ API.</p><p>That is pretty much it as far as our RTF analysis goes, lets take a look at our next stage.</p><h4>Stage Two Analysis:</h4><p>Before getting into the next part of this analysis lets confirm the file type, doing so shows us that this is a .NET compiled executable file. I like to take a look at the the strings in present in the file also, this can give us some valuable insights as to what to expect. In our case, we located a bunch of discord channels, github repos and more when searching for ‘http’ in our output file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O9SXV-jeUsADx9bllwhY3Q.png" /><figcaption>Strings Output</figcaption></figure><p>The above image shows a number of items which all correlate to ‘Microsoft Flight School Simulator’ which may hint that the malware attempts to mimic such software. Even the Github repos noted above all seem to be related to flight/glide simulators which seems unusual. No confirmed malicious artifacts were identified in the strings output so lets open the file up in dnspy, since we confirmed this to be a .NET binary. Before doing so however, lets clean it up a bit with de4dot.</p><p>When looking at .NET compiled binaries, I like to just focus on the classes/methods that use ‘Reflection’. The reason for this is that a lot of .NET malware will load a bitmap or object from its resource section and reflectively load the next stage into memory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*Yczb3h3V0B-dgsimDWECOw.png" /><figcaption>Embedded Resources</figcaption></figure><p>Near the top of the program we can see a class named ‘dDf8Z5r’, this class is pretty big however, we have confirmed that it uses ‘system.reflection’. Lets track down where it is actually used next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4US_-i2BZzlAxnw8EErk_Q.png" /><figcaption>System.Reflection Used</figcaption></figure><p>While analyzing this program in dnspy we can see that a good chunk of the classes actually use the ‘DebuggerHiddenAttribute’, this essentially tells the debugger to not step inside the class which explains why none of our breakpoints were being hit. There are also a number of references to ‘[DebuggerBrowsable(DebuggerBrowsableState.Never)]’, which is another anti-debugging technique used by the malware. This was becoming a bit of a roadblock in the analysis however I did make note of something. As soon as we run the malware a module is loaded into memory which means in theory, this module must be loaded near the entry point of the program. Also, the fact that the module was loaded before the program terminates tells me the code that kills the program must reside in the newly loaded module.</p><p>Moving my analysis to the entry point of the program proved my theory — as soon as the entry point is hit, the malware gathers a byte array from another class within the file and loads it into memory, pretty nice:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*N8TiiSICXnHFUBVjRG_AMg.png" /><figcaption>Module Loaded</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*picJnF_7dYRL_G3S7mbTZA.png" /><figcaption>Byte Array</figcaption></figure><p>As mentioned above, following the entry point (nFm4Ck9d7ggDeA.GClass1.Eks8j6bT), we can see that the sample actually locates, reverses and loads a byte array from ‘0Nidm8SdgLc1’, which is located in the original binary. The newly loaded module is called ‘Unregister.dll’</p><p>This stage 2 exe is quite large and has a decent bit of interesting code within however for the most part, I believe the author attempted to make the binary appear as legitimate as possible while only sneaking in some malicious techniques, likely used to aid the sample in bypassing defenses and tricking analysts.</p><p>Anyways, onto the stage 3 analysis!</p><h4>Stage 3 Analysis (Unregistered.dll) in Memory:</h4><p>Kicking off our analysis here lets start with extracting the dll from memory. Once extracted we can run some basic static analysis on it, tools such as PeStudio and DetectItEasy can give us some nice insights on what to expect:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*Wsk-SIp_fTmDg5tiM007Vg.png" /><figcaption>PeStudio Analysis</figcaption></figure><p>Using PeStudio to analyze the program we can see that a number of imports have flagged. The one’s that catch my attention being ‘Compress’ and ‘MemoryStream’. This may hint that additional files will be loaded into memory. We can also see that the file has an unknown item in its overlay section, which is commonly seen with packed binaries.</p><p>Viewing the dll in DetectItEasy gives us some more insights into what sort of protection the dll uses to hinder analysis:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*w73xa4IpJqdbElHIva1q8g.png" /><figcaption>DetectItEasy Analysis</figcaption></figure><p>Now that we have done some static analysis and know a bit more about the next stage, lets continue on. Its important to note that due to this next stage being loaded into memory as a byte array, we cant actually debug it on its own. So we need to debug the module while it is running in the memory of our original file, ‘U6533ks.exe.exe’.</p><p>Whilst letting the malware run we received a pop up stating that Fiddler was detected on our machine:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*yctAezAp9GG6AWDaqJSKdQ.png" /><figcaption>Pop-up Message</figcaption></figure><p>Once the application is detected, it kills the process and attempts to remove the file from our computer.</p><p>This is an anti-analysis technique used by malware to detect virtualized/analysis environments. Lets remove the program and see if we can bypass this.</p><p>Removing Fiddler did allow the malware to execute further and a couple of additional modules were loaded as a result. Now that we know we can actually run the file without it being terminated, lets move onto analyzing the code and strategically placing breakpoints before further debugging.</p><p>While looking through the file we come across some more anti-debug/anti-VM tricks, such as:</p><ul><li>IsDebuggerPresent</li><li>OutputDebugString</li><li>CheckRemoteDebuggerPresent</li><li>Searches for VMware registry keys</li><li>Checks cache size</li></ul><p>These are pretty basic and dnspy can actually bypass the majority of these if you have the correct settings enabled.</p><p>Checking the resource section of the dll in dnspy confirms that there is a binary resource present, it is probable that this will be our next stage once it is decoded and loaded into memory:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*pCTvob9SwDO6hxUwd2Hgzg.png" /><figcaption>Binary Object in Resource Section</figcaption></figure><p>While performing static code analysis I came across a hard coded command line argument:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i3rJ5oykGAc4eRbbUREo9g.png" /><figcaption>Hard Coded Command</figcaption></figure><p>I also came across the block of code that detected Fiddler on our machine, another block of code was located which looked for ‘Http Debugger’ and killed the process if it was present:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YisiwE7Ajz9bH0GpfYVX6g.png" /><figcaption>Fiddler Detection</figcaption></figure><p>I then came across a reference to retrieving a byte array from the resource that we mentioned earlier. This array is then stored as an objectValue. My initial thoughts here were that the byte array is going to resemble that of a PE however, that is not the case just yet. This would tell me that we haven&#39;t yet reached the function that will decode/decrypt the byte array:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CankEhHP2ziwseQyyutRdg.png" /><figcaption>Module Loaded as Byte Array</figcaption></figure><p>Moving onto the NameSpace ‘Segwenservice’, this is where it starts getting interesting. The code here will perform actions such as:</p><ul><li>Reflective dll Injection</li><li>Process Injection</li><li>Iterate through a list of running processes (for injection)</li></ul><p>There is a bunch more functionality in this NameSpace which we will look at in a little bit. We can see however that the malware will retrieve the TEMP path and then attempt to write there. This functionality falls under the ‘Class_10_Path’ namespace and appears to be used for locating a directory to write a file to.</p><p>Next we will look at the installation Class:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*zkL1XihPpoav1AxPLU-6eQ.png" /><figcaption>Classes</figcaption></figure><p>Looking through this class we see a bunch of interesting artifacts. There are references to checking the registry for Microsoft Defender, creating startup persistence, injection persistence and a lot more. I set some breakpoints on some of the interesting code so lets see what we come across next.</p><p>While debugging we hit a breakpoint which returns the values stored in ‘A_0’. Expanding this in our locals tab we see a bunch if interesting strings:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3hSO56SRZ2b2cRu7_kRE2Q.png" /><figcaption>Interesting Strings</figcaption></figure><p>Take note of the value stored inside ‘%MainFile%’ here, there is a byte array where we can dump a PE file from. This is labeled as our main file so we will look into this in a little bit but for now, lets keep debugging.</p><p>Next we come across what seems to be our target process for injection — we mentioned earlier that the sample has the capability to perform injection with the object stored in ‘A_0’, in the below image we can see a target path in which our %MainFile% may be injected to, keeping in the mind the ‘obj’ value holds the bytes of the %MainFile% previously located:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*88JhNFJQaMjKNilmx84NcA.png" /><figcaption>Injection</figcaption></figure><p>Next up we hit another breakpoint — here we identified another byte array that contains a different executable file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zfjOgjBq1SQ-aus5EIw_kA.png" /><figcaption>Second File Bytes</figcaption></figure><p>Lets just go ahead and dump this file to disk also so that we can review it in a little bit, back to debugging!</p><p>We stopped on another breakpoint that appears to actually create the above assembly, below we can see the name of the dll when it will be reflectively loaded:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PI8TgbwJMilq-7hMMUGgPg.png" /><figcaption>Reflective dll Injection</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*oor-fqHRXCNwMg7soR2tzw.png" /><figcaption>Dll Loaded into Memory</figcaption></figure><p>The above snippet confirms that the Dll we seen above has been reflectively loaded into memory. Now we can start looking at the internals of this next stage and repeat the same process we performed on ‘Unregister.dll’.</p><p>Before going into detail with the next module lets take a step back and look at the artifacts we extracted, starting with our injected dll ‘%MainFile%’</p><h4>Static Analysis of Extracted Artifacts:</h4><p>Dropping the exe into PeStudio we can see the file is pretty much completely stripped. There are no resources, no IAT and the overlay section is 0.</p><p>Taking this into consideration there really is not much that can be done from an analysis perspective. The program is packed and there are no identifiable strings present. My theory here is that once the program is injected, the exe dynamically locates its imports.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5g_aPdE-fOW5JxplX2tayw.png" /><figcaption>PeStudio Analysis (MainFile.exe)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jvSbyxJ_fwotIDHSvbysWQ.png" /><figcaption>DiE Report</figcaption></figure><p>Now lets look at the other module we extracted. This one is a bit more interesting and seems to act as a crypter of sorts. We can see the original file name which is ‘RP8SH.dll’. OSINT tools such as VT have a decent amount of reports and relations for this particular file hinting that it used somewhat frequently in the wild:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mqStgpegm2Rz-0pYqHMcdw.png" /><figcaption>VirusTotal Report (RP8SH.dll)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Zd7lh9MmNqpaWZflF8kig.png" /><figcaption>DiE Report</figcaption></figure><p>As can be seen from the above image, this dll is heavily obfuscated which we will see just below..</p><p>Essentially every namespace, class and method in this dll is obfuscated which makes our analysis extremely difficult. Dnspy is even throwing decompilation errors so we cant even attempt to set strategic breakpoints.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uPyeKd6mplGdb0ib_u5Vew.png" /><figcaption>Obfuscated Dll</figcaption></figure><p>The only option we have here is to step through each class looking for any human readable code in the hopes we come across something interesting, which we did. We ended up locating what appears to be a unpacking algorithm. Along with this finding, we also noted references to the API ‘VirtualProtect’, which we know can be used to modify permissions on a region of memory:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tsy-hG6A9mnqVVKjqm-1sA.png" /><figcaption>Unpacking Algorithm</figcaption></figure><p>This block of code is extremely long however you get the idea. Halfway down we also come across another call to VirtualProtect. So, lets set breakpoints at the beginning, middle and end of this code block in the hopes that we can extract some useful information.</p><p>We hit the breakpoint which we set in the middle of this block and observed nothing, so we ran the program again and just like that we see another module loaded into memory. Along with this are references to objects in a previously loaded module.</p><p>We can follow the modules again and expand them to see what’s going on here:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jX8ojSq4V2TT_CtbV2FqVA.png" /><figcaption>Loaded Module and Resource</figcaption></figure><p>So we can see that in the newly loaded module, there is a resource and nothing else. This resource then appears to have been loaded as its own module however it has no functionality apart from creating a process as a user. Something to note here however, we have not yet seen our injected process running so my theory is that once executed, this function essentially creates and runs the injected process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QGSVhzHu7UOvTw3KGdk3Ww.png" /><figcaption>Process Creation</figcaption></figure><p>We can also see obfuscated references in the code above however following them lead us to more obfuscated internal structs so it is quite hard to confirm what is happening here. Saying that, lets go ahead and run the program again.</p><p>Running the application until it crashed did not confirm the above theory, which is a bit annoying however it is what it is. Just to prove our theory, I executed the sample without debugging and observed our parent process create the identified child process in a suspended state and shortly after resume, spawn as its own independent process and then terminate:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j5HF8qjnt5RO1B6mxC2L2w.png" /><figcaption>Injection Confirmed</figcaption></figure><p>We done a good bit of analysis and identified and extracted several stages but we did skip over one — our MainFile.dll.</p><p>Earlier in the analysis we seen that this dll is going to be injected into ‘AddInProcess32.exe’ which we actually didn&#39;t observe in procexp however, we know that it should happen. We confirmed that this dll has no IAT we certainly prevents us from doing any of our own debugging, which is also quite irritating.</p><p>Anyways this is a bit disappointing as we have identified and extracted the main payload however, we cannot view the functionality as we do not have a copy that we can properly analyze. We could attempt to dump the memory of the injected process but this is also proving difficult, given the process terminates nearly instantly after being resumed.</p><p>This sample was not on VirusTotal at the time of analysis so we uploaded it and it was confirmed to be a strain of Formbook.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2JwDxhygGWBeLGqvrHC0UQ.png" /><figcaption>VirusTotal Results</figcaption></figure><h3>Conclusion:</h3><p>I am going to end this write up here but just to summarize what we observed:</p><p>A phishing email was delivered which utilized a financial themed lure to get the victims attention. When the URL was clicked, this resulted in a drive by download of a maldoc, in particular an RTF document. This maldoc exploited CVE-2017–11882 and executed embedded shellcode to reach out and download the second stage payload.</p><p>The second stage payload was a .NET compiled binary that reflectively loaded a dll into its memory. The loaded dll acted as a loader for a couple of more modules, where the main one was a ‘formbook’ payload.</p><p>The formbook payload was then injected into the legitimate process ‘AddInProcess32’ however, performing analysis on this executable file itself proved difficult and in the end was not possible.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e46b3d62683b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RokRat: Malware Analysis]]></title>
            <link>https://medium.com/@coormac/rokrat-malware-analysis-14f371d13adb?source=rss-48ba9f718b24------2</link>
            <guid isPermaLink="false">https://medium.com/p/14f371d13adb</guid>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <dc:creator><![CDATA[Cormac Conlon]]></dc:creator>
            <pubDate>Fri, 18 Jul 2025 12:46:54 GMT</pubDate>
            <atom:updated>2025-07-18T12:50:38.844Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eugEIvmgg5gDbyo2s5p38w.jpeg" /></figure><p>Kicking off this analysis lets talk a little bit about whats in store. This sample was once again pulled from MalwareBazaar and is a Dynamic Link Library (DLL). The sample does have several reports on VirusTotal and includes hashed APIs that load a binary file from the resource section of the sample. We see these hashed APIs passed as a parameter to a function that accesses the PEB which may indicate a dynamic API resolution technique known as ‘PEB Walking’. This technique is used to avoid static signatures for risky APIs and to make analysis more difficult for analysts.</p><h3>Indicators of Compromise:</h3><h4>Host Based:</h4><ul><li>mpr.dll — 7d514021c472e6e17f587ed30555d3f120653e6c7f8dc25d2331514b92ffd7bc</li><li>version1.0.tmp — 3fa06c290c477c133ca58512c7852fc998632721f2dc3a0984f18fbe86451e18</li><li>Stage3–7537f0e9da88e5dced70328cb0110ef8e9a60eaed10bd4a4d863501caef9d643</li><li>HKCU\SOFTWARE\DefaultEdit\Installed</li><li>C:\Windows\*****.dat — where ‘*’ is a randomized string of 5 numbers.</li><li>C:\Windows\Users\&lt;userprofile&gt;\Appdata\Local\Temp\z9fda975_y1357_x9753_2025_07011514.tmp — This string is likely randomly generated when the file is written.</li></ul><h4>Network Based:</h4><ul><li>hxxp[:]//api[.]pcloud.com</li><li>hxxp[:]//pcloud[.]com</li><li>hxxp[:]cloud-api[.]yandex[.]net</li><li>hxxp[:]//api[.]dropbox[.]com</li><li>hxxp[:]//content[.]dropboxapi[.]com</li><li>User-Agent: Mozilla/5.0 (compatible; Googlebot/2.1; +hxxp[:]//www[.]google[.]com/bot[.]html<a href="http://www.google.com/bot.html)/r/nAccept">)</a></li></ul><h3>Static Code Analysis — Ghidra</h3><p>Kicking off our analysis a bit different than usual lets load the sample straight into our decompiler/disassembler of choice, mine being Ghidra. With dlls, our initial focus point should be on the exports which are present. This will tell us what functionality the file is going to provide to an application, in our case we have one export called ‘WNetGetConnectionW’. This particular function takes 3 parameters: lpLocalName, lpRemoteName and lpnLength and does appear to be part of a legitimate dll known as ‘mpr.dll’.</p><p>Out of curiosity I decided to load the legitimate mpr.dll file into PeStudio and Ghidra to check the if:</p><ol><li>The same export actually resided in the legitimate dll.</li><li>If the code in the malicious dll’s export mimicked that of the legitimate dll.</li></ol><p>I did confirm that the same export existed in our legitimate dll however, viewing the export at the code level showed significant differences.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l47iBgz6b0O1l6rVQwZtUQ.png" /><figcaption>Malicious dll</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QSwyFvlrXDY3xjGQeVyMVg.png" /><figcaption>Legitimate dll</figcaption></figure><p>We can see from our top image that the functionality within just appears to initialize the EAX register and return back to the caller, while our legitimate export seems to have some real functionality.</p><p>Anyways enough of the rabbit hole, back to our analysis.</p><p>I decided to take a look at the entry point of our sample and step through some of the code and the functions which are called — this is where I came across the first call to another function which I decided to check out. Stepping into this function I noted what appeared to be hashed data and several calls to yet another function:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b_oYzKzjaOWlPjgDxI59oQ.png" /><figcaption>Hashed API Function</figcaption></figure><p>Given these strings of data were suspicious, I decided to Google them. Doing so turned up some interesting results — these are hashed versions of windows API calls that resolve to functionality such as:</p><ul><li>kernel32.dll!FindResourceW — 0x6608f55e</li><li>kernel32.dll!SizeofResource — 0x42f9102e</li><li>kernel32!LockResource — 0xe8be94b</li><li>kernel32.dll!CreateThread — 0x160d6838</li><li>kernel32.dll!ExitProcess — 0x56a2b5f0</li></ul><p>There are two additional hash values that I couldn&#39;t locate online however, we will try to locate these when debugging the sample. The most important piece of information we now know however is that this sample has an embedded item in its resource section that the malware author tried to conceal by hashing the APIs — sneaky.</p><p>However, I also noted that these hash values are moved into the ECX register before a call to ‘FUN_10001000’. Taking a look at this function we see straight away that the malware is moving the PEB (fs: [30]) into the EAX register. This is likely how the author identifies the address of the hashed APIs, by walking the PEB:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wULUAMhEghB7GRbWTWzVCg.png" /><figcaption>PEB Access Function</figcaption></figure><p>Going back to the function with the hash values — as previously mentioned, the values are pushed to ECX register and the next function is called to locate the address of the hash values in the PEB. We then see that the return value of the function (which is stored in EAX) is being moved into areas in memory marked as ‘DAT_1000XXXX’. My theory is that once the hash value is processed and the address of the API is located from the PEB, the value is then stored in segments of memory to be used in an another function. To test this theory, lets see where these data segments are used throughout the program:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JV_xXBr92FzBIidFoUFjLg.png" /><figcaption>Entry Point Using The Data Segments</figcaption></figure><p>Interestingly enough, once our hashed API function is executed and the API addresses are located from the PEB and stored in these data segments, we can see individual calls to the segments of memory where the de-hashed APIs are stored — pretty cool.</p><p>We identified our next payload and what appears to be the main functionality of this sample, the dll is a dropper which holds an embedded second stage payload. However, lets take a look at a few more of the imports this sample has, as there are not many:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z-Sbo2SfWNneacjFta4X1w.png" /><figcaption>Symbol References</figcaption></figure><p>We can see the sample has potential to create and write to a file, load libraries and get process addresses — also potentially used to dynamically resolve APIs. Taking a quick look at the LoadLibrary and GetProcAddress calls we can see that the malware loads Kernel32.dll and tries to get the process address for several unusually named APIs/Exports:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LUfjven5EaJrA0EoNy-sRQ.png" /><figcaption>Strange Dynamic API Resolution</figcaption></figure><p>The last piece of static code analysis I want to mention is the ability to format a string using the API wsprintfW, create a file using the predefined formatted string and then write to that file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-LbrfWiYPiKDIiMYSGmtsA.png" /><figcaption>More Functionality</figcaption></figure><p>One thing to note here is that, the sample appears to locate the embedded resource in the file, format a string, use the formatted string as a parameter to create a file and then write data to that file so this is likely going to be the unpacking technique used here — we can see in the above image that the string ’version1.0.tmp’ is also passed in above the call to CreateFileW so that is likely going to be our second stage file.</p><h3>Second Stage Payload Analysis:</h3><p>Lets extract the embedded resource using PeStudio which is a great tool for detecting and extracting both overlay objects and embedded resources:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yRf3H458GJQnCPS_z1NZzw.png" /><figcaption>PeStudio Analysis</figcaption></figure><p>Once extracted lets confirm the file type, doing so confirms that the embedded executable is in fact another dll file. Hashing the file and submitting the hash to VT proves our theory above. This next stage is named ‘version1.0.tmp’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SGRk6A9snasJkd8-7irG8Q.png" /><figcaption>VT Results For Stage 2</figcaption></figure><p>I confirmed that the embedded resource was another dll file, so lets drop that back into PeStudio and see what we can find:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DrMdW4F1UN_Z1_hru44onw.png" /><figcaption>Stage 2 PeStudio</figcaption></figure><p>So we once again have a dll file with another embedded resource — this time however, its a bit different. We can see from the magic bytes that the resource is in fact a ‘jpeg’ file (Exif). The resource also makes up over 98% of the file size, which tells me that this is no ordinary jpeg and is probably using steganography to mask the next payload:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*edoy4spxKrDSuNCRUf48mQ.png" /><figcaption>File Statistics</figcaption></figure><p>Lets keep this in mind for a bit later but first lets load the dll into Ghidra for some more static analysis.</p><p>But before doing so, lets look at our exports in PeStudio real quick:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*K9-nlBtyt3BhLXRFmYqM3Q.png" /><figcaption>Stage 2 Exports</figcaption></figure><p>These look familiar — remember in our first stage when we dynamically resolved process addresses using ‘GetProcAddress’ for strange looking APIs/exports? I think we may have found them.</p><p>Anyways over to Ghidra!</p><h3>Static Analysis of Stage Two: Ghidra</h3><p>This sample is quite similar as the first one where we once again see a repeat of hashed APIs which are passed into a function that utilizes the PEB. The return value is stored in a data segment that is directly called in other parts of the program. See below hash values and their corresponding APIs below:</p><ul><li>advapi32.dll!RegOpenKeyExW —<strong> </strong>0x3f4e3f88</li><li>advapi32.dll!RegCreateKeyExW —<strong> </strong>0x18e55858</li><li>advapi32.dll!RegCloseKey — 0x81c2ac44</li><li>advapi32.dll!RegSetValueExW — 0xba2a6615</li><li>kernel32.dll!LoadResource — 0x8e8bb14a</li><li>kernel32.dll!VirtualAlloc — 0xe553a458</li><li>kernel32.dll!GetModuleFileNameW — 0xff11445d</li><li>kernel32.dll!GetTempPathW — 0xe4f9f330</li><li>kernel32.dll!VirtualProtect — 0xc38ae110</li><li>kernel32.dll!FindResourceW —<strong> </strong>0x6608f55e</li><li>kernel32.dll!SizeofResource —<strong> </strong>0x42f9102e</li><li>kernel32!LockResource — 0xe8be94b</li><li>kernel32.dll!lstrcmpiW — 0x6a396fcc</li></ul><p>We mentioned earlier in the write up that this stage 2 dll file does have an embedded resource, which is a jpeg file. I wonder why the malware author wants to load a jpeg and why they want to hide the functions that do so? Also, the presence of VirtualAlloc and VirtualProtect here indicates that the sample is going to attempt to unpack code, likely from the resource.</p><p>I went ahead and renamed the data label to the corresponding APIs which made the code a lot easier to read:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uMgjrQslSvHTEaeCCBYOjQ.png" /><figcaption>Unpacking Function</figcaption></figure><p>The above snippet shows us how the malware will unpack the embedded resource — the sample locates the resource, loads it into memory, retrieves the size of the resource and then we see a tell tale sign of injection/unpacking. The malware allocates a region of memory with the following parameters to VirtualAlloc:</p><p>0x3000 = MEM_COMMIT | MEM_RESERVE, 0x4 = PAGE_READWRITE</p><p>Just after this we see a call to the VirtualProtect API, setting the newly created region of memory to executable by passing the flNewProtect parameter in with the value 0x20 — indicating PAGE_EXECUTE_READ:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FpQpY3YMnocK7RMeSKvHGQ.png" /><figcaption>Executable Memory Region</figcaption></figure><p>We discussed how the malware is going to deliver its next stage, let’s look at some of its other features next. The first export is named ‘Check_Installed’. In this export we can see the malware push the string ‘SOFTWARE\\DefaultEdit\\’ to the API ‘RegOpenKeyExA’, the malware uses the symbolic constant representation of the hKey ‘HKCU’ to open the key from here. We then see a call to ‘RegQueryKeyValueExW’ where it searches for the value ‘Installed’ — this is used to determine if the system is already infected or not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C3ffwbIEALQBtad8B8fmyQ.png" /><figcaption>Mutex</figcaption></figure><p>We then see the export ‘Set_InstallKey’ called after the fact — if the malware cant find the key in that location, it goes ahead and sets the value to the location mentioned above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gaGdxvsI-CcaH7VLnN5G2w.png" /><figcaption>Mutex Creation</figcaption></figure><p>Next up is an export named ‘ProtectMe’, in here we can find some strings related to virtualization software such as:</p><ul><li>“VMwareVMware”</li><li>“KVMKVMKVM”</li><li>“Microsoft Hv”</li><li>“XenVMMXenVMM”</li><li>“VBoxVBoxVBox”</li><li>“HARDWARE\\ACPI\\DSDT\\VBOX__”</li><li>“\\drivers\\vmmouse.sys”</li></ul><p>The majority of these strings are referenced in the function ‘FUN_100011c0’ where they are passed as a parameter to another function ‘FUN_10001920’. This is the anti-analysis/anti-vm technique the sample uses. The sample appears to be packed with ‘<strong>Xtremeprotector</strong>’, research online indicates that this protector does search for virtualization in a similar manner.</p><p>And last but not least we have an export named ‘OpenURL’. In here we can see the name of our next stage (potentially). We see the string ‘z9fda975_y1357_x9753_2025_07011514.tmp’ used in this function, just before we see a call to ‘GetTempPathW’, so it is likely that the malware is going to write this file to the TEMP directory on the victim machine. In here we also see calls to ReadFile and ShellExecuteA which can also be quite fruitful. Just to prove our theory above, I loaded the sample into the debugger and focused on the ordinal ‘OpenURL’, then set a Break Point on the CreateFileW API to see what would be created and where:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kAGBM3QgIno610Hb2cBerg.png" /><figcaption>Attempted File Create Event</figcaption></figure><p>Now lets take a look at the embedded image. There were no obvious strings in here, no interesting XOR’d strings either from what I could see however the image itself, I wasnt expecting:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*wDH8a__VooCQXx9B9Tep3g.png" /><figcaption>The Bro</figcaption></figure><p>Pretty non-chalant — anyways lets move to debugging.</p><h3>Stage Two Analysis — Debugging</h3><p>While debugging the sample I set BPs on both VirtualAlloc and VirtualProtect, as I know that these will be resolved at runtime from our static analysis section. I hit both of these BPs and observed the newly created memory region fill with null bytes, followed by nonsense data being written there. I was single stepping through the program then and came across a loop that used XOR to resolve debugger detection APIs. For example I seen the malware reference the NtGlobalFlag here which can be used to detect debugger presence.</p><p>I then observed the malware change the memory protection of an area in memory. Not long after this I came across something that seemed odd, the malware was calling the EAX register — sometimes we see APIs be stored in registers but this was just a memory address which seemed somewhat unusual, especially after a call to VirtualProtect. So I followed said memory in the dump section. Given this segment was given executable permissions and the data present there doesn&#39;t resemble a particular file type, this may hint at shellcode:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XNVha__Cm8y-os16GRqk0Q.png" /><figcaption>Calling Memory Address</figcaption></figure><p>To confirm the memory protection of this address, I followed it in the memory map and could see that it was set to executable:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*bk-CiORHKtkpRqIJJJiJbQ.png" /><figcaption>Executable memory location</figcaption></figure><p>Dumping this data from memory and using a tool called xorstrings, we identified some suspicious API calls XOR’d with key 29:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*LhsI9Osy9qGll-rRXYU3jQ.png" /><figcaption>XorStrings Output</figcaption></figure><p>While this is certainly interesting, I continued debugging the sample and came across more calls to VirtualAlloc and VirtualProtect with a similar looping function. After completing the loop and not taking the conditional jump, our newly created area in memory populated with those sweet magic bytes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*OW7hHuPcGyjxVzS4V242Rw.png" /><figcaption>Loop That Unpacks The Exe</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*svB8_1eVXfE4dI6bLLUj3A.png" /><figcaption>Unpacked Executable in Memory</figcaption></figure><p>Dumping this from memory and dropping it into PeStudio, we <em>may </em>have our final stage:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5YDTsL6U8EpI6HIzVTQrPw.png" /><figcaption>Stage 3 PeStudio</figcaption></figure><p>Searching the hash on VirusTotal shows that is has also never been uploaded:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9i1GZGyDkwkl58aVbfiZWg.png" /><figcaption>VT Results</figcaption></figure><p>Staying in PeStudio we can check out the indicators tab, in here we can see a bunch of URLs which are possibly used for data exfiltration from compromised systems/networks using APIs:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qtvxHRio8_tLuxjEyS7yYg.png" /><figcaption>Indicators Tab</figcaption></figure><p>Before looking at this however, lets see if we can get any more IOCs from our stage 2 dll file. Back in the debugger, I continued running the sample and actually hit more calls to VirtualAlloc. Following the allocated memory in the dump section I seen more null bytes however, I started single stepping through the program and shortly after observed a call to a memory address.</p><p>The called function actually resolves an API called ‘RtlMoveMemory’, once executed it populates the allocated memory region with a PE header. This API is a native API so it may bypass some API hooks. However, this call only fills the PE header into the dump section. Shortly after we came across the same function which actually completely unpacks another executable file into memory, this process repeats over and over again while dynamically resolving native APIs, pretty cool. One unusual thing to note here is that the newly unpacked file is completely missing its IAT, however there are strings present that resembles those in our stage 3 dll that we unpacked. Also interesting to note that the malware resolves another native winAPI ‘RtlFillMemory’ to corrupt the PE header of the file located in the dump.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*-pm6mRIeZYgu7goaCbDQ3w.png" /><figcaption>Another Unpacking Technique</figcaption></figure><p>Still working on stage2 dll, we see a .dat file being created in the ‘C:\Windows\14613.dat’ location:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CHIjPowQFg88gfxwGNRtLw.png" /><figcaption>Newly Created File</figcaption></figure><p>This file is never written to however, and is shortly deleted after. I did come across a SystemBiosVersion string shortly before the delete function so it is possible the malware detected the virtualized environment and stopped the flow of execution. While this was interesting to note, no real indicators were gathered from it and the additional file (stage3.5) doesnt provide much use to us as it seems very similar to stage 3, going by the strings present.</p><h3><strong>Stage 3 Analysis:</strong></h3><p>At this stage this write up is pretty long so I&#39;m going to try speed it up for this next part. Looking at stage 3 in Ghidra we see a whole bunch of interesting APIs which is shown in the PeStudio screenshot a bit above, we see an area in memory being allocated executable permission so that&#39;s definitely something we want to look at. We also see a bunch of internet associated API calls so they&#39;re also a point of interest for us. Along with file creation capabilities and much more so lets hop straight into our debugger and focus on the interesting APIs. My main interests with this file is the following functionality:</p><ul><li>WinHttpOpen</li><li>WinHttpConnect</li><li>InternetOpenUrlA</li><li>ShellExecuteA</li><li>ShellExecuteExA</li><li>VirtualAlloc</li><li>OpenProcess</li><li>CreateThread</li><li>GetTempPathA</li><li>CreateFileW</li><li>CreateToolhelp32Snapshot</li><li>GetTempPathW</li><li>WriteFile</li><li>CreateDirectoryW</li><li>ReadFile</li></ul><h3><strong>Stage 3 Debugger Analysis:</strong></h3><p>I hit a bit of a snag here — turns out the stage3 dll we dumped from memory has no exports so we couldn&#39;t debug it properly. I did however discover that in our stage 2 dll, the stage 3 is loaded into memory and executed which provides us with the IAT it uses. So in theory, we can debug stage 3 dll from stage 2. I proved this theory by attempting to set bps on ‘WinHttpOpen’, this was failing due to an invalid address error. However, when our stage 3 dll was loaded into memory and executed, our new imports were available for break points.</p><p>Anyways, we hit our first one — ‘WinHttpOpen’. This creates a connection to the url:</p><ul><li>Mozilla/5.0 (compatible; Googlebot/2.1; +hxxp[:]//www[.]google[.]com/bot[.]html)</li></ul><p>We then see a call to ‘WinHttpCrackUrl’ where the parameter is set to the following:</p><ul><li>hxxps[:]//api[.]pcloud[.]com/listfolder?path=/</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v_OQxw18lDyo1OqHc2FoBQ.png" /><figcaption>WinHttpCrackUrl</figcaption></figure><p>This is followed by a call to ‘WinHttpConnect’ to the domain:</p><ul><li>api[.]pcloud[.]com</li></ul><p>A GET request is then sent to the following using the API ‘WinHttpOpenRequest’:</p><ul><li>api[.]pcloud[.]com/listfolder?path=/</li></ul><p>After this I noted a call to ‘WinHttpAddRequestHeaders’ where the request is as follows:</p><ul><li>User-Agent: Mozilla/5.0 (compatible; Googlebot/2.1; +hxxp[:]//www[.]google[.]com/bot[.]html<a href="http://www.google.com/bot.html)/r/nAccept">)\r\nAccept</a>: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\r\nAccept-Language: en-US,en;q=0.8\r\nAuthorization: Bearer U1XD7ZzVoRYfYDIfLZhPK7ykZ43rMhs5ej88WQ78GctvXupdkFGXy”</li></ul><p>Stepping though this part of the program I found myself having to invert a decent bit of the logic due to the connections failing and then going down the exception handling rabbit hole. This however resulted in a pretty constant loop of attempted connections.</p><p>Moving onto debugging a different ordinal, we can see that the malware tries to open the registry key “HKLM\\HARDWARE\\ACPI\\DSDT\\VBOX__”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AaTcN_qEk3maS0EHoQRHww.png" /><figcaption>VM Detection</figcaption></figure><p>To get around this, we can invert some of the conditional jumps the program will take. For example, if the key is found — the program takes a jump to a function where it will terminate the process. This was proving difficult though as it kept ending up terminating the process no matter how many conditionals I inverted.</p><p>We can also see the program creating a registry entry for ‘’HKCU\\SOFTWARE\\DefaultEdit\\” which is followed by setting the value to ‘Installed’, which we seen in our static analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/1*jg7sRmKCoFDe07y4LVJ6iw.png" /><figcaption>Install Key/Mutex</figcaption></figure><h3><strong>Conclusion:</strong></h3><p>I’m going to wrap up this analysis here but lets summarize what we found. We identified a Dynamic Link Library that leveraged API hashing. These were resolved by accessing the PEB. These hashed APIs provided functionality to the program to load a resource from the resources section.</p><p>The embedded resource was another dll file, this file used similar techniques such as API hashing to hide some of its functionality. Among the hidden functionality were APIs to load a resource, allocate virtual memory and then change the permission of the allocated region. We also noted that the resource embedded within was a JPEG file type. The JPEG was using steganography to mask the dll embedded within which was our next stage. We extracted the next stage from memory of stage 2 however were unable to debug it directly so we had to try to debug it in the memory of stage 2. This is known as fileless execution as the dll never touches disk.</p><p>The sample did have VM detection capabilities which hindered the analysis from going any further but at the same time, a number of host based and network based IOCs were gathered.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=14f371d13adb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bumblebee: Malware Analysis]]></title>
            <link>https://medium.com/@coormac/bumblebee-malware-analysis-be38f76d78ab?source=rss-48ba9f718b24------2</link>
            <guid isPermaLink="false">https://medium.com/p/be38f76d78ab</guid>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[supply-chain-attack]]></category>
            <dc:creator><![CDATA[Cormac Conlon]]></dc:creator>
            <pubDate>Sun, 15 Jun 2025 18:41:39 GMT</pubDate>
            <atom:updated>2025-06-15T21:02:43.774Z</atom:updated>
            <content:encoded><![CDATA[<h3>Intro</h3><p>Given the recent supply chain attack of several open source tools, I decided to take a look at a sample myself. For those who don&#39;t know, multiple open source tools were identified spreading malware known as ‘Bumblebee’. This malware is a custom loader, typically delivered through MSI and ISO file types, the malware relies on DLL sideloading techniques to achieve its goal of execution. The sample used the legitimate MS application ‘icardagt.exe’ as the vulnerable application to proxy the DLL ‘version.dll’ in order to execute the malicious payload.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VWxCdSDpmyZIKrHkwS9yRA.jpeg" /></figure><h3>IOCs:</h3><ul><li>8f424f4d327cb1032a0d6679d6d42ac44614131ecabd544244d03808c8b32e30 *Wireless_Network_Watcher.msi</li><li>885dd208cd794ff755e15de13ca2918b2a60bfb98d4449216e774929bb21a583 *FILE_InstallMeAny</li><li>473d17e571d6947ce93103454f1e9fe27136403125152b97acb6cad5cc2a9ac7 *FILE_InstallMeExe</li><li>a09923899b318848d44dc706ccc1d3489a383b9af0921351134d14a152a7925b *FILE_InstallMeDll (Payload)</li><li>hxxp[:]//19ak90ckxyjxc[.]life — C2 Domain</li></ul><h3>Tools:</h3><p>Lets discuss some tools we can use to aid us in our analysis of MSI files, since these file types are in fact OLE (Object Linking and Embedding) type files we can use toolsets such as the OLE toolset. These same tools can be used for certain MS Office files also and allow us to dive into the streams that make up the file. The tool we will use for this sample analysis is called oledump, this allows us to view the streams in the installer itself. We can identify embedded objects using this technique and then dump the contents if we identify a suspicious object, allowing us to take our analysis a step further.</p><h3>Analysis:</h3><p>Starting off our analysis, lets confirm the file type and gather the file hash.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3U0OxibXH7-AFQqgHmIvUA.png" /><figcaption>File Type and Hash</figcaption></figure><p>Next we can run oledump against the file since we have confirmed it is in fact an MSI. The output of the command will show us several different streams which are encoded, we will also be able to see the size of the streams here. A general rule of thumb is to focus on the larger streams as these are more likely to hold items of interest. Such as embedded executables or in most cases CAB files, which are cabinet files. These can hold several files within, sort of like a zip file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*7KYj5monml1Od6sA7YYfug.png" /><figcaption>Oledump Output</figcaption></figure><p>Taking the above into consideration, we can focus our attention on stream 4 as this is quite large and definitely an avenue we want to explore in our investigation process. A quick tip here, we can run the oledump command and specify a stream number followed by the -T parameter to show the first bytes of the stream, in our case if we ran this against stream 4, we would see that the first bytes contain the magic bytes ‘MSCF’, indicating that the object embedded here is a cabinet file. We can go ahead and dump this object by running oledump, specifying the stream number and the -d parameter, direct the output to a file named something like ‘dump.cab’. Then we can run ‘file’ against the dumped object to confirm everything went smoothly:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6j8SW2XSJqCyhnVlSse0Lw.png" /><figcaption>Dumped File Type Confirmed</figcaption></figure><p>Now we confirmed the dumped object is a CAB file that contains 3 files, lets dive into this next.</p><p>To view the contents of the CAB file, we can just unzip it using 7zip. We can run the file command against these files to confirm the file types that we are working with, also don’t forget to gather the file hashes at this point.</p><h3>CAB Content Analysis:</h3><p>From gathering the file hashes and reviewing OSINT, we can hypothesize that the payload delivery technique uses a DLL sideloading technique known as DLL search order hijacking. This technique abuses the way that the windows OS loads DLLs by placing a malicious DLL with the same name as a legitimate DLL in the same folder as the application that’s vulnerable to the hijacking technique. By doing so, the attacker takes advantage of the search order that the windows OS uses when loading libraries. In our case, this looks to be either “icardagt.exe” or “Wireless Network Watcher”. The most likely vulnerable application here being ‘icardagt.exe’ as this is a legitimate and signed MS binary and runs with system privileges, allowing the malicious DLL to execute without any restrictions.</p><p>Something to note here however is that the DLL we suspect that is going to be used for hijacking currently does not have the same name as any legitimate DLLs (File_InstallMeDll), which is a bit of an inconvenience. Let’s focus on this DLL and perform some static analysis to try identify what it will run as when launched. We will be using both PeStudio and DetectitEasy for our static analysis.</p><h3>Dll File Analysis:</h3><p>Since this is a Dll file, we can view the exports the Dll has to offer to give us a better understanding of the functionality the file will provide. Doing so leaves us with some interesting information — this Dll appears to forward exports from a legitimate DLL known as ‘version.dll’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wyrmzRcpJDbuR09Ubf1RrA.png" /><figcaption>DLL Comparison</figcaption></figure><p>On the left hand side we can see the legitimate ‘version.dll’ exports directory, and on the right we can see our malicious Dll and the exports it uses. We can see our malicious Dll forwards a bunch of exports from the legitimate Dll, likely using a technique known as Dll proxy forwarding.</p><p>We’ve located the Dll that our suspect malware masquerades as, now to perform some static code analysis on it to try understand the intentions. Typically with Dll files an initial point of interest should be the exports directory, which we can see above. However, with this particular sample the file does not seem to have any custom exports - just those forwarded from the legitimate ‘version.dll’. Checking the offset of these exports in Ghidra just brings us to a table of pointers, which end up referencing the location ‘C:\Windows\System32\Version.dll’ which is not much use to us trying to locate malicious code. So taking that into consideration, lets move our analysis over to the IAT. Its probably worth noting at this point that the Dll is in fact packed and has ASLR enabled, so we want to make sure to disable that before going any further.</p><p>While looking through the IAT of our sample I noticed something unusual, calls to certain APIs had an extremely high count, for example ‘AddAtomA’. All of these references originated from the same function so I decided to focus on that. See below image for reference of function size, compared to other functions in the file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JKhOXg6SlgXjlZP6Av-8Fw.png" /><figcaption>The Big One</figcaption></figure><p>Within this function we noted a bunch of randomized strings passed into API calls such as ‘CreateFileW’, ‘AddAtomW’, ‘SetEndOfFile’ and ‘DeleteAtom’. With this information, lets move to debugging this specific function with the help of x64dbg.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gNNLEZnPbmXzJ_2rsFCNjg.png" /><figcaption>Randomized strings previously mentioned</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Li9TwKWglVNm6kmtpvIUJw.png" /><figcaption>More Randomized Strings</figcaption></figure><p>While debugging this Dll I set breakpoints on some of the API calls that were in the function mentioned above, CreateFileW and SetEndOfFile were the main ones I was interested in as I wanted to see if this sample attempted to create and modify another file, the sample also uses the WriteFile API so there is potential for a file to be created and written to.</p><p>However, I was stuck in a continuous loop of ‘AddAtomW‘, ‘SetEndOfFile’ and ‘NtQueryInformationFile’ where the return value was showing an error of STATUS_OBJECT_TYPE_MISMATCH. The same process is iterating through 2 randomized strings repeatedly, ‘BggxHewj5wRu Numerals’ and ‘YYFIL’. Where AddAtomW adds the string to a local atom table, SetEndOfFile then attempts to modify the predefined atom string and the native API NtQueryInformationFile returns an error, possibly due to the variable being a defined string in an atom table, and not a file on disk. The more I iterated through this function, the more I thought this may just be junk code, used to distract analysts.</p><p>I decided to remove the breakpoints on AddAtomW and SetEndOfFile as they were not providing any valuable insights and instead focused on CreateFileW to see where these randomized files were being created on the machine. With the help of procmon, I confirmed that these too were also failing due to PATH_NOT_FOUND.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s8Gl57qwH9tr_jqWDbTfmw.png" /><figcaption>Procmon Results</figcaption></figure><p>At this point I didn’t really have any stand out items to hook onto, so I began single stepping through the program while watching the actions performed by the sample in question. While single stepping we noted the file call APIs that are frequently used for timing checks, however with the help of ScyllaHide we can bypass the majority of these.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gHcnsLJ71-WqoZdcEoLKuA.png" /><figcaption>Potential Timing Checks (Debugger Detection)</figcaption></figure><p>We then came across several calls to MultiByteToWideChar, after a number of hits on this breakpoint we observed the string ‘Select * From Win32_ComputerSystemProduct’ — this command line will gather all the information about the current system, and is another possible VM detection/anti analysis technique embedded in the program.</p><h3>Dynamic Analysis:</h3><p>So at this point, it was proving difficult to unpack and locate the payload that we know is there — so I changed my analysis technique to dynamic analysis. From this we confirmed a few things that I previously hypothesized, for example — at runtime, the Dll ‘File_InstallMeDll’ is renamed to version.dll. We also observed icardagt.exe loading the malicious Dll along with the legitimate version.dll, proving the sideloading/proxying technique we assumed earlier on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KOMtjShhiGwUCIdbHf6VeQ.png" /><figcaption>Dll Loaded at Runtime</figcaption></figure><p>I also identified the sample creating a registry key under:</p><ul><li>‘HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S****\Products\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1–5–18\Products\CBE574DD169D4FA4BBA8EB19AF497275’</li></ul><p>Under this location I found an app license associated with the install, though it seems to be nonsense:</p><ul><li>‘k&amp;iyig$}TAt*W(*Pu1R’*7nECn(it8B5g-LT4{mn’</li></ul><p>We also observed the execution attempting to create a bunch of files from the injected process, all of which failed — similar to what I seen earlier using the debugger:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nws4NN2c4jEJAbPlHgqapg.png" /><figcaption>Attempted File Creation</figcaption></figure><p>On top of this, I identified network connections to a ‘.life’ domain ‘hxxp[:]//19ak90ckxyjxc[.]life/’ during our dynamic analysis. This domain does look randomly generated however so it is possible that the sample has some form of DGA algorithm within.</p><p>When executing the installer file, a new directory is created under the user appdata/local/temp directory called ‘ApplicationInstallationFolder_11’:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3SbWGNm_E-MW-jEMUlCurw.png" /><figcaption>Newly Created Directory</figcaption></figure><p>I attempted to load ‘icardagt.exe’ into the debugger from the same directory the files in the MSI resided also, but had no luck observing the malicious Dll execution. I did observe the binary loading ‘version.dll’ from system32, but no artifacts that resemble what I observed from dynamic analysis of the MSI file, hinting that may be a key piece of the puzzle to achieve the full execution of the payload.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be38f76d78ab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rhadamanthys Stealer: Malware Analysis Part Two]]></title>
            <link>https://medium.com/@coormac/rhadamanthys-stealer-malware-analysis-part-two-04b8747c6498?source=rss-48ba9f718b24------2</link>
            <guid isPermaLink="false">https://medium.com/p/04b8747c6498</guid>
            <dc:creator><![CDATA[Cormac Conlon]]></dc:creator>
            <pubDate>Thu, 19 Dec 2024 21:52:24 GMT</pubDate>
            <atom:updated>2024-12-20T10:24:52.040Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/299/1*-EkiMMsMWtv-G6g7Wf3fwg.jpeg" /></figure><p>Today we will be continuing our investigation into the Rhadamanthys Stealer, we have already documented a part one to this write up so check that out if you haven&#39;t already!</p><p>Before getting started with the next part, lets summarize our previous write up:</p><p>A malicious PDF was sent to the victim via a phishing email, this PDF had an embedded URL that when clicked, directed the victim through a referrer URL and initiated a drive by download. The file that was downloaded masqueraded as an invoice and as a PDF however, the file was an obfuscated JS file. Once executed, the script reaches out to another domain and pulls down and executes an encoded PowerShell script using the IRM and IEX cmdlets. This script had several functions which included persistence, removal of artifacts left on the host, sleep functions to evade detection and last but not least a function that reflectively loads malicious files into memory via RegSvcs.exe which can be abused by actors in the wild to bypass application whitelisting.</p><p>In our last write up we stated that the script compiles two sets of data together and creates an executable however this was slightly incorrect. The script actually loads the ‘crypter’ into memory first and then invokes a method within the crypter to execute the final executable. See below images for the function that does so, please also note that both of these files are .NET assemblies:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*_U7HBf10OM9cHKGiYjvoMQ.png" /><figcaption>Obfuscated Function</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lVVQUdxIRuUrplUKJxWKtA.png" /><figcaption>Deobfuscated Function</figcaption></figure><p>So, from the above script we can see that the malware is going to reflectively load $data1 into memory to avoid writing itself to disk, it then joins A.B together which is a ‘type’ in the $data1 executable, it then retrieves method ‘C’ from the ‘A.B’ type. Method C is then invoked to launch/register the second executable ($data2) under the context of RegSvcs.exe.</p><p>Anyways, that&#39;s just a bit of a refresher on the previous write up and correcting some of the behavior that I incorrectly analyzed. We’ll move on to actually taking at these binaries now!</p><p>So we will kick start this with ‘$data1’, we will also be referencing to this as the ‘Crypter’ from here on out given the naming convention ‘newcrypternoprocess.exe’.</p><p>First thing we are going to do here is to confirm the file type, we have done this a number of ways previously however just to speed up the analysis lets load the PE into DetectItEasy to give us a break down of what to expect:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*APOoKS2Jrw91_y1G-KmdEQ.png" /><figcaption>File Information</figcaption></figure><p>Looking at the above we have confirmed that the file is a .NET executable and appears to be written in C#. We can also see that this particular file appears to have been signed, if we navigate to the overlay section in DIE we can see that there are several signatures and references to digicert, verasign and symantec however, this may be an attempt to hide the files true intent and bypass some AV solutions. Another item of interest when analyzing potential malware is to look at the IAT (Import Address Table) as this holds the libraries the malware is going to use to perform its activities. Each library (dll) contains APIs that malware authors will abuse to carry out nefarious actions on target systems. However, looking at the IAT of this file shows there to be only one import:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pltes31bIBmEfVUYCfTaoQ.png" /><figcaption>Import Address Table</figcaption></figure><p>Lets move over to pestudio for some more static analysis, we see here that the certificate in the file is not verified which is a big red flag:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*5g-8y5se0Bd2y41OosBQHg.png" /><figcaption>File Signature</figcaption></figure><p>Next, reviewing the indicators tab shows us some of the items that the tool has deemed as suspicious, we see that the digital signature mentioned above did not verify and we also see some libraries/imports being flagged.. but the IAT of the file only shows one import, mscoree.dll.</p><p>So instead of having the imports hardcoded into the IAT where traditional AV/EDR systems could detect suspicious libraries/APIs, the malware will actually load them dynamically upon execution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lhdW0vwWon9jIAm7B9bF1A.png" /><figcaption>Pestudio Indicators Tab</figcaption></figure><p>Looking at some of the strings in this program we can identify what appears to be API calls that mimic process hollowing techniques. We see reference to unmapping sections (used to unmap memory in a running process, so malicious code can be injected), writeprocessmemory, allocatevirtualmemory and so on. We also see reference to ‘payload’ in the strings here, this payload reference is actually located in the C method of the class A.B. All of these would be considered suspicious given the context thus far:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*53rOsoHH7W8JC4SEminzIw.png" /><figcaption>Suspicious Strings in Program</figcaption></figure><p>Anyways, lets move on to decompiling this sample, to do this we will be using DnSpy! Firstly though, since this a .NET binary lets run it through de4dot to clean up any obfuscated symbols etc.</p><p>Once loaded into DnSpy, straight off the bat we can see the types/methods that were previously referenced in our PowerShell script that would have loaded these files into memory. Method C was passed into $data2 and executed under RegSvcs.exe however, before looking at this method lets check out some of the other functionality. We have a couple of methods in this binary that grab our attention. We have the C method, KimKarden, SplitintoChunks and then a few APIs that are loaded upon execution, all of which are located in the A.B class however, if we go to the class above, we see what looks like a CLSID (FE3C441D-DF9D-407b-917D-0B4471A8296C). CLSIDs are essentially unique identifiers that are used to identify a COM object, given we know that the file will be executed under regsvcs.exe which is also used to register .NET COM assemblies it is likely that the above string will be used as the identifier of the malware:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-ViNh34JSbRr8HqvpjijNg.png" /><figcaption>Methods of Interest</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vzYztem5piG7P5vtiqe5aw.png" /><figcaption>CLSID Class Functionality</figcaption></figure><p>The above function is quite clearly obfuscated as it is labeled at the top however, the class will essentially utilize reflection and dynamic method delegation/generation at runtime. The author of this sample made it pretty hard to statically reverse engineer given all the loops we have to jump through :’)</p><p>Lets take a look at method C and try to figure out what it will achieve when loaded into memory. From a quick glance, we can see reference to ‘payload’ all over the method which to me would hint that this code is going to be injected into the next process ($data2). We can see reference to a bunch of APIs that mimic process injection techniques wherein a process will be created, memory will be unmapped from said running process (memory manipulation) to create space and malicious code will then be written to that area in the running process. Thread context is then manipulated by modifying the thread context of the target process thus allowing the code to execute. The process is then resumed and the injected code is executed which is very similar to process hollowing techniques. In the event this process fails, the process will be killed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B66GSktKtnH3Nb1Z9qsvSg.png" /><figcaption>C Method</figcaption></figure><p>Alright we have a fair idea of what the ‘crypter’ is going to do at runtime — let’s move on to the final payload now which is the ‘$data2’ (Stealer). Like the above, this next sample is heavily obfuscated and encrypted so it is really difficult to analyze even when running the program in a debugger, so we may not get too much detail out of this last part however so far we have identified a bunch of IOCs relating to this investigation, some pretty nifty obfuscation and defense evasion techniques including but not limited to reflection, dynamic delegate generation, dynamic loading of APIs, and encryption.</p><p>Were going to jump straight into DnSpy for this next sample and skip the usual investigation steps just to to try shorten this write up a bit. However, we will mention that the file only has one import in the IAT which is the same as the first sample, mscoree.dll. The sample also has raised flags for highly suspicious strings relating to decrypting, decoding and memory streams. We also see reference to the RijndaelManaged class. Remember that in the previous file we mentioned that there were classes that referenced ‘SplitIntoChunks’ along with references to padding — this is likely going to be part of the decryption process used to deliver the final payload. Anyways, on to the analysis! P.S we also ran this sample through de4dot.</p><p>Opening the sample in DnSpy we see reference to Ascii85 — hinting that this particular sample is going to be decoding ascii85 strings to its raw byte representation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bo0ZRavfikmNmFH5WPHz2Q.png" /><figcaption>Ascii85 Function</figcaption></figure><p>In the next class ‘CodeGen’ we see a public and a private shared function passed in before a huge block of encoded data. The two functions passed in are references to decoding operations to decode the strings of data from Ascii85 and ‘flutter’. At runtime, these operations will dynamically decode the strings into a memory stream in their raw byte form:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CS74CSnAHkBzLww1b_6zgA.png" /><figcaption>CodeGen Class</figcaption></figure><p>If you look at the scroll bar on the right side, you can see how massive this class is — trying to statically decode these strings will be near to impossible, especially at my current level! However, we do know how they will be decoded and which algorithms will be used to do so. See the decoding algorithms below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h5WIAVeEWm1ZzG8XyY1oow.png" /><figcaption>Flutter Decode</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fo0h97-ALbYJq6-z66Uvag.png" /><figcaption>Ascii85 Decode Function</figcaption></figure><p>Moving on down to the last two methods in the sample we come to what is called ‘Redist’, this is the original name of the executable file. In here we have an encryption algorithm used to decode and validate data. The function named ‘decodepkt’ will essentially allocate a byte array to work with the data being passed in, the code then proceeds to set up decryption using the Rijndael encryption algorithm along with CBC and PKCS7 for padding. When the data has been decrypted, it then decompresses it via GZIP and writes it to a memory stream. This may be indicative of shellcode injection or once again building an executable in memory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kfkgOq3mRPAYl1PvrerT7g.png" /><figcaption>Decodepkt Fcuntion</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NzQ69WTZequuAlOuBbV4ZA.png" /><figcaption>Main Function</figcaption></figure><p>Last but not least we once again see reference to the previously identified CLSID (I think) — this is likely used as reference to identify the target process for injection by the crypter.</p><p>Okay so that was a brief run through of the assemblies in a decompiler however, I believe that to fully understand the functionality of these files they need to be invoked together, sort of as a chain reaction as from analysis it seems that both of the files work in parallel for the decryption process.</p><p>So just to give a breakdown of all the stages in this infection from initial access to payload delivery:</p><ul><li>Phishing email delivered to victim with a weaponized PDF.</li><li>PDF contains an embedded URL that initiates a drive-by download and refers the victim to bookingdotcom to appear less suspicious.</li><li>The downloaded file masquerades as an invoice and a PDF.</li><li>Once executed, the obfuscated JS file will reach out to a remote domain and utilize IRM and IEX cmdlets to download and execute an encoded PowerShell script. The obfuscated JS script will then delete itself from the infected machine to remove any remnants of nefarious activity.</li><li>The encoded PowerShell script has multiple functions, it decodes octal encoded data to reveal further functionality. Some of the encoded data revealed further hex encoded strings that when decoded and converted from raw bytes formed an executable file, we observed this on two occasions. Other octal encoded data revealed a persistence mechanism in the form of registry run keys utilizing MSHTA.exe to download and execute a similar script as seen above, when converted to a binary file we observed another strain of Rhadamanthys.</li><li>This script then used reflection techniques to stealthily load these executable files into memory using PowerShell. The crypter was loaded into memory first and the C method (payload) was called from the AB class likely to inject into the stealer file, this was registered as a COM object utilizing RegSvcs.exe.</li><li>The crypter utilized a number of evasion techniques ranging from dynamically loading APIs/Libraries to hollowing out processes for injection. We also observed this sample make reference to padding and encryption functionality.</li><li>The stealer malware utilizes algorithms to decode data from base85 to raw byte format.</li><li>The sample also uses public functions to decode large strings of data using previously referenced algorithms. These strings will be dynamically decoded at runtime.</li><li>We also made note of a decryption and decompression function that will utilize Rijndael encryption to decrypt a byte array. When the data is decrypted it is then decompressed using the decodepkt function and written to a memory stream.</li></ul><p>We are going to end this write up here however do note that we attempted debugging these programs without much luck, we observed child processes in the form of conhost.exe spawn from both binaries which may have been used for process injection however this was not confirmed. All samples have been uploaded to malwarebazaar and VirusTotal, virustotal states this malware injects into svchost and communicates with its C2 hosted on: 185[.]196[.]11[.]18</p><h3>Conclusion:</h3><p>This particular infection showed sophisticated delivery methods wherein malware was reflectively loaded into memory along with obfuscated and encrypted code within. The usage of process injection techniques and LOLBAS references via MSHTA for persistence and RegSvcs for execution shows the intricate defense evasion techniques utilized. The observation of dynamic API loading also shows this sample to be more complex than previous samples we have analyzed, along with the usage of memory streams to further inject data into processes. Although Rhadamanthys is seen as commodity malware, the particular infection chain from delivery to compromise does show a level of sophistication and complexity.</p><h3>IOCs:</h3><ul><li>Hxxps[:]//ipfs[.]infura[.]io/ipfs/QmNPCaSYzPMoeDKfBtaW64FvTbgYL117ZYMHtXnMYThYS1 &gt; hxxp[:]//www[.]booking[.]com/invoice-1620804301[.]pdf</li><li>hxxps://11-22hoot[.]blogspot[.]com////////////////////lora[.]pdf &gt; hxxps[:]//bitbucket[.]org/!api/2[.]0/snippets/chutiyamahi/q7Bo4x/be44a5fed3fe78b384dd1cbea5e223ef1a376ad2/files/hotelnewspam[.]txt</li><li>023c81b760f9b163127e7124b96a889ec97c94893e97bf901dac59ad7dd1c573 — lnvoice-1620804301.pdf .js (stage 1/2)</li><li>84723a4177fc2c97dc284a9bfcca050e2e30835ca074a2fe1bfb5314d2506d5e — lnvoice-1620804301.pdf (1).js</li><li>fdc8f07b5df52dced58da1140c1fc2a1256042b4ffa0a26f350e67d591c1e6c6 — Stage 3 (script from bitbucket URL)</li><li>b3151f80157ada76890ffe2c4901f8c1b787be99a38bece61263984c7b8f830d — Compiled data into exe (newcrytpernoprocess)</li><li>bb2fcf5aa1e32025dc703790b248d6e316f0f2980bcbdf6340b86027f025541d — newcrypternoprocess.exe</li><li>dc4e6d0d214d0e62dd445a4dbbd875ebd1e895cf834989437956f873f624ec10 — rhadamythas_stealer.exe</li><li>8609656888471641587885cbc54e49ba5dbfb994dab23e388c5075e13713fecc — Stealer binary downloaded from scheduled task.</li><li>185[.]196[.]11[.]18 — C2</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=04b8747c6498" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rhadamanthys Stealer: Malware analysis Part One]]></title>
            <link>https://medium.com/@coormac/rhadamanthys-stealer-malware-analysis-part-one-b3942f8e66d0?source=rss-48ba9f718b24------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3942f8e66d0</guid>
            <category><![CDATA[infosec-write-ups]]></category>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <dc:creator><![CDATA[Cormac Conlon]]></dc:creator>
            <pubDate>Thu, 05 Dec 2024 09:38:02 GMT</pubDate>
            <atom:updated>2024-12-05T10:04:30.003Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/256/1*BoRjylRyQY0LIjU2Du3gGQ@2x.jpeg" /></figure><p>Today we will be looking at a PDF file which was gathered from MalwareBazaar. This particular sample has embedded URLs that when clicked, send the victim through a referrer URL that initiates a drive-by download in the backend, all while directing the clicker to a booking.com domain. The file which is downloaded is a JavaScript file that masquerades as an invoice and also as a PDF. When the victim opens this, an obfuscated script is run which reaches out to another domain and copies a script via IRM and then executes it through IEX. This next stage then creates and executes a .NET binary, this binary also has an embedded executable within which we were able to extract during our analysis. From the presence of the compiled file, we noted two different aspects, one of which appears to be a Cryptor for the final payload which is the meat and potatoes of this write up — <strong>Rhadamanthys Stealer.</strong></p><p>The file we will be analyzing today can be found on MalwareBazaar by searching the below hash value:</p><p><strong>09c42b8d83803d156de74d61fe14cc06072599442a6da4212e8a588c3df9a7ad</strong></p><p>To get started with our analysis lets go ahead and confirm the file type we are working with, from previous write ups we know that this can be done a multitude of ways, we will run TRiD and File against the sample to verify we are looking at a PDF file, we can also look at the first bytes in a hex editor:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*W7V5UarE-I5SRqXzEfQCmQ.png" /><figcaption>Confirming File Type</figcaption></figure><p>Moving on, we can start to look at the structure of the sample for any items which may be deemed as suspicious. PDF files are relatively easy to analyze given they contain data streams. One of my favorite tools for doing this is ‘peepdf’ as it breaks down the structure/content of the file pretty nicely and has an interactive mode we can use to hone in on the items that we feel warrant further investigation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4QRMIabpygJUhYAlqpKIaw.png" /><figcaption>Peepdf Output</figcaption></figure><p>So we can see that there is a bunch of objects in this PDF and a few items of interest, especially the objects that contain JS code, so lets look here first.</p><p>It is worth noting here that it may not be uncommon for PDF files to contain JavaScript however, it is also often abused by actors in the wild so it is always worth reviewing these objects for any signs of nefarious activity.</p><p>We can run the same command as seen above however we are going to add a ‘-i’ parameter to make the output interactive. We can then type ‘help’ to bring up a menu of commands we can run to dig in a bit deeper:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v_8SNe9ieRjFCj_TsDa4EA.png" /><figcaption>Additional Output</figcaption></figure><p>There is a lot to look at here given the high number of URIs, JS and encoded objects. However, as an example, lets look at object 35 to start off, given it is a JavaScript object and might have some interesting features in it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nLrAje1egtwkN2euBV1ygg.png" /><figcaption>Object 35 Contents</figcaption></figure><p>So we have a long string of what looks to be all the URLs in one clump however, we can clearly see a URL referencing another URL, which is booking[.]com related. Again for example, Lets look at object 9, maybe it will be a bit clearer:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EKAGmmUHc-zup_wYUGY24g.png" /><figcaption>Object 9 Contents</figcaption></figure><p>Yep, definitely a bit clearer! So we can assume here that the victim will click a URL in the PDF, they will then be directed to the first URL before landing on the booking[.]com page. Lets open up the sample to see what the contents of the PDF actually look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6hRF7rMOJnwcYj6ufD34zA.png" /><figcaption>PDF Contents</figcaption></figure><p>As it turns out, this PDF is essentially empty and states that there was an error and the PDF failed to load — the ‘Reload’ button in this case is actually the URL we observed above, sneaky! Lets go ahead and see what happens when we ‘Reload’ the PDF.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kdZ-2id8sM8Bn0YYkq8SIQ.png" /><figcaption>‘Reloading’ the PDF..</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3cbp3xwsGZTHUDiU6iFXJw.png" /><figcaption>File Attempting to Masquerade</figcaption></figure><p>Alright so we have just downloaded a JS file that masquerades as an invoice and also as a PDF. I have little faith that this is however an invoice, or a PDF so saying that, lets open this up in a text editor/IDE of your choice. I will be using VSCode for this analysis.</p><p>Opening the downloaded file leaves us with a bunch of obfuscated strings, we see very little legible text from initial review of the downloaded script:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rfd3Hdyov3FO1dh4aWOrKw.png" /><figcaption>Drive-By Download Contents</figcaption></figure><p>Since this is a mess to look at, we have a couple of options here. There are JavaScript beautifiers online that we can use however its not ideal to input unknown obfuscated code into an open source ‘code beautifier’, so lets not do that. Instead, lets run this through a tool called ‘js-deobfuscater’ to help clean this up a bit. We can run this with ‘-i’ for the input file and ‘-o’ for the output file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QS4k_maKlFOtUNo-7kuBeA.png" /><figcaption>Beautified JS</figcaption></figure><p>Once we ran the code through the tool we were presented with the above output — while this is still quite hard to make sense of, it does tidy the contents up to a more readable state. Saying that, we are not going to manually try to decode this stage — we are going to use a tool called ‘Box-JS’. Box-JS is essentially a JavaScript sandbox that emulates execution of a sample and writes the results to a file/terminal for us to review:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lyc02_rP8W4dOucZoFt38Q.png" /><figcaption>Box-JS Output</figcaption></figure><p>That kind of worked, we got what we needed from it at least! We can see that the sample actually failed to fully execute due to an undefined variable. Nonetheless, we can clearly see that the script calls PowerShell and bypasses the execution policy to ensure that it runs no matter what. We can also see what looks to be an encoded variant of ‘iex’ (Invoke Expression) being called just before a string that looks to download a ‘PDF’ from a URL using IRM, bare in mind that IRM is typically used for copying/downloading scripts and not PDFs.. The execution then sleeps for 3 seconds, and deletes the file in an attempt to remove the evidence. Lets go take a look at what is sitting on the URL we seen above:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T476f0ksUNs4KmN3AthuZQ.png" /><figcaption>Stage 3 Incoming</figcaption></figure><p>Nice — when navigating to the URL from our Box-JS output, we were referred to the above URL which has a pretty large PowerShell script sitting on it. Now, we know that this long script is going to be downloaded via IRM (Invoke-RestMethod) and executed via IEX, our next stage of this infection!</p><p>Lets copy this big blob out from the landing page and put it into VSCode for analysis. As can be seen from the image above however, we are going to be dealing with some more obfuscation :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W29FeiA-WRDSnBvJ3_4QnQ.png" /><figcaption>Stage 3 Part 1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-OJJ4K3Lh1V6geVYSuU9cA.png" /><figcaption>Stage 3 Part 2</figcaption></figure><p>Getting started on this next part, we are going to rename some of the randomly named variables so that we can start to make sense of the script itself. Variables such as ‘$okasodkaoskdoaksd’ can be renamed to “C:\ProgramData\nippleskulcha” and so on.</p><p>While working our way through renaming these variables we can get an idea of what this script is going to be doing upon execution. For the most part, these long strings of digits that we see are actually Octal encoded. Octal encoding is a simplified binary code expression and is represented in base-8. Instead of manually decoding these strings, we can modify the script so that it actually decodes the strings for us upon execution. Lets look at how we can do this, but first just to make this easier to follow, we will be referencing each string by the following names:</p><ul><li>The first string seen in image one — $String_One</li><li>The second string in image one — $String_Two</li><li>The final string in image two — $String_Three</li></ul><p>In the first image above, we can see a function that is named ‘OctalToText‘, and it does what it says on the tin! We can open up a new tab in VScode and copy and paste this function in. We can remove the last two lines since that looks to be removing any traces of execution left behind, which we wont need here since we are doing this ourselves and the execution is manual. We also grabbed $String_Two and passed that in before our decoding function in the new script, see below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y6v3KMit0Ta9TtK35yKoxA.png" /><figcaption>Decoding Octal Encoding String 2</figcaption></figure><p>Note in the above image that we removed the ‘iex’ call and replaced it with ‘Write-Host’. This should stop the execution of the string and instead still decode it however it will write the output to the terminal. Lets see if it works!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mTzB0zqZh7CnPvfw9aLX0A.png" /><figcaption>Decoding Script Output</figcaption></figure><p>Cool, it worked. We now know that we have more encoding to deal with however, lets actually write this to a file, considering that the output is quite large. We can go back to our decoding script and change the write-host function to ‘Out-File -FilePath &lt;File path&gt;’. Once that&#39;s done, we can open up our new script and see what we got:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oGCt0zg4Lox2ZCUdRtKapw.png" /><figcaption>Decoded Output</figcaption></figure><p>Alright so, the string that we just decoded turned out to be more encoded data that references variables in our previous script ($String_One). However, this looks to do more decoding, except from Hex to Binary, or so it states in the function name. For now, let’s leave this where it is and come back to it. We still have more octal encoded data in our original script ($String_Three) so let’s decode that!</p><p>We can use the same decoding function, we just need to replace $String_One with $String_Three and we can run the script, remember to change the name of the output file though so we don’t overwrite our previous output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lTMoaG7udni2V6dGhERULg.png" /><figcaption>Last Octal Encoded Data Decoded</figcaption></figure><p>Now we have what looks to be persistence in the form of scheduled tasks and registry run keys, fun. Doing some character replacing, we attempted to make sense of what these functions will do when executed. It seems that they will make a ‘irm’ request to a URL to download another script and then call ‘iex’ to execute said script. Similar to what we seen earlier on. See below for character replaced script:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lbld1KghKH8e_Vbp6FVU1A.png" /><figcaption>Cleaned-Up Persistence</figcaption></figure><p>We can see that in the original script, the author included functionality to actually go ahead and remove the executed script once again, the malware then sleeps for 22 seconds and forcefully stops any process with .bat or PowerShell in their command lines:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4qW3jdlB34uj6dH2SF7Xgg.png" /><figcaption>Original Script Cleaned</figcaption></figure><p>Just to recap — so far we identified a scheduled task that appears to initiate a connection to a URL and execute the downloaded contents via mshta.exe, this same behavior was also observed in a registry run key which will execute every time the machine is booted up. We identified another part of this script from decoding $String_Two, this part of the script will be used to join and decode $String_One <strong>and </strong>the additional string we located from decoding $String_Two. When decoded and joined, these two strings will be compiled and executed thus delivering what we believe to be the final payload.</p><p>So we can go back to our output from $String_Two, which left us with another chunk of data. We can drop in $String_One from our original script so that this ‘decoding’ script has reference to both blobs, as it will need this for deobfuscation/compiling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u6yBOSxIU3VkEv9HjhgA_g.png" /><figcaption>Last Piece of Encoded Data</figcaption></figure><p>Looking at the above however there are several aspects that we want to remove. We do not need any of the items from .net Framework down, so lets remove these. We are going to replace this with a new variable, referencing our two blobs, this can then be piped out to an Out-File function to write the data to a text file. This data can then be dropped into the likes of CyberChef, where we should be able to just convert it to a PE binary.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/423/1*ExzNXLICenR_SFwEI76oPA.png" /><figcaption>Output of Blobs Decoded</figcaption></figure><p>We might need to fix the formatting of this output in order for CyberChef to read it correctly, we can do this using regex and finding and replacing ‘[\r\n]+’ with just a white space. Once done, we can go ahead and drop the data into CyberChef. Last but not least, convert the data from decimal and we should have our PE32 binary:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7PipjfAcJofpngpitzDZjg.png" /><figcaption>PE32 Binary</figcaption></figure><p>And there we have it! We can just download this and we can move on with our analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4yiJLa4D9pPcfXhR8YjWNw.png" /><figcaption>VirusTotal Report of Converted EXE</figcaption></figure><p>As can be seen above, the file that is compiled and executed has been flagged by several vendors on VirusTotal. The naming convention also poses some questions as to the functionality of the file itself ‘Newcrypternoprocess.exe’.</p><p>However, given this write up is already pretty lengthy, we are going to make this into a two part write up. In the next part we will look at breaking down the executable we just compiled in a decompiler, and stepping through the execution in a debugger along with gathering static artifacts.</p><p>All IOCs, references and conclusion will be included in the next part so stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3942f8e66d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AsyncRAT: Malware Analysis]]></title>
            <link>https://medium.com/@coormac/malware-analysis-async-rat-06b9ceaaa2b1?source=rss-48ba9f718b24------2</link>
            <guid isPermaLink="false">https://medium.com/p/06b9ceaaa2b1</guid>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <dc:creator><![CDATA[Cormac Conlon]]></dc:creator>
            <pubDate>Thu, 14 Nov 2024 11:04:56 GMT</pubDate>
            <atom:updated>2024-11-19T21:58:50.517Z</atom:updated>
            <content:encoded><![CDATA[<h3>Malware Analysis: I Smell a RAT!</h3><p>To start off our analysis here, we will be looking at a zip folder which was retrieved from a drive by download. The drive by download was initiated from a URL in a phishing email and the IOC was hosted on: hxxps[:]gbshost[.]net/api[.]html.</p><p>When navigating to the URL, a zip folder titled ‘’E-STATMENT20776.exe.zip’ is downloaded to the victims machine.</p><p>We are going to start this analysis off in our Remnux machine for our static analysis however, we will move over to our FlareVM machine when it is time for the dynamic analysis of this particular sample.</p><p>If you want to follow along, we have uploaded this particular sample to malwarebazaar, see the offending file hash below:</p><p><strong>f848795e0524106dff936ef8f65b2acb6ae9b40a50d54b513ef12f64de465b99</strong></p><p>Please note that the number following ‘E-STATEMENT’ does appear to change each time when the download is initiated and the site hosting the malware has since been taken down.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/336/1*yHPzH7lzQYeskUM_PKlLhg.jpeg" /><figcaption>Drive-by Download Initiated</figcaption></figure><p>We can go ahead and extract the zip file which was downloaded, doing so leaves us with what appears to be an executable file which has an overlay section that makes up a good chunk of this file size.</p><p>Let’s confirm that this is actually a .exe file before we move on any further. To do this, we can run ‘diec’ or DetectItEasy against the sample:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mfuU-LZnoZBnwYVJBDr9UQ.png" /><figcaption>File Type</figcaption></figure><p>Okay, so we are actually looking at a Nullsoft installer executable. Given this is a Nullsoft installer, we can go ahead and extract the binary to see what&#39;s going to be installed upon execution but first, lets do some static analysis on the installer file itself. Were going to run ‘PEframe’ against the file to gather some more details on what we are working with.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*z1tjNlQbpPzZDPY_EFRnbQ.png" /><figcaption>Snippet of PEframe output</figcaption></figure><p>So, the above image gives us a decent insight into what this file is and might be doing. We can see that the file has XOR encoding within, possible keylogger capabilities, is a Nullsoft installer and appears to mimic some kind of PDF software. Peframe also made note of a suspicious section ‘.text’, given the high entropy score. The .text section in PE32 binaries contains the executable code. PEframe also gives us some more information on the sample file, such as: embedded URLs, imports, suspicious API usage and more.</p><p>However, lets move on to extracting this file and seeing what else awaits us given we know additional files are likely to be installed once executed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wk-IgpC1DbIZbp6COnAQKg.png" /><figcaption>Extracted Contents</figcaption></figure><p>Interesting.. so, after extracting the .exe file we initially had, we now have two directories and a .nsis file. To get started, let’s focus our attention on the first ‘$PLUGINSDIR’ directory.</p><p>Within this directory there are a number of DLLs, some of which do raise suspicions, going by the naming conventions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eo99g2WcwFiBgpGv6ZLe_w.png" /><figcaption>Plugin Directory Contents</figcaption></figure><p>We can see reference to UAC.dll (User Account Control) and UserInfo.dll. While these files may serve a purpose in legitimate applications, the fact we know this file is likely malicious raises red flags with regards to what they will achieve once executed.</p><p>Let’s move on to some quick analysis/research of the DLLs we found, starting with:</p><h4><strong>Nact.dll — f23b8d65606c71b8dcecd34078d6037730a16979d402ea5e99a8df1447553c47</strong></h4><ul><li>There&#39;s not a whole lot of information on this DLL online however, looking at the relations section in VT shows it to be associated with malware.</li><li>Quick review of this DLL shows it to be packed (according to the entropy score), running the file through PE-Frame shows several suspicious items in the form of anti debugging techniques, thread injection capabilities, and privilege escalation.</li><li>Last thing we’ll do here before moving on is running a quick floss command on the DLL. We noted some interesting aspects here in the form of: Adjusting token privileges, writing process memory, winhttp API calls, file download references, msiexec references, references to PDFReader and last but not least, a familiar looking directory with a .EXE file referenced: %TEMP%\@NEW_x320\@NEW_x320.exe. We’ll come back to this after a quick review of the other DLLs we found.</li></ul><h4><strong>nsDialogs.dll — <br></strong>416133dd86c0dff6b0fcaf1f46dfe97fdc85b37f90effb2d369164a8f7e13ae6</h4><ul><li>This library does appear to have a legitimate use within installer binaries and allows the creation of custom pages in the installer.</li><li>Reviewing the file entropy for this DLL shows that it is in fact not packed and does not carry the same suspicious behavior capabilities as the previous DLL.</li><li>Running the floss command on the DLL does not return any suspicious artefacts, the VT result in this case is also benign however this DLL has multiple suspicious relations.</li></ul><h4>System.DLL — 2f7f8fc05dc4fd0d5cda501b47e4433357e887bbfed7292c028d99c73b52dc08</h4><ul><li>Library does appear to have legitimate usage however, has several sandbox reports online. None of which have marked the library as 100% malicious however there are several suspicious indicators.</li><li>File entropy for this DLL shows it is not packed.</li><li>Reviewing the floss output here does not show many suspicious indicators.</li></ul><h4>UAC.dll — 2f7f8fc05dc4fd0d5cda501b47e4433357e887bbfed7292c028d99c73b52dc08</h4><ul><li>Again, this library appears to have legitimate usage and is whitelisted by multiple online sandboxes. However, there are several reports online which deem this malicious given the functionality of the library.</li><li>Entropy shows the DLL is not packed.</li><li>The floss output definitely grabs our attention given the presence of suspicious strings such as: EnableLUA, seclogon, SysCredential and more however, this is likely used for legitimate purposes while also abused by actors.</li></ul><h4>UserInfo.dll — 6293408a5fa6d0f55f0a4d01528eb5b807ee9447a75a28b5986267475ebcd3ae</h4><ul><li>Once again this library appears to have a legitimate use. Online sandboxes have flagged the DLL as benign.</li><li>Reviewing the file entropy would hint that the library is not packed.</li><li>Last but not least, the floss output here, given the context of the investigation thus far does appear suspicious. It is possible the DLL will be used for machine foot-printing and recon.</li></ul><p>So, out of the DLLs we located in the Plugins directory there are definitely some questionable functionalities however, the first library we gave a quick glance over (NAct.dll) referenced yet another executable file located in the $TEMP directory. Lets go take a look at that!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fD8xO_aYrSUZPP6DaggIVQ.png" /><figcaption>New IOC Located</figcaption></figure><p>By navigating to the directory, we have located our next IOC and have confirmed this to be a x86 PE32 Binary.</p><p>Following the same sort of analysis techniques we done above, we can start to get a better idea of what this binary is and what it does upon execution. Saying that, lets get started on the analysis of this binary:</p><ul><li><strong>@New_320D.exe — bbfc49b0c160e7d0231ad70f3e45c9e9e7a7935da863792fde2732a2ce594614</strong></li></ul><p>Okay so, above we ran the file command against the sample however there are several other ways to confirm the file type of the sample you are analyzing, such as Trid.</p><p>Trid is another file identifier tool which pretty much works just as well as the file command however, Trid detects file types from their binary signatures. To confirm if we are looking at a PE file, we can also look at the first bytes of the file header — if the file is truly a PE32 binary, the first 4 bytes in hex will be 4d5a (magic numbers) which in ascii representation translates to MZ(Mark Zbikowski, one of the leading developers of MS-DOS):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fguNQPEl9yDhL9uF1AO2ug.png" /><figcaption>Confirming File Type</figcaption></figure><p>The next thing we want to do is run the file through DetectItEasy, several reasons why we do this — DIE gives us some pretty good information with regards to the structure of the file, if its packed and what it has been compiled with:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zyQwcIThHq7Bn9TQsvdwlA.png" /><figcaption>Additional File Information</figcaption></figure><p>Referencing the above image, we can see the file is written in C/C++, Compiled with Microsoft Visual for C/C++ and is packed with Pyinstaller. The last detail is important here so keep that in mind as we will be coming back to it. Firstly though, I want to run the file through Peframe and see what information we can gather from here:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sl4hy9pVQhItGihQT9reiA.png" /><figcaption>Peframe File Information</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*ttwTNy05U3C_drUpOEHBew.png" /><figcaption>More Peframe File Information</figcaption></figure><p>Okay cool so we got some relevant information with regards to our investigation — keep in mind this is all just static analysis thus far however we are exhausting our resources here to ensure we gather as much info as possible before diving into the dynamic side of our analysis. So we know that:</p><ul><li>The binary is packed.</li><li>The sample may use the CRC32 algorithm, this can be abused by malware authors to hash function names which in turn makes the malware more likely to bypass EDR/AV systems.</li><li>Has an embedded URL present, which is Microsoft however the resource is no longer live.</li><li>Has a bunch of embedded files/libraries, some of which are compressed.</li><li>Uses anti-analysis techniques.</li></ul><p>Let’s take it back a few steps and focus on the packer used here, we know that the file is packed with Pyinstaller, and lucky for us, there are Pysintaller unpackers readily available on Remnux.</p><p>Go ahead and run pyinstxtractor.py against the sample to extract the Python package:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s76b2judC-ZHk5Y7lDAMDg.png" /><figcaption>Pyinstaller Extraction</figcaption></figure><p>From the above we can see that upon execution, a bunch of python installation files are likely going to be written to disk. These libraries may provide the malware in this case with several functionalities, including;</p><ul><li>Socket functionality</li><li>Encryption capabilities</li><li>Encoders</li><li>HTTP capabilities</li><li>SMTP libraries</li><li>SSL functionality</li></ul><p>There is a bunch more incorporated in this Pyinstaller however, these are a select few that I noticed from a cursory glance. This package is quite large however so we are not going to spend much time going through every aspect of it but, something to note here:</p><p>A lot of these scripts are appended with the file extension .pyc, these are compiled Python scripts. We can still open and view these files as they are however, they will have a bunch of non readable characters present and be parsed poorly:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jWwYDm-HlYzpyGkg_1OKfQ.png" /><figcaption>Example of Compliled Script</figcaption></figure><p>Running the above mentioned python unpacking tool ‘pycdc’ against a .pyc file will make it human readable:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*zbRinqpr4UpGBve6C2gJQQ.png" /><figcaption>Decompiled Example</figcaption></figure><p>Anyways, moving on as we could be here forever going through each functionality of the Pyinstaller package.</p><p>Let’s go back to our NAct.dll library as this one seemed to stand out among the rest — we confirmed that this particular library referenced the malicious executable which we just had a look at. We also noted that this had some strange functionality when compared to the other DLLs we found. We noted that the library imported winhttp.dll, and made several API calls which would raise concerns given the investigation thus far. We can open this up in Ghidra and view the imports, then drop down the winhttp library to view the calls made:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*gPtSjfkRTKVeei1wiNn-ng.png" /><figcaption>Suspicious Calls</figcaption></figure><p>While we now know this DLL has the capability to connect to a URL, send requests, receive requests and so on — we also believe this DLL to have functionality to write/inject data into another process.</p><p>Among the libraries imported, we made note of the Kernel32 library being imported also. While this holds several interesting items, I identified what appears to be a typical chain of events which is seen with code injection techniques. The program is essentially going to retrieve a process thread ID, Open the process, Virtually Allocate memory in that process, Write data to the space in memory and lastly read the data injected into that process. Peframe also stated this particular DLL had thread injection capabilities:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*-k2qPePBkiRmxspdGTL1kg.png" /><figcaption>Possible Process Injection</figcaption></figure><p>Lets look at this a bit more in another tool called Cutter. We can make note of the function name/number in Ghidra and search it in Cutter to locate it. Once located, we can open the function in a graph view to make it slightly easier to follow:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F-LlE0-EKW04ftZIUomsgQ.png" /><figcaption>Part of Function in Cutter</figcaption></figure><p>In the above image we can see the ‘Injection’ method a bit clearer. The function will push values to the stack, among these values we can see ‘lpBaseAddress’ being pushed, this value is the specified process in which the DLL will attempt to get a handle on, just after we see hWnd being pushed to the stack which will attempt to get a handle on a window. This is followed by a call to the API ‘GetWindowThreadProcessID’ which will execute/call the values pushed to the stack just beforehand.</p><p>We then see dwProcessId being pushed alongside lpBaseAddress which may be used to identify said process. The boolean value of 0 is then pushed onto the stack followed by the requested access to the process. The program then calls to get a HANDLE on the process previously specified.</p><p>We then see the program go through multiple other parameters to gather the needed information to create space in the previously specified process. Which includes, calling the API ‘VirtualAllocExW’ after previously specifying the memory protection, type of memory allocation and size.</p><p>More parameters are then passed in which include the lpNumberofBytesWritten parameter, which in our case is set to NULL — this can be done to avoid erroneous results. Size is then passed in along with lpBuffer. lpBuffer in our context is a pointer to the buffer that contains data to be written in the address space of the previously specified process. We also see lpBaseAddress and hProcess being pushed to the stack before we see a call to the ‘WriteProcesMemory’ API.</p><p>Just after this we see a similar set up in which similar parameters are pushed to the stack just before a call to the ‘ReadProcessMemory’ API is made.</p><p>We then see an iteration of what we seen above once more which may be passed over if the above operation is successful. This will then jump to the final operation and pass in similar parameters as seen above to identify the specified process and call VirtualFreeEx to release/decommit the region in memory and finally make a call to close the handle on the process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*F0tw_PX42fPJ6mhnNUXgew.png" /><figcaption>Last part of function.</figcaption></figure><p>Anyways moving on — Given the fact that we seen reference to the Pysintaller packed executable (@New_320D.exe) in the above DLLs strings and we observed what looks like process injection — we believe that the above DLL is going to write data into the executable file ‘@New_320D.exe’. This may provide HTTP capabilities, along with the Python Packaged installer providing a wide range of functionality, including but not limited to; Opening and closing sockets and sending and receiving data — I smell a RAT!</p><p>So we believe that we have identified the functionality of the sample, below is some further evidence which may confirm our suspicions, taken from decompiling ‘@New_320D.exe’ in Ghidra:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZcdQzEujWzY4BAHGyZnz4Q.png" /><figcaption>Suspicious Network Related Strings</figcaption></figure><p>Last but not least, onto the final part of this analysis — attempting to locate the C2 which our suspected RAT uses for communication. Were going to detonate this sample in an isolated environment and monitor web traffic with wireshark and process interactions with procmon.</p><p>While monitoring the processes after execution we noted some interesting activity, the Pyinstaller packages were written to a folder in AppData\Local\Temp\_MEI74602:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jtnbV5-M5vP_6TEtB1Hwhg.png" /><figcaption>Suspicious Directory Created</figcaption></figure><p>From execution we also noted something unusual, the malware attempted to create an amsi.dll file in the below location however failed due to NAME_NOT_FOUND:</p><ul><li>C:\Users\&lt;user&gt;\E-STATEMENT20776\$TEMP\@New_x320D\amsi.DLL</li></ul><p>The same activity was also observed in the APPDATA directory. Amsi.dll was then ‘Created’ and launched under the context of system32, weird..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1TW0HZJD7AWiyIx83TFWZA.png" /><figcaption>AMSI.dll Created and Loaded</figcaption></figure><p>From our dynamic analysis of this sample we also noted the original file @New_x320d rename itself to ‘fontdrvhost.exe’ in an attempt to fly under the radar. The sample was located in the ‘appdata\local\microsoft\fontdrvhost.exe’ directory. We confirmed these two files were in fact the same by comparing hash values.</p><p>We also identified the persistence technique this sample utilizes. When executed, the sample creates a .lnk file in the startup directory which is a Powershell script that points to a registry value. When the machine boots up and the user logs on, the script will run and in turn invoke ‘fontdrvhost.exe’ by targeting the registry value HKCU:Software\fontdrvhost:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A256EmCD9d1E8inIMaakIw.png" /><figcaption>Persistence Mechanism</figcaption></figure><p>And last but not least, our suspicions were confirmed — we identified inbound/outbound traffic to an IP address associated with AsyncRAT:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-n681renpYXi1Gy_ylm4Ig.png" /><figcaption>C2 Beaconing</figcaption></figure><p>Given we were too late to the party and our identified IOC had already been reported we did not report it again however, see below images for confirmation on malware attribution:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M-As61-MpE3Chd-XgGbZ5w.png" /><figcaption>ThreatFox Report</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*go0vU8Hzhk-g-yadr1hCJQ.png" /><figcaption>VirusTotal Report</figcaption></figure><h3>Conclusion:</h3><p>The particular delivery method observed in this infection here is something which is common among threat actors across the board. A widespread malspam campaign targeting a number of sectors and usually not very targeted. The use of drive by downloads and an email which entices the victim to detonate the automatically downloaded malware is also a common initial access technique.</p><p>Given the attributed malware is what can be seen as commodity malware, it is extremely difficult to try attribute this to a specific group.</p><h3>IOCs:</h3><ul><li>f848795e0524106dff936ef8f65b2acb6ae9b40a50d54b513ef12f64de465b99 — E-STATMENT66008.exe.zip</li><li>f7ae58f22cbdeb69318f6cb3ff3757a9888e8731febd66e85ee9938f874705c9 — E-STATMENT66008.exe</li><li>f23b8d65606c71b8dcecd34078d6037730a16979d402ea5e99a8df1447553c47 — NAct.dll</li></ul><h4>IP Address/Domain:</h4><ul><li>144.126.151.185:2005</li><li>hxxps[:]gbshost[.]net/</li></ul><h3>References:</h3><ul><li><a href="https://bazaar.abuse.ch/sample/f848795e0524106dff936ef8f65b2acb6ae9b40a50d54b513ef12f64de465b99/">MalwareBazaar</a></li><li><a href="https://threatfox.abuse.ch/ioc/1308676/">ThreatFox Report</a></li><li><a href="https://www.virustotal.com/gui/ip-address/144.126.151.185/detection">VirusTotal C2 Report</a></li><li><a href="https://www.virustotal.com/gui/file/f848795e0524106dff936ef8f65b2acb6ae9b40a50d54b513ef12f64de465b99/detection">VirusTotal ZIP Report</a></li><li><a href="https://www.virustotal.com/gui/url/99f535086bbc4a536c9aeacbb262a43faf7d241b704181a2216efcddce831051/detection">VirusTotal Drive-by Download Report</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=06b9ceaaa2b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTA to .NET DLL(s): Malware Analysis]]></title>
            <link>https://medium.com/@coormac/hta-to-net-dll-s-malware-analysis-b7170574331d?source=rss-48ba9f718b24------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7170574331d</guid>
            <category><![CDATA[malware-analysis]]></category>
            <dc:creator><![CDATA[Cormac Conlon]]></dc:creator>
            <pubDate>Mon, 28 Oct 2024 14:54:34 GMT</pubDate>
            <atom:updated>2024-10-28T15:00:22.237Z</atom:updated>
            <content:encoded><![CDATA[<h3>HTA to .NET DLL(s): Malware Analysis</h3><p>We will be reviewing a HTA sample today, this particular sample was retrieved from MalwareBazaar and goes through several obfuscation techniques to evade detection and make the triage more difficult for researchers. See the sample hash below:</p><p><strong>SHA256</strong>:c1ed3fb7bacbb5a6446632d8aa2eb73887c2de3290ad7be306a2b24318e2efdc</p><p>First things first, before getting into the analysis of the sample we should always confirm what file type we are working with. Just because the file extension says one thing, it is not always correct.</p><p>We can run a multitude of commands here to determine file type however in this case I will run ‘file &lt;sample name&gt;’ to retrieve details on what we are working with:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*O7yxNmYNVXgKVHQ6XFzUlw.png" /><figcaption>File Type</figcaption></figure><p>Now we confirmed the file type, let get started with the analysis!</p><h3><strong>Initial Analysis:</strong></h3><p>Now that we have the sample opened up in Visual Studio, we are greeted with what looks like nonsense, and a lot of it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-YkDGFZI-a3foT3XhN1KDA.jpeg" /><figcaption>Encoded Script</figcaption></figure><p>As we can see from the text bar on the right side, this script is quite large and contains little to no legible text. However, there are some recognizable traits here. This blob of text is essentially URL encoding with regards to the format (%&lt;string of characters/numbers&gt;), however this is not usually what it will look like in a real world scenario.</p><p>URL encoding is typically seen in URLs where the backslash or another part of the URI is encoded with something like ‘%3A’, see below for an example. The special characters in a URL are typically encoded:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/349/1*pi0k8Uv7YiVs36ejDfxouA.jpeg" /><figcaption>URL Encoding Example</figcaption></figure><p>Due to the similarities between what we are dealing with and how URL encoding/decoding works, we will be able to actually decode this ‘Stage 1’ script using the URL decode feature in CyberChef.</p><p>We can copy and paste the full script into CyberChef and select the URL decode function, we will need to drop this function into the recipe box a couple of times to fully decode the script, given how many lines are present:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*exeiX_qFsiOvV-JUjVLYfw.png" /><figcaption>Decoded Script</figcaption></figure><p>And just like that, we have a readible script which appears to be written in VBS. We can save the output to something like ‘Stage1_Cleaned’ and open that up in our text editor.</p><h3>Stage1_Cleaned Analysis + Cleanup</h3><p>Once we open the ‘Cleaned’ script in our text editor, we can see that is parsed pretty poorly. This is due to the number of lines that were removed and the location of the data before we removed the ‘URL Encoding’.</p><p>However, nothing a bit of regex wont fix! We’re going to remove all the white spaces using the find and replace function and enabling the regex feature, we can run \s+ and replace all the selected items with just a single space:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*guxKMt1Aeox4u3hcKgxaaw.jpeg" /><figcaption>Parsed Script</figcaption></figure><p>Now, some important artifacts are visible and formatted in a more friendly way. Some clear items of interest are on show now, such as PowerShell references, Base64 encoding and character encoded items.</p><p>To begin our analysis here, we can look at the top strings. We see that DIM is being used to declare local variables on two occasions. Just after, these variables are being set to items of interest, such as ‘CReATeObjEcT ( ChrW(&amp;H77) &amp; “scRIpT.ShELl” )’ and the other, which is the base64 encoded PS command. We can rename the long string to something that makes more sense, like Wscript.CreateObject. The final product should be something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HIVInytxqms2BFb3UHbJPw.jpeg" /><figcaption>Cleaned Script</figcaption></figure><p>The actor in this case has utilized a commonly abused LOLBIN (Living Off The Land Binary) here to execute the encoded script through ‘DeviceCredentialDeployment.exe’ in an attempt to avoid detection:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*cKX-O7vCMn65jk-y1mV3Lw.png" /><figcaption>LOLBIN Description and Usage</figcaption></figure><p><strong>This could be a nice detection opportunity!</strong> Okay so back to the script — if we want to go ahead with decoding the character encoded text, we can open up PowerShell and run “[char]&lt;char number&gt;”, however, we can essentially avoid that in this case given we know how the next stage of infection is going to be executed, though PowerShell IEX.</p><h3>Stage2 Analysis + Cleanup</h3><p>The next point of interest here is the base64 encoded string that PowerShell is going to execute, we can drop that right into CyberChef to reveal what will happen once executed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Z1OpZWsWioFXi18klKr5w.jpeg" /><figcaption>Decoded Base64 Blob</figcaption></figure><p>Let’s clean this up a little bit to make easier to follow and understand what’s actually going on here:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pUN8LsIPlmc65s4MH_WU3g.png" /><figcaption>Cleaned Base64 Output</figcaption></figure><p>So.. as can be seen above, we have our next stage and our next IOC, which looks to be a .VBS script. This stage is going to import a DLL called ‘URLmon.dll’, this particular library provides the functionality to reach out to a server/domain and perform several functions, which in our case appears to be ‘URLDownloadToFile’.</p><p>Once executed, this will be stored in the APPDATA directory on the target machine, the infection chain then sleeps for 3 seconds, and finally executes the script ‘systemprog.vbs’. Since we are walking through the infection chain step by step, we will need to manually navigate to the URL to gather our next IOC, let’s hope that it’s still live!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1_RauCtIjpZDEt-sa1YyGg.jpeg" /><figcaption>URLDownloadToFile</figcaption></figure><p>Annnnnd it sure is! Let’s open this in our text editor next to see what we are dealing with.</p><p>So, this next script is quite long, we are not going to spend our time going through each aspect of code however, we will run through it and look for any items that stand out or may seem suspicious.</p><p>Skimming through the script however we note a lot of repetitiveness, this is a technique used by the author to hide malicious aspects of their code, or hide sensitive strings in a way that they might bypass some AV/EDR systems:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UYcbWXVi2xOBbXcc-jB5tQ.jpeg" /><figcaption>Headache In a Picture</figcaption></figure><p>Well, this does not look like normal VBscript. This definitely raises red flags. We see a lot of the same strings being repeated which in most cases, is an obfuscation technique used to hide malicious code.</p><p>We can sometimes just remove the repetitive strings to reveal the the true code however, this is a shot in the dark so generally not the best technique to use however, we will give it a shot!</p><p>So, with that being said, we are going to find and replace these strings with a blank space to see if we can make more sense of what we are looking at, unfortunately however, in this case that did not work.</p><p>We moved the suspicious code to a new file and modified the last function (run function) to ‘Wscript.echo’ to write the contents to the screen when executed. This threw a few errors however I modified the script until it ran and lo and behold:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HWqBXafkjGs1Z3UDbA4qzg.jpeg" /><figcaption>Printing Contents to Screen</figcaption></figure><p>The common string we noted previously was actually [char]66 reversed, funny enough. So, I went and replaced all the variables with the letter B (char 66), compiled the two base 64 blobs together, put the full blob into CyberChef, used the reverse function and then used the ‘from base64’ function. We finally have our stage 3:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AIU0xXNtIG_bpN_1X0BX0w.jpeg" /><figcaption>Stage 3</figcaption></figure><p>Stage 3 in this case also appears to have some aspects reversed to make it more difficult for analysis. However, we can see a URL in there pretty clearly. We will look at this in the next section.</p><h3>Stage 3 Analysis + Cleanup</h3><p>As we seen above, the majority of this script is reversed, we can throw this into CyberChef once again to make it human readable. Once reversed, we can see clearly that there is a URL present, go ahead and remove the extra full stops, we can then travel to the URL and see if there is a 4th stage waiting for us:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*dfvQjgotJUCXONM3s0u1jg.jpeg" /><figcaption>Stage 4 Loading..</figcaption></figure><p>Weird.. nothing but an IP address. Let’s go back to our script and try to make sense as to what it does when it connects to this URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NTkRP4lQ6eoyd7_xK5fmVw.jpeg" /><figcaption>Stage 3 Cleaned</figcaption></figure><p>Looking at the above image, we can see randomized variables being set to functions that make sense (Some of them). For example, $klbsc is being set to ‘New Object — NetWebClient’ which will be used to create network connections. So, we know this stage is going to once again, attempt to reach out to another server and retrieve possibly another stage of infection. It does appear that this artifact is going to be stored in the windows start up folder, which is a persistence mechanism this malware will use to ensure it is always running when the system is booted.</p><p>A bit further down we noted an FTP URL, with arguments passed beforehand that will essentially download the requested resource as a string. Judging by the arguments that follow, this next stage looks to be a base64 encoded DLL. Unfortunately, as can be seen above, the initial https URL does not appear to be hosting the content we wanted, leaving only the server IP which is hosting the domain.</p><p>Given we are only left with an FTP URL the actor so kindly left for us, let’s go ahead and see if we can gather the next stage this way!</p><p>This part of the triage was pretty funny as we were able to decode the credentials for the server which were embedded in the script above and gain full access to all the actors malware.</p><p>This part of the analysis demonstrates poor OpSec from the attacker, whom essentially left the credentials for the server coded into the script. Therefore, any researchers who come across this sample are able to fully authenticate to the server.. funny. We did attempt to delete the malware hosted on the site however, the actor had the perms locked down so we were not successful in doing so:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bNiYsTv3vV4V9DeL5kJ_bw.png" /><figcaption>FTP Connection</figcaption></figure><p>Lo and behold, we have got our hands on multiple IOCs here, more than we bargained for! The two directories (01 and 02) contained .txt files with one of the below IOCs in them. The Google Drive URL was hosting a file called Uncryptor.rar, which we located the decryption key for on the server under ‘key.txt’. See below artifacts from the server:</p><ul><li>https[:]//paste[.]ee/d/w4hed/0</li><li>https[:]//paste[.]ee/d/r322U/0</li><li>https[:]//paste[.]ee/d/d80GV/0</li><li>https[:]//paste[.]ee/d/DEeVQ/0</li><li>https[:]//paste[.]ee/d/lLoL6/0</li><li>https[:]//paste[.]ee/d/d3nAC/0</li><li>hxxps[:]//drive[.]google[.]com/uc?export=download&amp;id=1MsC6AGt5IrC9jbpx8RHCwHRIMIPWusv (UpCrypter.rar)</li></ul><p>From further review however, these other URLs are serving more maliciousness… Reviewing all IOCs noted above shows that they follow the same pattern, the first URL leads to a domain hosting a base64 encoded blob, which when decoded and converted from base64, gives us a DLL (no reports as per VT, however I don’t trust the legitimacy of it), second URL leads to a script which decodes and utilizes another Living Off the Land technique for injection/execution.</p><p>We see the second URL here actually pass in arguments for the process ‘addinprocess32.exe’ which from research online, is a process that can be used for injection and launching malicious payloads (Formbook has been seen to utilize this technique). See below script:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8yxwbLZk5g0qQOLaM6At-A.png" /><figcaption>Malicious Script From URL</figcaption></figure><p>We can see the above script launches a process, possibly for injection/execution of the malicious DLL. It then converts the weird characters to the letter ‘A’, converts the blob from a base64string, gets ‘Class 1’ from ‘Class_Library_1’ (from the decoded DLL)and launches it under the context of the suspected injected process ‘addinprocess32.exe’, pretty cool!</p><p>Finally, the third and final URL mimics the download process of the first:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qGb62aMJuKEWKUxNzW9PBA.png" /><figcaption>Base64 Which is Converted to DLL</figcaption></figure><p>Following the decoding process seen above, we can see those weird characters are actually replaced with ‘A’, so we can copy/paste this Base64 into a text editor, find and replace the weird characters with ‘A’ and decode from base64. Bada bing bada boom, we have a .NET DLL.</p><p>Running ‘file’ against the DLL gives us some file details, we can see this is a .NET assembly DLL, in which the hash has not been reported yet, according to VT. Given this is a .NET assembly however, we can open the file up in DNSPY or ILSPY to peel back the layers and see if we can make sense of what it will be doing or gather further IOCs.</p><p>Among the information taken from the FTP server was a Google Drive URL, navigating here initiates a download of a .rar file called ‘UpCrypter.rar’. However, attempting to extract this RAR file requires a password which unfortunately, we do not have. We attempted to hash this file and view the reports on VT however, no results were found. Also worth noting here, we did report the Google Drive URL for serving malware in an attempt to take down the actor’s infrastructure.</p><h3>Stage 4 (Analyzing the malicious .NET DLL)</h3><p>For this stage, were going to run our usual investigation steps with regards to executable files, this DLL was heavily obfuscated with math mutations and .NET reactor (According to DIE):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*KtjYgNqoYYhRuHthl1t3wA.png" /><figcaption>DetectItEasy Scan</figcaption></figure><p>Given the DLL is protected with multiple layers of obfuscation and encryption, we will be running this through NetReactorSlayer however, let’s compare the contents before and after doing so in ILSPY:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/361/1*QsWlkxr6-3GNQkMIjBkgIQ.png" /><figcaption>Before</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/310/1*fnx5NGBn-Wmkwo8ZcVyTog.png" /><figcaption>After</figcaption></figure><p>Pretty sweet! Now lets actually run the DLL through NetSlayer to see what it looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*6ovQEY7ZM8M4RjBAh1nQng.png" /><figcaption>NetSlayer Findings</figcaption></figure><p>Okay cool – NetSlayer has solved equations, renamed obfuscated symbols and inlined methods.</p><p>Now since we have removed the majority of obfuscation, we can go ahead with our analysis and see what interesting items turn up. First were going to start off by running the ‘Floss’ command, this is very similar to strings however it decodes artifacts, when possible. This is a pretty basic technique however sometimes it can give us valuable information that may assist in our analysis.</p><p>Reviewing the strings output we see some items of interest in the form of:</p><ul><li>WebClient — DLL must make network connections.</li><li>Download String – Downloads a string from the internet.</li><li>Sleep – Possible evasion technique.</li><li>Memory Stream – Possible execution in memory.</li><li>Payload – References to a payload.</li><li>CryptoStreamMode – Encryption usage.</li></ul><p>The list goes on however, above are some examples of the power of the strings/floss utility.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/272/1*R7zwqQtXMjpVmyFkt7uXWA.png" /><figcaption>Classes in DLL</figcaption></figure><p>Earlier in our investigation we noted that Class1 was loaded from the ‘AddInProcess32.exe’ injection/execution, so let’s focus our attention there.</p><p>This is under the ‘ClassLibrary1’ class. Looking through the class, we can see reference to multiple ‘delegates’, each of which will carry out a series of actions during execution of the binary:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SSxyMttDiIpwQQ3JHZiQyA.png" /><figcaption>Delegates and Functions</figcaption></figure><p>We are not going to go through each and every aspect of the assembly however, we can pick out some interesting artifacts here. In the first image, we can see that delegate 0–4 appear to get a handle on a thread, delegates 5–8 (Are quite interesting) appear as if the program is getting a handle on a process and protecting an area in memory, we then see in delegate 6 that bytes are written to the protected area in memory and then ‘read’ under delegate 7. These events are typical for injecting code into a process. Virtual protect can be abused by malware authors to modify memory protection and writing bytes to an area in memory is typical in process injection techniques.</p><p>A bit further down we can see another class named ‘Run(string, object)’. Looking at the contents of this class we can see some pretty juicy information, this class appears to be related to the strings we noted from our ‘Floss’ command earlier on in the analysis — we can see some pretty clear references to ‘web client’ and ‘download string’:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jsRnKFOjQeFS1Fc4ZaQGeg.png" /><figcaption>Run(string, object) Class</figcaption></figure><ul><li>WebClient is being invoked.</li><li>DownloadString is being called to reach out and download a string from the protected URI.</li><li>CryptoStreamMode — Encryption usage.</li><li>Contents of the DownloadString are going to be written to the victims ‘APPDATA’ folder.</li><li>Interaction.shell is then called to execute the downloaded item.</li><li>NOTE: We attempted to convert the protected URI to/from various UTF formats and were having no luck. We tried converting from UTF-8 which gave us hex, then tried converting that from hex however, we ended up with the same strange string. CyberChef recommended ‘Escaping Unicode Character’ and once done, we converted from Unicode and once again got the same protected string.</li></ul><p>Pretty spicy! We can also see however that, in these function calls, there are references to another class ‘GClass0.smethod_0’ — lets hunt this down and see what functionality it serves.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/1*qFzGESDP1sXDjD1Y_EWw0A.png" /><figcaption>GClass0.smethod_0’ Method</figcaption></figure><p>Within the program itself there is a class named ‘-’, this has several branches in it however we do seem to have located the aforementioned method:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/354/1*EI1Iu4-X1mCBD3dYr7HPQg.png" /><figcaption>Possible XOR/Bitconverter Operation</figcaption></figure><p>Looks like we may have an XOR/Bitconverter operation on our hands now. Looking back at our ‘Run’ method, we can several references to a bitconverter being utilized within the program and references to the string ‘payload’:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u6C-PbP9Np7bnI1hu6vWkg.png" /><figcaption>References to Bitconverter and Payload</figcaption></figure><p>However, solving the XOR operation in this case will have to wait for another day. To summarize the program, we just analysed:</p><ul><li>Program is a .NET DLL</li><li>The program was heavily obfuscated.</li><li>We made note of a possible process injection function within the program.</li><li>We noted functionality to: create a web connection, download a string, save it to a file in the user’s appdata folder and finally execute the downloaded string.</li><li>We noted what appears to be an XOR/Bitconverter operation.</li><li>Among the different classes was the ability to footprint the victim machine also.</li></ul><h3>Conclusion</h3><p>The infection chain observed here demonstrates a pretty in depth attempt to evade detections, given the anti-analysis techniques observed in all obfuscations, packing and encryption. It is safe to say however, that the final stage we analyzed, will reach out and initiate another download which will likely be the final stage of the infection chain.</p><p>While reviewing information on the UpCryptor.rar file, it seems it may have relation to the Blind Eagle APT group (APT-C-36), however no further attribution was available from the noted IOCs.</p><h3>IOCs</h3><ul><li>hxxp[:]//23[.]94[.]171[.]157/720/systemprog[.]vbs</li><li>https[:]//mvc.unitedparts[.]ro/dhlhostings[.]txt</li><li>ftp[:]//desckvbrat1@ftpdesckvbrat[.] com[.]br/Upcrypter/01/DLL01[.]txt</li><li>https[:]//paste[.]ee/d/w4hed/0 — ClassLibrary1</li><li>https[:]//paste[.]ee/d/r322U/0 — Script</li><li>https[:]//paste[.]ee/d/d80GV/0 — ClassLibrary3.dll</li><li>https[:]//paste[.]ee/d/DEeVQ/0 — ClassLibrary1</li><li>https[:]//paste[.]ee/d/lLoL6/0 — Script</li><li>https[:]//paste[.]ee/d/d3nAC/0 — ClassLibrary1.dll</li><li>hxxps[:]//drive[.]google[.]com/uc?export=download&amp;id=1MsC6AGt5IrC9jbpx8RHCwHRIMIPWusv (UpCrypter.rar)</li></ul><h3>Hashes</h3><ul><li>c1ed3fb7bacbb5a6446632d8aa2eb73887c2de3290ad7be306a2b24318e2efdc — stage 1</li><li>6537434bc955199dce367abcbe3f13f21a806c161c36f22e6d0ea0e99fbcca97 *Stage2</li><li>3d0b01a64d8f6eab77026a225527c2fa30208f553a45a203dc440a4f425a6ca7 *systemprog.vbs (stage 3)</li><li>3e6c7a9003c2328b305a2e475107ad30879a5345f5eae04b0b7141aefa46daf7 *Sus.dll</li><li>4c43505617d199aa82ff2c36f4750960b2ea8eb713f2a6a52b88d375c8a5143f *Sus_2.dll</li><li>2f32829ce4e4a54202d67108768a09148b21402c3b3995b89fe277be79760758 *Sus_3.dll</li><li>7feb18a5a77dd3910cca04b95dbedac65fd19b7aa331e4dfff3a004589407b27 *UpCrypter_.rar</li><li>a816b54f52c4db82cc9273a4df15fc9bdc44dcd26c46c20a34fb3543fae96950 *Vercion.txt</li><li>3721e7f2db98c23f7e5bfca0220e57ff4a8f3eaf59bbe3a7d579ec0720bae680 *BecupMy.txt</li><li>172ccd54bd84edcbbc0fe13fa693cf35cfb38ca3c3fa957c254d3ec9a1d549fc *Key.txt</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7170574331d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>