<?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 Antoni on Medium]]></title>
        <description><![CDATA[Stories by Antoni on Medium]]></description>
        <link>https://medium.com/@antonilim18?source=rss-45db010639e6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Antoni on Medium</title>
            <link>https://medium.com/@antonilim18?source=rss-45db010639e6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 15 Nov 2026 21:31:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@antonilim18/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[Dissecting Emotet]]></title>
            <link>https://medium.com/@antonilim18/dissecting-emotet-f951c5515df5?source=rss-45db010639e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/f951c5515df5</guid>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[emotet]]></category>
            <dc:creator><![CDATA[Antoni]]></dc:creator>
            <pubDate>Sun, 31 Aug 2025 16:46:31 GMT</pubDate>
            <atom:updated>2025-08-31T16:46:31.758Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Sample</strong>: 591d32aeae0554f744df8843727e794d33495ff0a4b90a9f7861ab526988ded7</p><h3>Executive Summary</h3><p>Malware 591d32 (an Emotet variant) is a sophisticated reconnaissance tool that profiles victim systems by harvesting OS and security software details. Its advanced stealth and persistence mechanisms provide attackers with a hidden foothold, making it a highly probable precursor to a follow-up attack such as ransomware or data theft. <strong>High severity</strong>. <strong>Immediate action required</strong></p><h3>Technical Analysis</h3><h4>Technical Summary</h4><p>Note: The list of discovery items are not exhaustive and further investigation may be required to map out the full extent of what information is being gathered. <strong>Analyst strongly believes this is used to profile before a follow-up attack campaign due to the sheer amount of defense evasion techniques employed.</strong></p><p>N.B.: Static detection rules may not be completely effective in detecting this sample. <strong>Behavior detection tool is strongly recommended</strong>.</p><p><strong>Objective:</strong> Information gathering</p><p><strong>ATT&amp;CK Kill Chain:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*GGrc-ZLjfi8gY7c4doRmzw.png" /></figure><p><strong>Key Findings:</strong></p><ol><li>Evasion via multiple methods, with emphasis on API resolution via PEB Walking and custom polynomial API hashing</li><li>Persistence via service and registry creation</li><li>Queries OS information, running processes, and potentially other data</li><li>Employs data serialization and hybrid encryption (AES for DEK, RSA for KEK) to encrypt stolen information</li><li>Exfiltrates encrypted data via HTTP</li></ol><p><strong>Critical ATT&amp;CK:</strong></p><ol><li>T1027.007</li><li>T1005</li><li>T1041</li></ol><p><strong>Critical IoC</strong>:</p><ol><li>SHA256: <strong>591d32aeae0554f744df8843727e794d33495ff0a4b90a9f7861ab526988ded7</strong></li><li>“shlpchx” key in <strong>Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run </strong>and <strong>services list</strong></li><li>HTTP Communication to <strong>201[.]184[.]105[.]243</strong></li></ol><p>For an exhaustive list of ATT&amp;CK and IoC, consult Appendix A and Appendix C.</p><h3>Deep Dive</h3><h4>Initial Access (T1204.002)</h4><p>It’s assumed that the malware is deployed post-exploitation as analyst did not find any evidence of exploitation/escalation that could be present in the malware</p><h4>Anti-Analysis</h4><p><strong>Dynamic API Resolution (T1027.007)</strong></p><p>In order to gain access to critical functions and evade detection, a PEB walk is performed whenever a critical library needs to be loaded into malware context</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*37-uqXqiAHYM3JGSa2CkIg.png" /></figure><p>To resolve the functions, a custom polynomial API hash algorithm was implemented in the malware:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*BdSu3nVW5xJ_fyIb-yoXfg.png" /></figure><p>Then this hash would be compared against known hash table depending on the context of the loaded libraries (one of NTDLL, kernel32, crypt32, shell32, urlmon, wininet, wtsapi32, userenv):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*EBKl0ny1hMCjRGf6BWuZQg.png" /><figcaption>Example of API resolution function for userenv.dll</figcaption></figure><p>For example here, <strong>0x7A3B4F94</strong> translates to <strong>DestroyEnvironmentBlock</strong>. Some of these values are filled with garbage as there are only about 150 hashes (hash list available in Appendix D) that resolve to a named function out of 2193 and less that analyst saw usage through the analysis session.</p><p><strong>String Encryption (T1027.002)</strong></p><p>By leveraging encryption, it can hide the string required to load a library, do format print, or simply to call library functions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S8W69Y7IiiCyTCBAjcbF0A.png" /><figcaption>Example of string decryption in action resulting in wordlist</figcaption></figure><p>Some of these string decryption and construction return value can be used to construct the true string:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BjAQJEW3Ie7L4YCqeiWmaQ.png" /><figcaption>Example of two stage string construction in action</figcaption></figure><p>As seen in picture above, <em>ESI </em>register (output of “malware_construct_str” function) contains a bunch of comma delimited strings that was passed in the “malware_generate_str” function to output a different string entirely, resulting in a “streamtoner” wide string. This will be used frequently in the malware to avoid static detection tools since the original data source came from a blob of gibberish data.</p><p><strong>SysWOW64 Masquerading (T1036.005)</strong></p><p>The malware performs a move of its own file to system location to achieve two objectives: persistence and masquerading.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_WaKwY6HZvAnyTfaXXDQTQ.png" /><figcaption>Silent file move via SHFileOperationW in action</figcaption></figure><h4>Anti-Forensic</h4><p><strong>Zone Identifier Deletion (T1564.004)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ngSRYF1ld-aw9x_F9LFAIg.png" /><figcaption>Malware deleting Zone.Identifier in action</figcaption></figure><p>Zone.Identifier is an Extended Attribute in NTFS to particularly store data of whether this file comes from the internet or locally. Malware deleting it erases the origin of the file, avoiding forensic analysis.</p><h4>Persistence Phase (TA0003)</h4><p>After the malware was moved to windows directory, Service is created:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LMj0lHcWIICgEL0OFYhO0Q.png" /><figcaption>Service creation in action</figcaption></figure><p><strong>Registry (T1547.001)</strong></p><p>At some point in the execution, malware creates a registry as second part of persistence method:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VrYoFkcNLDgrN20e1_SnJg.png" /><figcaption>Registry create key in HKCU\…\Run in action</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*beOkKRqZyblZ73YdCNttrw.png" /><figcaption>Registry set value to malware path in action</figcaption></figure><h4>Discovery Phase (TA0007)</h4><p>Information regarding currently run process was collected via CreateToolhelp32Snapshot function:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*r5A6JaBJfc1JNKSe3im8gw.png" /></figure><p>In addition, OS information was queried via RtlGetVersion and GetNativeSystemInfo:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*-xXCLqGiTmpwB7CWxU0M2A.png" /></figure><p>Last one is to derive a unique identifier based on desktop name and CRC32 of the binary:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x_PkRW5gRK5Vc_BZ5W9eLA.png" /><figcaption>Malware unique identifier for this desktop in ESP in action</figcaption></figure><p>These are the only three that are confirmed by the analyst to be exfiltrated later. Other information such as directories and such are not confirmed as of the writing.</p><h4>Exfiltration Phase (TA0010)</h4><p><strong>Encryption (T1573)</strong></p><p>It’s important to know that malware actually implements unknown data serialization algorithm based on the gathered information from the discovery phase:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*xl3M84-pBJsbTSGz3vFXSQ.png" /></figure><p>Next it would import an RSA public key from the same gibberish blob of data and proceeds to generate an AES-128 key to encrypt the serialized data with:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*GCyoUmCdq96b1ceadUL0lg.png" /></figure><p>It’s unknown where the hash result is used, likely as part of HMAC.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rTWxZ1gmNBg6R5AWvAe13A.png" /><figcaption>Malware encrypting the serialized payload with AES in action</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sGB2CT5-9uSGUcfZptclXA.png" /><figcaption>Malware exporting the key to be sent later to C2</figcaption></figure><p><strong>HTTP Request (T1071.001) and Base64 Encoding (T1132.001)</strong></p><p>Malware establishes communication with C2 server in order to send the now serialized, encrypted, and base64 encoded data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fqPNzBQNKz-c0qWR8YGu_A.png" /><figcaption>Malware trying to connect to C2 IP in action</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nwMaG2kF_YQg-dwAk_bePQ.png" /><figcaption>Base64 data to be sent to C2</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V3bobeDK3u4II_UzeNyESA.png" /><figcaption>Malware attempting to do POST request to /sess/srvc path to C2 URL</figcaption></figure><p>For more details consult Appendix D.</p><h3>Analysis Insight</h3><h4>Key Challenges and Resolution</h4><ol><li><strong>Malware relaunching</strong>: In order to avoid complete analysis by public sandbox tools (any.run, cuckoo, etc.), the malware attempts to relaunch itself with arguments and validate said arguments in order to launch real malware functions. <strong>Solution</strong>: Manipulate the program execution flow via debugger. Accuracy may suffer since preconditions are not fully met but it gives the analyst a lot more context regarding the program in a single analysis session.</li></ol><h4>Novel Findings</h4><ol><li>Custom polynomial hash for windows API</li><li>Process enumeration</li><li>Extended Attribute deletion</li><li>Malware relaunching multiple times to avoid analysis tools</li></ol><h4>Analysis Difficulty</h4><ol><li>This is the longest sample yet in terms of analysis time: spread of 8 days including this very report writing due to various issues</li><li>Figuring out data serialization</li></ol><h3>Appendix A — Indicators of Compromise</h3><p><a href="https://drive.google.com/file/d/1gWROwTmGdzPBXcLt3Q_TreQyyAm77V3J/view?usp=sharing">Indicators of Compromise</a></p><h3>Appendix B — Detection Recommendations</h3><p><a href="https://drive.google.com/file/d/12_i2eJN6BpuLZqkKo8Lo7d_uuBTdOeN1/view?usp=sharing">YARA</a></p><h3>Appendix C — ATT&amp;CK Entries</h3><p><a href="https://drive.google.com/file/d/1LUevkvL2UqV0herayMwneCD4tXZ7FzuJ/view?usp=sharing">ATT&amp;CK</a></p><h3>Appendix D — Analysis Artifacts</h3><p><a href="https://drive.google.com/file/d/1MREJAEVDOjLpLzDGaBAnFISm2li5vB3d/view?usp=sharing">Artifacts.pdf</a></p><h3>Appendix E — References</h3><p>FILE_OPFLAGS used for SHFileOperation: <a href="https://www.pinvoke.net/default.aspx/Enums/FILEOP_FLAGS.html">https://www.pinvoke.net/default.aspx/Enums/FILEOP_FLAGS.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f951c5515df5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Petya Malware Analysis Report]]></title>
            <link>https://medium.com/@antonilim18/petya-malware-analysis-report-a4ec0b886a7c?source=rss-45db010639e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4ec0b886a7c</guid>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[petya]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <dc:creator><![CDATA[Antoni]]></dc:creator>
            <pubDate>Mon, 18 Aug 2025 13:15:37 GMT</pubDate>
            <atom:updated>2025-08-18T13:15:37.074Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Sample:</strong> 26b4699a7b9eeb16e76305d843d4ab05e94d43f3201436927e13b3ebafa90739</p><h3>Executive Summary</h3><p>Malware Petya implements sophisticated anti analysis techniques to encrypt computers for financial motive. <strong>KEY RECOVERY POSSIBLE</strong>, High severity. Immediate action required to prevent further damage.</p><h3>Technical Analysis</h3><h4>Technical Summary</h4><p><strong>Objective:</strong> To encrypt computer at bootloader level for financial gain via ransom</p><p><strong>ATT&amp;CK Kill Chain:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/203/0*wxbIZQavlUbDQgIr" /></figure><p><strong>Key Findings:</strong></p><ol><li>Evasion via PEB walk and in-memory loading</li><li>PhysicalDrive access in order to query boot sector information and overwrite it</li><li>Derives symmetrical key from AES-CTR-128 algorithm and custom SHA256</li><li>Overwrites bootloader with malicious bootkit</li><li>Triggers kernel-level exception to force malicious bootkit to load</li></ol><p><strong>Critical ATT&amp;CK:</strong></p><ol><li>T1620 Reflective Loading</li><li>T1486 Bootkit Encryption</li><li>T1491.001 Ransom Display</li></ol><p><strong>Critical IoC:</strong></p><ol><li><strong>Dropper SHA256:</strong> 26b4699a7b9eeb16e76305d843d4ab05e94d43f3201436927e13b3ebafa90739</li><li><strong>Real malware SHA256:</strong> ae8aad97ce7d2b95911f8e1b602fbbc69d6b2b127c90cd08e66c34b1621a763f</li><li><strong>C2 URLs:</strong></li></ol><ul><li>hxxp://petya5koahtsf7sv[.]onion/</li><li>hxxp://petya37h5tbhyvki[.]onion/</li></ul><p>For an exhaustive list of ATT&amp;CK and IoC, consult Appendix A and Appendix B.</p><h3>Deep Dive</h3><h4>Initial Access (T1204.002)</h4><p>The malware posed itself as a “GoogleCrashHandler_unsigned.exe” which requires admin privilege and user interaction via execution.</p><h4>Anti-Analysis (T1620)</h4><p>From the dropper, it automatically loads the malicious function disguised as “__calloc_crt” via __mtinit function and calls it. From there it starts a lengthy assembly execution chain that involves the following:</p><ol><li>Obfuscation via redundant calls and/or instructions</li><li>PEB walk to retrieve critical loading functions</li><li>VirtualProtect RWX to ensure second stage DLL has execute permission</li><li>Decryption loop to load second stage DLL to memory</li><li>Jump to DLL via DLLEntryPoint</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*QVA3JvZIrt7h2BYY" /><figcaption>Post <strong>__calloc_crt</strong>, jumps to the start of the assembly chain</figcaption></figure><p>Next, the malware attempts to PEB walk and find API hash based on ROR13 algorithm:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vcdMV3ZqrqxDDyQT" /><figcaption>PEB Walk and ROR13 in action</figcaption></figure><p>As shown, it’s trying to get certain handles of either critical DLL or functions such as KERNEL32, LOADLIBRARYA, GETPROCADDRESS, etc. Next it tries to call VirtualProtect in order to ensure that the second stage DLL is executable in the memory itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9aE6gD7jjM_DPRqN" /></figure><p>Then the malware decrypts the second stage payload via XOR operation and jumps into DLLEntryPoint function:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*O3Y08-tVzJM4tref" /><figcaption>Second stage payload decryption with approx. 49KB in size</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-mm2Bi106RKAWRI4" /><figcaption>Malware calling second stage’s DLLEntryPoint in action</figcaption></figure><h4>Discovery Phase (TA0007)</h4><p>After the malware switches context to second stage, analyst discovered that it tries to query information regarding the boot sector via access to PhysicalDrive:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*K6-Kx2SD1CQkTfBV" /><figcaption>Malware attempts to retrieve pointer to PhysicalDrive</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yWqHUts5oJQ_lkZ2" /><figcaption>Malware retrieves partition information via DeviceIoControl</figcaption></figure><p>After this it checks whether the bootloader information is MBR/GPT and handles each case (while still maintaining uniform write later). After handling each case, it would call the payload construction function next and derive a symmetrical key while generating a unique identifier for the victim to be used as part of the ransom message.</p><h4>Impact Phase (TA0040)</h4><p>The malware derives a symmetrical key based on multiple algorithms, then it converts it into string representation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wEiq1hkh_bepFMNa" /><figcaption>Malware generating symmetrical key in action</figcaption></figure><p>Next it generates 6 bytes unique alphanumerical identifier to be used as the part of ransom message:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0Gzk2dy60gdNNK3C" /><figcaption>Malware after it finished constructing ransom message</figcaption></figure><p>Malware after it finished constructing ransom message</p><p>Analyst included the symmetrical key derivation process because for the next step it copies malicious bootkits <strong>including the symmetrical key itself</strong> into the boot sectors; specifically it tries to overwrite following boot sectors to achieve persistence:</p><ol><li>Initial malicious bootkit</li><li>Main bootkit</li><li>Ransom message</li><li>Encrypted bootkit, analysts hypothesize it’s the original bootkit.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cHds2PCNylkteY8Z" /><figcaption>Malware writing initial bootkit to bootloader in action</figcaption></figure><p>After it finishes writing into boot sectors, it raises a kernel-level exception via ntdll to force the victim to boot into the malicious bootkit, completing the killchain:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/0*wzAo4m7une3pFRi5" /><figcaption>Creates kernel exception 0xc0000050</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/0*qNtGmtK4n5gFzStd" /><figcaption>Ransom message after kernel exception was raised</figcaption></figure><p>For more details, consult Appendix C.</p><h3>Analysis Insight</h3><h4>Key Challenges and Resolution</h4><ol><li><strong>Debugging:</strong> Analyst had problem when trying to debug the malware in IDAPro due to gibberish instruction being generated, and debugging the second stage DLL with IDAPro. <strong>Resolution:</strong> switch to x32/x64 debugger with automatic DLL loading and coherent assembly</li><li><strong>Anti-analysis:</strong> The sample tried to PEB walk and load critical functions by matching ROR13 hash with predetermined value. The analyst failed to implement a clean room for this. <strong>Resolution:</strong> Look up ROR13 hash that matches the cmp instructions</li></ol><h3>Novel Findings</h3><p>Despite being known malware, manual analysis revealed:</p><ol><li>Reflective Loading: By including the second stage payload inside the dropper, and employing PEB walk, it ensures the second stage payload remains undetected</li><li>Bootloader probing: Passes “<strong>\\.\C:</strong>” or “<strong>\\.\PhysicalDrive0</strong>” into CreateFile to gain access to physical disk storage</li><li>Bootloader overwriting: By overwriting initial boot code with malicious 16-bit based instructions, it ensures the victim boots into ransom message along with ensuring its persistence by writing other boot sectors</li></ol><h3>Analysis Difficulty</h3><p>Four full days are spent to complete the analysis and report. This is personally the most difficult yet due to the obfuscation and Reflective Loading that is present in the dropper, and figuring out bootloader stuff.</p><h3>Appendix A — Indicators of Compromise</h3><p><a href="https://drive.google.com/file/d/1SuXsZ62OPcjO1kTnsUTDv1sd4tV4rZbw/view?usp=sharing">IoC CSV File</a></p><h3>Appendix B — Detection Recommendations</h3><p><a href="https://drive.google.com/file/d/1f9Hh7p9VqAC-VUN2PSdL6RC8gQzQJR1M/view?usp=sharing">YARA</a></p><p><a href="https://drive.google.com/file/d/1ERS9wX1exa1PEVpHLiMxV1vvFQDFZ0Mp/view?usp=sharing">ATT&amp;CK</a></p><h3>Appendix C — Analysis Artifacts</h3><p><a href="https://drive.google.com/file/d/157wbxW3RW1sVAJmAbw1vpOqOFbsKuQ1r/view?usp=sharing">Compiled artifacts in PDF</a></p><h3>Appendix D — References</h3><p>IOCTL Codes: <a href="https://github.com/tpn/winsdk-7/blob/master/v7.1A/Include/WinIoCtl.h">https://github.com/tpn/winsdk-7/blob/master/v7.1A/Include/WinIoCtl.h</a></p><p>Reflective DLL Loading Code and API Hash: <a href="https://gist.github.com/Niko10/578e8945f142070a7cff10e7d617bbef">https://gist.github.com/Niko10/578e8945f142070a7cff10e7d617bbef</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4ec0b886a7c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ploutus-L Malware Analysis Writeup]]></title>
            <link>https://medium.com/@antonilim18/ploutus-l-malware-analysis-writeup-7de0f5268a4c?source=rss-45db010639e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/7de0f5268a4c</guid>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[static-code-analysis]]></category>
            <dc:creator><![CDATA[Antoni]]></dc:creator>
            <pubDate>Mon, 11 Aug 2025 10:52:34 GMT</pubDate>
            <atom:updated>2025-08-11T10:52:34.465Z</atom:updated>
            <content:encoded><![CDATA[<h3>Executive Summary</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kLMSEfSH4E9ZdY78" /><figcaption>Malware kill chain</figcaption></figure><p>This article analyzes Ploutus-L malware which demonstrates great knowledge of eXtensions for Financial Services (which will now be abbreviated as XFS) middleware to manipulate cash dispensing operations on ATM while displaying fake maintenance message.</p><p>Key Findings:</p><ol><li>Target XFS Compliant ATM</li><li>Manipulates execution context for interactive ATM control</li><li>Cash accounting manipulation</li><li>Optimization algorithm to maximize theft</li></ol><p>Yara</p><pre>rule ATM_XFS_Malware {<br>  meta:<br>    author = &quot;SOC Team&quot;<br>  strings:<br>    $xfs1 = &quot;WFSExecute&quot;<br>    $xfs2 = &quot;WFSGetInfo&quot; <br>    $xfs3 = &quot;msxfs.dll&quot;<br>    $reg = &quot;NoInteractiveServices&quot;<br>    $usb_check = &quot;\\\\\\\\.\\\\PhysicalDrive1&quot;<br>    $killswitch = &quot;C:\\\\xfs\\\\license.dat&quot; <br>  condition:<br>    3 of ($xfs*) and $reg and $usb_check and not $killswitch<br>}</pre><p>IoCs</p><ul><li>d9c1151ac686be204e2bdf368130fdb972668d3090b9f9fb0d0e60ebae473776</li><li>HKLM\SYSTEM\CurrentControlSet\Control\Windows\NoInteractiveServices set to 0</li><li>WFSExecute with commands 303, 311, 304</li><li>WinStationSwitchToServicesSession</li></ul><h3>Technical Analysis</h3><h4>Exploitation Context</h4><p>The malware first tries to build some exploitation context:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/0*TK39pJS4JioZqKbA" /><figcaption>Enable interactive services in registry</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/0*RKRyFDmqyx6pe3tg" /><figcaption>Create window with primary function and check if the windows version is vista or higher to switch to service session</figcaption></figure><p>These snippet shows that the malware tries to launch fake maintenance message for malicious purpose in which we will dive in.</p><h4>XFS/CDM Recon</h4><p>The malware attempts to enumerate the XFS that the ATM is using by establishing connection via WFSOpen function call:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/0*pkJtjdSv5cQ1bZlY" /><figcaption>Malware enumerates available XFS</figcaption></figure><p>Next, it determines which logic to take based on the obtained XFS and its version. It can simply set money to be taken, or try to optimize the bank notes types to maximize theft value.</p><h4>Anti Forensic</h4><p>By leveraging the XFS API, specifically the WFS_CMD_START_EXCHANGE and WFS_CMD_END_EXCHANGE, it can wipe transaction history and make analysis more difficult:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/0*pgI2AF397BwZQrsN" /><figcaption>Use WFSExecute to leave null transaction history</figcaption></figure><h4>Banknote record falsification</h4><p>If it can, the malware will forge a fake banknote count in order to avoid detection:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/0*b5sqTS7v_boPBjgW" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/0*BtOC0XACWrgptT74" /><figcaption>Set fake Cash Unit information to avoid detection</figcaption></figure><h4>Banknote optimization</h4><p>The malware can optimize the available banknotes (i.e. selects the high value banknotes) on the ATM and perform optimization based on Knapsack problem, maximizing the theft value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/473/0*U-u8G0CvVaWpkfhj" /><figcaption>Knapsack retrieval algorithm to maximize theft</figcaption></figure><h4>Theft</h4><p>Using WFS API, it can withdraw the available banknotes while leaving behind the forged banknote count as stated in <strong>Anti Forensic</strong> section above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/0*9PP6B_KX-HCUjkaK" /><figcaption>Money theft in action</figcaption></figure><h3><strong>PostScript</strong></h3><p>This is the first of many malware analysis I’m going to cover and post here in Medium as part learning how malware operates, how to write detection and mitigate the malware threat. Thanks to VX-UG for providing free malware samples for people to dissect and study!</p><h3>Appendix</h3><p>XFS API spec: <a href="https://www.cencenelec.eu/media/CEN-CENELEC/AreasOfWork/CEN%20sectors/Digital%20Society/CWA%20Download%20Area/XFS/16926-1.pdf">https://www.cencenelec.eu/media/CEN-CENELEC/AreasOfWork/CEN%20sectors/Digital%20Society/CWA%20Download%20Area/XFS/16926-1.pdf</a></p><p>XFS CDM spec: <a href="https://www.cencenelec.eu/media/CEN-CENELEC/AreasOfWork/CEN%20sectors/Digital%20Society/CWA%20Download%20Area/XFS/16926-5.pdf">https://www.cencenelec.eu/media/CEN-CENELEC/AreasOfWork/CEN%20sectors/Digital%20Society/CWA%20Download%20Area/XFS/16926-5.pdf</a></p><p>Malware sample:<br><a href="https://vx-underground.org/Samples/ATM%20Malware/ATM%20Malware">https://vx-underground.org/Samples/ATM%20Malware/ATM%20Malware</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7de0f5268a4c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>