<?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 Sahil Sarnaik on Medium]]></title>
        <description><![CDATA[Stories by Sahil Sarnaik on Medium]]></description>
        <link>https://medium.com/@ssarnaik48?source=rss-62ee11dfe2f0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*oyXU29OwRZ1r2hCM</url>
            <title>Stories by Sahil Sarnaik on Medium</title>
            <link>https://medium.com/@ssarnaik48?source=rss-62ee11dfe2f0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 02:03:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ssarnaik48/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[Escaping the Malware Mayhem]]></title>
            <link>https://medium.com/@ssarnaik48/escaping-the-malware-mayhem-152956724a98?source=rss-62ee11dfe2f0------2</link>
            <guid isPermaLink="false">https://medium.com/p/152956724a98</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <dc:creator><![CDATA[Sahil Sarnaik]]></dc:creator>
            <pubDate>Tue, 31 Oct 2023 08:56:28 GMT</pubDate>
            <atom:updated>2023-10-31T13:08:04.587Z</atom:updated>
            <content:encoded><![CDATA[<h4>Malware analysis insights using static and dynamic analysis.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mSNUzgwANKG_xD9UNUq_og.jpeg" /></figure><p><strong>Introduction:</strong></p><p>In the ever-changing digital world, cybersecurity is like a battleground where hidden adversaries are always trying to find vulnerabilities in our defences. As malware becomes more advanced and complex, it’s crucial that we have equally advanced ways to protect ourselves. In this blog we will be analyzing a file using static and dynamic methods. This blog requires basic understanding and working of static and dynamic analysis tools like PEStudio, CFF Explorer, Procmon, Process Explorer, Regshot and Autoruns.</p><p><strong>SHA1:</strong> b43b878f52e93dcac435e012db85d5151b55f4f6</p><p><strong>SHA256:</strong> 19ff214fd7feb452a76b299e36831705cc3cc11c3d5deb6ff4a9df6138aacd4c</p><p><strong>MD5:</strong> 1694977bcb788f91d08d563e65e1b6a8</p><p><strong>Tools used:</strong></p><p>It is important to create an isolated environment(virtual machine) before downloading any malware. You can download any Hypervisor like OracleBox or Hyper-V. I have used Hyper-V for this demonstration. Download all the below tools in the virtual machine.</p><p><strong>Disclaimer</strong>: Do not download or execute any malware on the host machine. It can end up infecting your machine and can cause unexpected outcomes.</p><p>PE Structure Analysis: CFF Explorer, Hex Editor</p><p>static analysis: PE Studio, Detect It Easy, CFF Explorer</p><p>Dynamic analysis: Regshot, Procmon, Process Explorer, Fakenet, Autoruns.</p><p><strong>PE Structure:</strong></p><p>PE structure is a data structure that tells the Windows OS loader what information is required to manage the wrapped executable code. Understanding this structure is like peeking behind the scenes to see how programs work.</p><p>1) <strong>Dos Header</strong>:(Size: 64 bytes)</p><p>⦁ e_magic</p><p>This includes the first 2 bytes of the DOS Header. The hexadecimal value is 5A4D. (It appears as 4D5A in Hex Editor, but it is in Little Endian format. Hence it is read backwards as 5A4D). The ASCII conversion is MZ.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*-ErpXInnIMf5hUmac49rxQ.png" /><figcaption>e_magic field (Screenshot from CFF explorer)</figcaption></figure><p>⦁ e_lfanew</p><p>The last 4 bytes of the DOS Header is the e_lfanew field. It gives the offset of the PE Header. Here, e_lfanew field is 000000E8.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*oYgiV-Ar4pc7UvgMKJSODw.png" /><figcaption>e_lfanew field(CFF Explorer)</figcaption></figure><p>2) <strong>DOS Stub:</strong> (Size: 64 bytes)</p><p>Includes the message “This program cannot be run in DOS mode”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*00P9dg6JMNFQXw9t1d8dnw.png" /><figcaption>DOS Stub(CFF Explorer)</figcaption></figure><p>3)<strong> NT Headers:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*qGhvCK7zQk-rlouMB4mA0w.png" /><figcaption>NT Header (CFF Explorer)</figcaption></figure><p>⦁ Signature:</p><p>It is the signature of PE file which is represented as PE.. .In this file, the Hexadecimal value is 00 00 45 50.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*P0n7Znh5Ex6Qx2Qd8qnKng.png" /><figcaption>Signature of PE Header (CFF Explorer)</figcaption></figure><p>⦁ Machine:</p><p>It signifies the type of machine the file is intended to run on. The ‘L’ (Hexadecimal value 4C)implies that the architecture is 32 bits. (Intel 386)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*46dqLV1dPn3rfCfaPnDtIw.png" /><figcaption>Machine Type (CFF Explorer)</figcaption></figure><p>⦁ Number Of Sections:</p><p>Signifies the total number of sections present. Here the value is 00 04. Hence, a total 4 sections are present.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*MZmG9TwVzOMxSjKF14_ETQ.png" /><figcaption>Number of Sections (CFF Explorer)</figcaption></figure><p>⦁ Timestamp:</p><p>Hexadecimal value of timestamp= 64 4C 3F 86</p><p>Decimal Value = 1,68,27,18,598</p><p>Date and Time= Fri April 28 21:49:58 2023| UTC</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*RZ_8cqr1AsTvr5dpyWTWrQ.png" /><figcaption>Timestamp of PE file (CFF Explorer)</figcaption></figure><p>4) <strong>Image_Optional_Header:</strong></p><p>The name is misleading and it is not optional. Image_Optional_Header contains critical information about the the PE file. The Image Optional Header includes various fields, and some of the important fields include:</p><p>Image Base: This field specifies the preferred base address in memory where the executable should be loaded. It helps reduce address conflicts when multiple programs are running simultaneously.</p><p>Address Of Entry Point: This field indicates the memory address where the program’s execution should begin. It’s the starting point for the program’s code.</p><p>Image Base: This field specifies the size of the image in memory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*wPDdP5m_gIHqGIIo7onZng.png" /><figcaption>Image_Optional_Header (CFF Explorer)</figcaption></figure><p><strong>Static Analysis:</strong></p><p><strong>Footprints:</strong></p><p>SHA256: 19ff214fd7feb452a76b299e36831705cc3cc11c3d5deb6ff4a9df6138aacd4c</p><p><strong>File Packing:</strong></p><p>The File has an entropy of 6.719 which implies that the file is not packed. However, the .text section is packed with an entropy of 7.48. Entropy refers to a measure of the randomness or disorder within the file. The entropy is measured on a scale of 0 to 8. 0 being the lowest and 8 being the highest. High entropy (close to 8) indicates a higher degree of randomness, which can suggest the presence of encrypted or compressed data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*khS3wwEO3A2E6_e4o2QrIQ.png" /><figcaption>Entropy (DetectItEasy)</figcaption></figure><p><strong>Properties:</strong></p><p>The file is an executable (.exe)</p><p>Architecture: 32 bit</p><p>File Size: 285 kb</p><p>PE size: 285 kb</p><p>Intended Machine: Intel-386</p><p><strong>Subsystem:</strong></p><p>Windows GUI</p><p><strong>Compiler:</strong></p><p>Microsoft Visual C++ 9.0</p><p><strong>Import Table:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xemu5X8eIvyYcwjDSSHQyA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kfjpRru2Nzl-O7f825yzzg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bLy9t2hsM__JryJ8mjUeBw.png" /><figcaption>Import table of the file (PEStudio)</figcaption></figure><p><strong>Atom Bombing</strong>: It is a data transfer technique. Atom tables are a way to share data between processes. <strong>GlobalFindAtom</strong> and <strong>GlobalAddAtom </strong>functions can be used to add malicious code as a String to the atom table.</p><p><strong>LoadLibraryW</strong> and <strong>LoadLibraryA</strong> It is used to load a dynamic-link library (DLL) into the memory of a running process.</p><p><strong>IsDebuggerPresent</strong> function can be used by the malware authors to detect the presence of a debugger in the system. The malware can be programmed to destroy itself if a debugger is present in the system.</p><p><strong>String Analysis:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TTgJLXIpuvy2oMXPLtoRlg.png" /></figure><p>2 URL patterns were found in the strings.</p><p>“<strong>28.10.31.48</strong>”</p><p>“<strong>18.10.50.29</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rmNQxmg2QUCLJO4YvoxrFQ.png" /></figure><p>A hardcoded file path to the C drive was found in the Strings which is suspicious.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pwXaV0kupnYYp6HcxFsgYw.png" /></figure><p>The following strings were found which are found to be suspicious.</p><p>“Please Contact the application’s support team for more information”</p><p>“This indicates a bug in your application..”</p><p>“This application has requested the runtime to terminate it in an unusual way.”</p><p><strong>Dynamic Analysis:</strong></p><p>It is essential to execute the malware in an isolated and safe environment called a sandbox to analyse its behaviour.</p><p>Steps:</p><p>⦁ Set up the sandbox environment using a hypervisor.</p><p>⦁ Disable the Windows Defender, Firewall, antivirus and Realtime protection. If any of these is turned on, the malware can be automatically deleted from the system or may hinder the execution of the malware.</p><p>⦁ Turn on fakenet. It creates a simulated network environment, allowing researchers and analysts to observe and capture the network behavior of malware samples in a controlled setting.</p><p>⦁ Open all the tools: Process Explorer, Procmon, Regshot and Wireshark.</p><p>⦁ Take the first shot of Regshot.</p><p>⦁ Execute the file and observe changes in Process Explorer. In the case of this file, the file disappeared from Process Explorer in just 2–3 seconds.</p><p>⦁ Take the 2nd shot of Regshot after approx. 5 minutes of execution. Compare both shots to analyse registry changes.</p><p>⦁ Apply the filter on Procmon of process name of the file.</p><p><strong>Regshot:</strong></p><p>It is an open-source software utility that is used for Windows registry comparison. It allows users to take snapshots of the Windows registry at different points in time, typically before and after the execution of the file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wuec317jhWt6RaTPAVeBUQ.png" /></figure><p>The file was observed to delete itself from the folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*Uhc6LcB35CowdWhrovdZtw.png" /></figure><p>The file dropped another executable named rdtgutlp.exe in C:\User\admin folder.</p><p><strong>Procmon</strong></p><p>Procmon, short for Process Monitor, is a part of the sysinternals suite that provides real-time monitoring and detailed logging of system and application activities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*YscgPvkVtiBs6gHlR7OC1g.png" /><figcaption>Process tree of the file in Procmon</figcaption></figure><p>After analysing the process tree the file is accessing “<strong>wusa.exe</strong>” which is Windows Update Standalone Installer. The Windows Update Standalone Installer uses the Windows Update Agent API to install update packages. This API can be used for malicious purposes like process injection.</p><p>It is also accessing the dropped <strong>rdtgutlp.exe</strong> file.</p><p>The <strong>rdtgutlp.exe</strong> file is <strong>flagged as malicious</strong> by 43 security vendors in virus total.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zQVxa7qNirR9pwombUu8GA.png" /><figcaption>Virus Total report of <strong>rdtgutlp.exe</strong></figcaption></figure><p>I <strong>reverted the state of the virtual machine</strong> and ran the file again. The File dropped yet another file which had a completely different name.</p><p>Regshot comparison of new dropped file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*3qjgDos-GpHkduHHkDxjbg.png" /><figcaption>The file dropped another file named <strong>pnxyawzf.exe</strong>.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zdTCwhU1runjCTSEUI6PrA.png" /></figure><p>the file added the value to the “<strong>CurrentVersion\Run</strong>” registry. Adding a value to the “CurrentVersion\Run” registry key signifies that a program or script is configured to run automatically when the user logs into their computer. The “CurrentVersion\Run” key is part of the Windows Registry and is typically used to manage start-up applications and processes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wY2ZRqabB6DiXEZ1oALyMA.png" /><figcaption>Autorun application</figcaption></figure><p>The same can be seen in <strong>Autoruns</strong> application. Autoruns is a powerful utility developed by Microsoft and Sysinternals that provides a detailed view of all the programs and processes that start automatically when you boot up your Windows computer or log in.</p><p><strong>File added:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OqF1lBTe0VhA7myNbvfnxA.png" /><figcaption>The dropped file can be seen in C:\user\admin folder.</figcaption></figure><p>Virus Total report of the new dropped “<strong>pnxyawzf.exe</strong>” file. 50 vendors flagged the file as malicious.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j9O2E1FbyCMKY6g7RYQd2A.png" /></figure><p><strong>Threat Intelligence report of the original file:</strong></p><p>Virus Total:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mRnqdBKv40ngmZTdujinLg.png" /></figure><p>Cisco Talos :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nqJoSjLtrKuAupF1aLamuw.png" /></figure><p><strong>Conclusion:</strong></p><p>From the static and dynamic analysis we can conclude that-</p><p>⦁ The file is dropping another file after its execution. However, the dropped file is different every time with a different hash.</p><p>⦁ The file is deleting itself right after its execution and dropping another file.</p><p>⦁ The file is adding a value in registry which enables the file to run automatically every time the user logs in the system.</p><p>⦁ Hence, the file can be concluded as a malicious file with the category of dropper.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=152956724a98" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>