<?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 Mert NAR on Medium]]></title>
        <description><![CDATA[Stories by Mert NAR on Medium]]></description>
        <link>https://medium.com/@mrt.narr?source=rss-85e559a1b856------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*NPlKj1SFe4EcrYUC</url>
            <title>Stories by Mert NAR on Medium</title>
            <link>https://medium.com/@mrt.narr?source=rss-85e559a1b856------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 15:22:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mrt.narr/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[1/11. Malware analysis and Reverse Engineering Series —Laboratory Setup]]></title>
            <link>https://medium.com/@mrt.narr/1-11-malware-analysis-and-reverse-engineering-series-laboratory-setup-900e5e2e16b0?source=rss-85e559a1b856------2</link>
            <guid isPermaLink="false">https://medium.com/p/900e5e2e16b0</guid>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[laboratory]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[virtual-machine]]></category>
            <dc:creator><![CDATA[Mert NAR]]></dc:creator>
            <pubDate>Thu, 20 Mar 2025 09:36:19 GMT</pubDate>
            <atom:updated>2025-03-20T09:41:52.525Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*eE34QWHoBA3GJrS5vCx4tg.png" /></figure><p>This blog is a comprehensive training series for malware analysis and reverse engineering studies. I created this training series to explain my research and the information I have collected on malware analysis and reverse engineering in the simplest way possible and to simplify and convey with examples. The first training of the series is on setting up a laboratory. Throughout the series, I aim to share what I have learned in my master’s studies and my cybersecurity experience with examples and applications. Thank you for reading and taking the time. If you have any questions, please do not hesitate to send me an email.</p><p>The blog series will be released in accordance with the master’s thesis, with each topic featuring its own dedicated blog post.</p><p><strong>All Topics of the Series:</strong></p><ol><li>Laboratory Setup 👈</li><li>Analysis Methods and Techniques</li><li>Operating Systems</li><li>Malware</li><li>Static Analysis</li><li>Dynamic Analysis</li><li>Stealth Techniques</li><li>Learning Algorithms and Applications</li><li>Taint Analysis</li><li>Malware Classification and Detection Method</li><li>Anti-malware &amp; Development with C++</li></ol><h3>Laboratory Setup</h3><h4><strong>Contents</strong></h4><ol><li>Introduction</li><li>Virtual Machines</li><li>Static Analysis Environment</li><li>Dynamic Analysis Environment</li></ol><h3><strong>Introduction</strong></h3><blockquote>#What is malware? #How to analyze it briefly? #What tools are needed? #Why do we need to set up a laboratory? #What should we pay attention to?</blockquote><p>The term “malware” refers to programs with the explicit intent to cause damage to, steal from, or otherwise take control of computer systems. Looking at it from a different angle, we can see that while software is designed to help people who work with computers (the good guys) by solving problems, malicious software is used by cyber attackers (the bad guys), also known as hackers, to either aid in their work or carry out the attack themselves. In the context of data protection, it is crucial to comprehend and evaluate these.</p><p>In addition to combining or sequentially operating several program elements, malicious software can also exist as standalone software. Furthermore, it has the ability to manifest as a payload. Put simply, instead of being a standalone executable file, it can masquerade as a payload utilized in cyber assaults, which is a special sort of code that can only be executed during certain types of attacks like process injection.</p><p>There are several types of malicious software. Here are the primary types based on their behavior:</p><ul><li><strong>Viruses:</strong> Spread by copying themselves into other programs</li><li><strong>Worms:</strong> Software that can replicate and spread on its own</li><li><strong>Trojan Horses:</strong> Programs that appear as useful software but perform hidden malicious operations.</li><li><strong>Ransomware: </strong>Software that encrypts files and demands ransom.</li><li><strong>Spyware:</strong> Software that secretly collects and sends user information and activities.</li></ul><h4><strong>Malware Analysis</strong></h4><p>Malware analysis basically falls into two main categories:</p><p><strong>1. Static Analysis</strong></p><p>It is a method of examining malware without running it. The structure, code, and features of the file are examined:</p><ul><li>File signatures are checked</li><li>File headers and metadata are analyzed</li><li>Suspicious API calls are identified</li><li>Code structure is examined</li></ul><p><strong>2. Dynamic Analysis</strong></p><p>It is a method of running malware in an isolated environment and observing its behavior.</p><ul><li>File system changes are recorded</li><li>Network traffic is monitored</li><li>Registry changes are tracked</li><li>System/API calls are analyzed</li></ul><p><strong>Tools</strong></p><p>The main tools used in malware analysis are:</p><ul><li><strong>Disassembler/Debugger</strong>: IDA Pro, Ghidra, OllyDbg, x64dbg</li><li><strong>Virtualization tools</strong>: VirtualBox, VMware gibi</li><li><strong>Network Analysis Tools</strong>: Wireshark, NetworkMiner</li><li><strong>System Monitoring tools: </strong>Process Monitor, Process Explorer</li><li><strong>Sandbox Solutions</strong>: Cuckoo Sandbox, ANY.RUN, Joe Sandbox</li><li><strong>File Analysis Tools</strong>: PEStudio, Exeinfo PE, PEiD</li><li><strong>Memory Analysis Tools</strong>: Volatility, Rekall</li></ul><p><strong>Why Should We Establish a Laboratory?</strong></p><p>Establishing a dedicated laboratory for malware analysis is important for the following reasons:</p><p><strong>Isolation</strong>: To prevent malware from infecting real systems<br><strong>Controlled Environment</strong>: To better observe behavior<br><strong>Security</strong>: To avoid harming other systems during analysis<br><strong>Repeatable</strong>: To be able to repeat tests under the same conditions<br><strong>Data Collection</strong>: To collect analysis results more efficiently</p><p><strong>Things to Consider When Setting Up a Laboratory</strong></p><p>When setting up a malware analysis laboratory, the following points should be taken into consideration:<br><strong>Network Isolation:</strong> The laboratory network should be completely isolated from the corporate network<br><strong>Backup Systems: </strong>Snapshots feature that can back up the system state before analysis<br><strong>Various Test Environments: </strong>Virtual machines with different operating systems and versions<br><strong>Physical Security:</strong> Access restrictions to the laboratory<br><strong>Data Loss Prevention:</strong> Safe storage of analysis results<br><strong>Network Simulation: </strong>Features that simulate the real network environment<br><strong>Up-to-date Tools:</strong> Keeping analysis tools constantly up-to-date</p><p>Malware analysis is a constantly evolving field. Since threat actors are constantly developing new techniques, it is critical to keep your laboratory and information up-to-date. It is also important to remember that malware can sometimes detect virtual environments and change its behavior, so physical test environments may be necessary in some cases.</p><p><strong>Types of Malware</strong></p><p>Malware is divided into many different types, each with its own unique behavior and infection methods. Below are the main types of malware and their characteristics:</p><p><strong>Classic Malware</strong></p><p><strong>Viruses</strong></p><p>Viruses are malicious codes that attach themselves to other programs or files in order to replicate themselves. They become active when a program is run or a file is opened. Subtypes of viruses include:</p><ul><li><strong>Boot Sector Viruses:</strong> They settle into the computer’s boot partition and run at every startup</li><li><strong>File Viruses: </strong>They attach themselves to executable files (.exe, .dll, etc.)</li><li><strong>Macro Viruses:</strong> They hide in macros in applications such as Microsoft Office</li><li><strong>Polymorphic Viruses:</strong> They avoid antivirus detection by constantly changing themselves</li><li><strong>Metamorphic Viruses:</strong> They make antivirus detection difficult by completely changing and rewriting their code</li></ul><p><strong>Worms</strong></p><p>Worms are harmful programs that can replicate and spread without infecting other applications. They can spread throughout a network without user intervention:</p><ul><li><strong>Email Worms: </strong>Spread by email attachments.</li><li><strong>Network Worms</strong>: spread by exploiting network weaknesses.</li><li><strong>IM Worms:</strong> Spread through instant messaging programs.</li><li><strong>IoT Worms:</strong> spread by infecting smart gadgets.</li></ul><p><strong>Trojans</strong></p><p>Trojans are software that appear to be a useful program to the user, but perform malicious activities in the background:</p><ul><li><strong>Backdoor Trojans:</strong> Provide covert access to the system</li><li><strong>Downloader Trojans:</strong> Download and install additional malware</li><li><strong>DDoS Trojans</strong>: Used for distributed denial of service attacks</li><li><strong>Data Stealing Trojans:</strong> Steal personal information</li></ul><p><strong>Modern Malware</strong></p><p><strong>Ransomware</strong></p><p>Malicious software that encrypts user files and demands a ransom for the decryption key:</p><ul><li><strong>Encryptor Ransomware:</strong> Blocks access by encrypting files</li><li><strong>Lock Screen Ransomware: </strong>Blocks access by locking the computer</li><li><strong>Doxware:</strong> Threatens to leak information instead of encrypting it</li><li><strong>MBR Ransomware: </strong>Encrypts the computer’s Master Boot Record and prevents it from starting</li></ul><p><strong>Spyware</strong></p><p>Gathers data from the user’s computer are malicious software designed to:</p><ul><li><strong>Keyloggers:</strong> Record user’s keystrokes</li><li><strong>Screen Recorders: </strong>Record user’s screenshots</li><li><strong>Browser Spyware: </strong>Monitor browser behavior and input</li><li><strong>Mobile Spyware: </strong>Monitor communication and data on mobile devices</li></ul><p><strong>Adware</strong></p><p>Software that displays unwanted advertisements and disrupts the user experience:</p><ul><li><strong>Browser Advertising Software: </strong>Displays advertisements by modifying the browser</li><li><strong>Redirect Advertising Software: </strong>Directs the user to advertising sites</li><li><strong>Pop-up Advertising Software: </strong>Displays unwanted pop-up advertisements</li></ul><p><strong>Rootkits</strong></p><p>Malicious software that hides its presence by gaining deep access to the system:</p><ul><li><strong>User Mode Rootkits:</strong> Run at the user level of the operating system</li><li><strong>Kernel Mode Rootkits</strong>: Run at the kernel level of the operating system</li><li><strong>Bootkits:</strong> Target the computer’s startup process</li><li><strong>Firmware Rootkits:</strong> Embedded in the hardware’s firmware</li></ul><p><strong>Special Malware</strong></p><p><strong>Botnets</strong></p><p>Software used to create remotely controlled computer networks:</p><ul><li><strong>IRC Botnet Tools:</strong> Controlled over IRC</li><li><strong>HTTP Botnet Tools:</strong> Controlled over the web protocol</li><li><strong>P2P Botnet Tools:</strong> Work without a central server</li><li><strong>IoT Botnet Tools:</strong> Target smart devices</li></ul><p><strong>Cryptojacking</strong></p><p>Software that uses the user’s computer resources without permission to mine cryptocurrencies:</p><ul><li><strong>Browser-Based Mining:</strong> Mining scripts that run in the web browser</li><li><strong>System-Based Mining:</strong> Mining software installed on the computer</li></ul><p><strong>Advanced Persistent Threats (APT)</strong></p><p>Sophisticated malware used for long-term and targeted attacks:</p><ul><li><strong>State-Sponsored APTs:</strong> Used for national security or political purposes</li><li><strong>Industrial APTs: </strong>Used for corporate espionage or data theft</li></ul><p><strong>Infostealer</strong></p><p>Malicious software that targets specific types of information software:</p><ul><li><strong>Password Thieves:</strong> Steal saved passwords</li><li><strong>Form Thieves: </strong>Steal information entered into web forms</li><li><strong>Browser Thieves:</strong> Steal browser history and cookies</li><li><strong>Crypto Wallet Thieves:</strong> Target cryptocurrency wallets</li></ul><p><strong>Mobile Malware</strong></p><p>Malicious software that targets smartphones and tablets:</p><ul><li><strong>SMS Trojans:</strong> Subscribe to premium SMS services</li><li><strong>Mobile Banking Trojans: </strong>Steal banking information</li><li><strong>Mobile Ransomware:</strong> Software that locks mobile devices or encrypts data</li><li><strong>Mobile Spyware:</strong> Tracks location, message and call information</li></ul><p>On top of that, new threat actors are always coming up with different hybrid malware types and methods. Malware is notoriously difficult to classify since it frequently combines numerous harmful traits to increase its effectiveness and evade detection. Malware behaviors should be examined by concretizing and disclosing them rather than by categorizing them.</p><p>In this post, I will impart all the meagre wisdom I have gained from the Laboratory setup, the initial course in Malware Analysis and Reverse Engineering. The blog will cover six topics: virtual machine setups, static and dynamic analysis environments, virtual networks, open source sandbox setups, fake networks, and online tool analysis. Here you will find a summary of each topic at the end, as well as questions to answer at the beginning of each section.</p><h3><strong>Virtual Machine</strong></h3><blockquote>#What is virtualization? #Why is it important in malware analysis? #How is virtualization done? #Which virtual machines will we need and why? #How to set up a virtual network? #Virtual machine security when analyzing malware #How can we avoid the virtual machine being detected by malware?</blockquote><h4>1. Introduction</h4><p>Virtualization is a technology that allows multiple operating systems or applications to run independently on physical hardware. Basically, it creates virtual machines (Virtual Machines — VM) or containers by dividing hardware resources.</p><p>Virtualization is performed through a software called hypervisor. Hypervisor manages the communication between physical hardware and virtual machines and allocates the necessary resources to each virtual machine.</p><p>Virtual machines are independent operating systems running on physical hardware. Each virtual machine has components such as operating system (Guest OS), virtual disk, virtual CPU, RAM and network adapter.</p><p><strong>Virtualization is performed with two types of hypervisors:</strong></p><p><strong>Type 1 Hypervisor (Bare Metal Hypervisor)</strong></p><ul><li>Runs directly on physical hardware.</li><li>Better in terms of performance.</li><li>Examples: VMware ESXi, Microsoft Hyper-V, KVM</li></ul><p><strong>Type 2 Hypervisor (Host-Based Hypervisor)</strong></p><ul><li>Virtualization software that runs on an operating system.</li><li>Used mostly in test and development environments.</li><li>Examples: VMware Workstation, VirtualBox</li></ul><p>Research on malware’s <strong>actions</strong>, <strong>consequences</strong>, and <strong>preventative measures</strong> relies heavily on virtual machines <strong>because</strong>:</p><p><strong>Provides a Secure Environment:</strong> Since virtual machines run in an isolated environment, malware cannot harm the physical system.</p><p><strong>Provides Retrievability (Snapshot) Support:</strong> By taking a snapshot of a virtual machine, a clean system can be easily returned to after analysis.</p><p><strong>Provides the Opportunity to Test Different Operating Systems:</strong> Malicious software can exhibit different behaviors on different operating systems. Thanks to virtualization, analysis can be performed on different systems such as Windows, Linux or macOS.</p><p><strong>Facilitates Monitoring Network Traffic:</strong> The communication of the malware with the Internet can be limited within the virtual network and can be examined securely.</p><p><strong>Can be Used for Dynamic and Static Analysis:</strong> While the code of the malicious file is examined for static analysis, the behavior of the malware at runtime can be tested within the virtual machine for dynamic analysis.</p><blockquote><strong>🚨 Things to Watch Out For:</strong><br>Some advanced malware may behave differently or refuse to run when it detects that it is running inside a virtual machine. More advanced anti-sandbox techniques can be used to analyze such malware.</blockquote><h4><strong>Setup</strong></h4><p>Setting up a secure virtualization environment for malware analysis allows you to analyze malware while protecting your system. Now let’s list what we will do step by step.</p><ol><li><strong>Virtualization Software Selection:</strong></li></ol><p>We will use virtualbox because it has a free version and allows you to use the snapshot feature for free. If you wish, you can also install your own lab on that virtualization software by choosing one of the following:</p><ul><li><strong>VirtualBox</strong> (Free)</li><li><strong>VMware Workstation Pro</strong> (Paid, more advanced)</li><li><strong>Hyper-V</strong> (Windows’ own virtualization tool, but with some limitations)</li><li><strong>KVM/QEMU</strong> (A powerful alternative to Linux)</li></ul><figure><img alt="VM Comparison Table" src="https://cdn-images-1.medium.com/max/1024/1*PPBpiQDrY-02ehZoWfDyJw.png" /><figcaption>VM Comparison Table</figcaption></figure><blockquote>💡 <strong>Recommendation:</strong> A popular choice for malware investigation is <strong>VirtualBox</strong>, but <strong>VMware Workstation Pro</strong> is also a good option. Virtualbox will be our go-to because it’s cost-free.</blockquote><p><strong>2. Virtual Machine Installation</strong></p><p><strong>2.1. Downloading Operating Systems</strong></p><p>We will download Windows 10 for malware analysis. A Linux-based OS will be needed for network listening and all other analysis outputs. I prefer Ubuntu. You can also use Kali Linux if you wish. Follow the links below for downloads:</p><p><strong>Windows</strong> : <a href="https://www.microsoft.com/tr-tr/software-download/windows10ISO">https://www.microsoft.com/tr-tr/software-download/windows10ISO</a></p><p><strong>Ubuntu</strong> : <a href="https://ubuntu.com/download/desktop">https://ubuntu.com/download/desktop</a></p><p><strong>Kali</strong> : <a href="https://www.kali.org/get-kali/#kali-platforms">https://www.kali.org/get-kali/#kali-platforms</a></p><p><strong>2.2. Determining Virtual Machine resources</strong></p><ul><li><strong>RAM:</strong> at least <strong>4–8 GB</strong> (more is better)</li><li><strong>CPU:</strong> 2 or more virtual cores</li><li><strong>Disk</strong>: At least 50–100 GB</li><li><strong>Ağ Bağlantısı:</strong> NAT or Host-Only (To isolate internet connection)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*5MAczK_pqPcj-5-GJizo0A.png" /></figure><p>First, we click New to add a new virtual machine. Then the resource determination screen will appear.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*4S2Bwpr52pBDgHLRi-GJlA.png" /></figure><p><strong>2.3. Loading the ISO file into the virtual machine and installation</strong></p><p>Create a new virtual hard disk for the VM and click Create. After you click, VirtualBox will allocate space on your disk to hold the operating system files.</p><ul><li>Select the VDI (VirtualBox Disk Image) option and click Next. We will use the downloaded Ubuntu operating system file as ISO here.</li><li>Select Dynamically allocated disk size and click Next. If you want to set a specific size, select Fixed size and allocate space accordingly. If you choose Dynamic, the space allocated for the VM will grow as files are created and applications are installed.</li><li>Now select the ISO file we downloaded and adjust the file size. For example, 20 GB is more than enough space for an Ubuntu installation. This set size represents the maximum that the virtual machine created by VirtualBox can use, so make sure you allocate enough.</li><li>Determine virtual machine sources</li></ul><p>When the virtual machine is running and the operating system is loaded, we will insert additions. Then we need to load the additions. When the process is complete, we need to delete all files and folders related to virtualbox or disconnect it. Therefore, it should not be understood that it is running in a virtual machine. Some malware may perceive that they are running in a virtual machine and behave differently or may not run at all. Therefore, you can take the following precautions:</p><blockquote>🚫 To Prevent Virtual Machine Detection:<br>- Uninstall VMware / VirtualBox tools (Ex: VMware Tools or Guest Additions)<br>- Change Hardware Information (Show virtual machine BIOS information as a physical system)<br>- Change MAC Address and Disk Serial Number<br>- Avoid names like “vmx”, “VBox” (Some malware scans these names)</blockquote><p><strong>3. Creating an Isolated and Safe Environment</strong></p><p><strong>3.1. Snapshot</strong></p><p>With the Snapshot feature, you can return the virtual machine to a clean state.</p><ul><li>Take a snapshot before malware analysis.</li><li>After the analysis is finished, revert to the old snapshot to reset the system.</li></ul><p><strong>3.2. Network Isolation</strong></p><p>To prevent malware from sending data out, block or restrict internet access:</p><ul><li><strong>NAT</strong>: Can only go out, cannot be accessed from outside.</li><li><strong>Host-Only:</strong> Can only communicate with the host machine.</li><li><strong>Air-Gapped (Completely closed network):</strong> This is the most secure method to block external connections.</li></ul><p><strong>3.3. Install Reverse Engineering and Security Tools</strong></p><p>Tools you can use to analyze malware:</p><p><strong>For Statik Analysis (Code and File analysis)</strong></p><p><strong>PE Studio</strong> — Analyzes Windows executable files.<br><strong>BinText</strong> — Extracts text and strings from files.<br><strong>IDA Pro / Ghidra</strong> — Disassembler and reverse engineering tool.</p><p><strong>For Dynamic Analysis (Monitoring behavior at runtime)</strong></p><p><strong>Process Monitor (ProcMon)</strong> — Monitors processes and system calls.<br><strong>Process Explorer</strong> — Shows running processes in detail.<br><strong>Wireshark</strong> — To monitor network traffic.<br><strong>Regshot</strong> — Analyzes registry changes.</p><p><strong>Sandbox (For Automatic Analysis)</strong></p><p><strong>Cuckoo Sandbox</strong> — Performs automatic malware analysis.<br><strong>Any.Run</strong> — Web-based dynamic analysis service.</p><p>There is also a way to automatically install the main tools mentioned here and speed up the lab setup. We will use Flare VM for this. After installing the Windows operating system on the virtual machine, install it from the link below, as stated in the readme:</p><ul><li><a href="https://github.com/mandiant/flare-vm">https://github.com/mandiant/flare-vm</a></li></ul><p>We will also install Remnux on another virtual machine for analysis on the Linux operating system:</p><ul><li><a href="https://docs.remnux.org/install-distro/get-virtual-appliance">https://docs.remnux.org/install-distro/get-virtual-appliance</a></li></ul><p><strong>4. Protection from Advanced Anti-VM Techniques</strong></p><p>Some malware may behave differently or not run at all when they detect that they are running in an analysis environment (virtual machines, sandboxes). This is because malware developers want to avoid security researchers and analysts. You can use the following methods to bypass anti-VM techniques.</p><p><strong>4.1. Hiding Hardware and Virtual Machine Information</strong></p><p>Malware usually checks whether they are running in a virtual environment by querying system properties such as BIOS, MAC address, disk serial number, CPU information. To prevent this:</p><p><strong>Change BIOS and Hardware IDs</strong></p><ul><li>Virtualization software creates special BIOS information for virtual machines.</li><li>Malware can read this information and understand whether they are running in a VM.</li><li>Solution: Add realistic BIOS information by editing your VMX file in VMware or VirtualBox.</li><li>For VMware: Add the following lines to the *.vmx file:</li></ul><pre>smbios.reflectHost = &quot;TRUE&quot;</pre><p>This allows the virtual machine to get BIOS information from the physical system.</p><p><strong>Block Virtual Disk Detection<br></strong>Malware can detect the VM environment by checking if there is a virtual disk drive (VBOX, VMware) in the system.</p><p><strong>Solution:</strong></p><ul><li>Hide the virtual disk information in VMware using the following commands:</li></ul><pre>disk.EnableUUID = &quot;TRUE&quot;</pre><ul><li>You can use your own physical disk image (Ex: A copy taken from a real disk).</li></ul><p><strong>Change MAC Address and Network Adapter<br></strong>Virtualization software uses certain MAC address ranges. Malware can detect the virtual environment by checking these addresses.<br>Solution:</p><ul><li>Create a new MAC address.</li><li>Show the network adapter as a physical adapter.<br>For VirtualBox:</li></ul><pre>VBoxManage modifyvm &quot;VM Name&quot; - macaddress1 001122334455</pre><p><strong>4.2. Hiding Virtual Machine Processes<br></strong>Malware can detect the virtual machine by checking the running processes. For example:</p><ul><li>vmtoolsd.exe (VMware Tools)</li><li>VBoxTray.exe (VirtualBox add-on)</li><li>Solution:<br>Remove or rename VMware Tools and VirtualBox Guest Additions.<br>Hide suspicious processes from Windows Task Manager or Process Explorer.<br>Change or disable DLLs and services that contain phrases such as “vmware”, “vbox”, “qemu”.</li></ul><p><strong>4.3. Block Virtual Hardware Detection<br></strong>Some malware checks hardware components used in virtual machines such as CPU, RAM, GPU. If there are virtual hardware such as “VMware SVGA” in the system, the malware may refuse to run.</p><ul><li>Solution:<br>Use realistic CPU and RAM configurations.<br>Activate the “Host CPU” option in VMware or VirtualBox.<br>Force VirtualBox to use the real GPU instead of the virtual graphics card.</li></ul><p><strong>4.4. Block Time and Memory Detection<br></strong>Some malware knows that the time flow in virtual machines can be different. For example, a malware runs the “RDTSC” command to read the processor timestamp and understand whether it is in a virtual system.</p><ul><li>Solution:<br>Ensure realistic time synchronization.<br>Make sure that the clock in the virtual machine and the clock in the physical system are the same.</li></ul><p><strong>4.5. Block Network Traffic and Sandbox Detection<br></strong>Malware can understand whether they are in the analysis environment by checking whether tools such as Wireshark are running.</p><ul><li>Solution:<br>Hide tools such as Wireshark or Process Monitor.<br>Make the network adapter look like a “real physical adapter”.<br>When analyzing malware that connects to the Internet, change the traffic trace using a proxy or VPN.</li></ul><p><strong>4.6. Simulate Physical User Interaction<br></strong>Some advanced malware monitors keyboard and mouse movements to understand that they are running in a virtual machine. If there is no mouse movement and keyboard input, the malware may not work.</p><ul><li>Solution:<br>Simulate automatic mouse and keyboard movements. For example, you can run a script that moves the mouse randomly with Python or AutoHotkey.</li></ul><p><strong>4.7. Create a Realistic Environment<br></strong>Malware can check certain files and registry entries to understand that they are not running on a clean and fresh system. If there are no files on the system or if certain software is missing, the malware can understand that it is running in the analysis environment.</p><ul><li>Solution:<br>Create a system that looks like a real computer.<br>Add realistic user files (Documents, Pictures, Downloads folders).<br>Create office files, browser history, registry entries.<br>Install common software such as Microsoft Office, Adobe Reader.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gEb13XQqMG6cSdha2vb-xg.png" /><figcaption>Anti-VM techniques and Solutions</figcaption></figure><p><strong>5. Ensuring Post-Analysis Security</strong></p><ul><li>Once the analysis is complete, revert to the snapshot to a clean system.</li><li>Note the files infected with the malware and registry changes.</li><li>Check the network traffic before shutting down the virtual machine.</li></ul><h3>Static Analysis Environment</h3><blockquote>#What is static analysis and how is it done? #What information are we looking for in static analysis? #What questions should I ask before starting static analysis? #What should be the roadmap for static analysis? #What tools should be used at each stage of static analysis? #What questions are answered with these tools? #How is information found? #How is the information found used?</blockquote><p>Malware analysis and reverse engineering are actually like a detective game. When examining an application, it is impossible to go from beginning to end as if reading a novel. The important thing is to ask the right questions and reach the desired conclusion with the evidence found. Most of the time, the malware will try to hide the evidence or its intentions directly. But these hiding efforts also leave traces in other places. By following all these traces, the real intention of the malware and the information it hides will be found.</p><p>As I said, malware analysis and reverse engineering require following clues like a detective! Static analysis is the first step in trying to understand the behavior of the malware by examining it without running it.</p><p>Static analysis is the process of examining the <strong>code</strong>, <strong>content</strong> and <strong>components</strong> of the malware without running it. Its purpose is to determine how the malware works, which files it affects and which techniques it uses.</p><p><strong>Why Is It Important?</strong></p><p>It helps us to understand the behavior of malware safely.</p><p>In the first stage, we can collect information without running risky files.<br>It is the first step to overcome anti-VM or anti-debugging techniques.</p><p>Static Analysis consists of the following stages in summary; Basic Static Analysis, Intermediate Static Analysis and Advanced Static Analysis.</p><p><strong>In the first stage</strong>, we look at the structure and metadata of the file to collect basic information about the malware. With this information, we obtain general information about the executable application.</p><ul><li>Determining the File Type and Format</li><li>Checking Signatures with Hash Values</li><li>Analyzing Texts and Strings in the File</li></ul><p><strong>In the intermediate stage</strong>, it is possible to obtain some behavioral information depending on the file structure and operating system. This information will show the potential of the file. Although it does not directly show its behavior, it will give some clues about the potential of what it can do.</p><ul><li>PE Header and Section Analysis</li><li>Import Table and API Calls</li><li>DLL dependencies and Used Modules</li><li>Exported functions (may make sense if the analyzed DLL)</li></ul><p>Some malware contains encrypted codes or embedded files. <strong>Deeper analysis</strong> is required to analyze them.</p><ul><li>Obfuscation and Packers Analysis</li><li>Disassembly and Reverse Engineering</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zu07ozPzixYgTPX_fJDreA.png" /></figure><h4>Roadmap</h4><p>In static analysis, an analyst asks questions at different levels to understand the structure and content of the suspicious file and investigates them in detail.</p><ul><li>First, the identity of the file is determined (format, hash value, PE structure, etc.).</li><li>Then, what is inside is examined (texts, import table, API calls).</li><li>If the malware is hidden, it is checked whether there is a packer or obfuscation.</li><li>In the last stage, the code is analyzed with disassembly and its working logic is tried to be understood.</li></ul><p>Thanks to this process, it can be revealed what the malware does, how it works and what techniques it uses.</p><h4>Tools and Uses for Static Analysis</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MmarHc7evb1gnmGAkZZP0g.png" /><figcaption>Static analysis tools</figcaption></figure><h4>Summary and Usage Strategy of Static Analysis Tools</h4><ol><li>First, the file ID is determined (file, sha256sum, VirusTotal).</li><li>Strings are analyzed to extract IP addresses, suspicious commands and key information (strings, BinText).</li><li>PE structure and API calls are analyzed to see what operations are performed (PEStudio, Dependency Walker).</li><li>If the file is compressed, it is unpacked, if it is encrypted, it is tried to be decrypted (UPX, PEiD).</li><li>If code analysis is required, it is examined at the assembly level (IDA Pro, Ghidra).</li></ol><p>Thanks to these tools and methods, it can be revealed how the malware works, how it is stored and which system components it interacts with.<br>All the necessary tools are available in the Flare VM and Remnux virtual machines that we have previously installed.</p><h3>Dynamic Analysis Setup</h3><blockquote>#what is dynamic analysis and how is it done? #what information do we look for in dynamic analysis? #what should be the roadmap for dynamic analysis? #what tools should be used at each stage of dynamic analysis? What questions are answered with these tools, how is information found and how is the information found used?</blockquote><p>The goal of dynamic analysis is to deduce the inner workings of malware by monitoring its actions while it is running. Malware execution and monitoring is different from static analysis because it takes place on a real system or a virtual one.</p><h4>Why Perform Dynamic Analysis?</h4><ul><li>To see the effects of malware on the system</li><li>To analyze network traffic (What servers does it connect to?)</li><li>To detect file and registry changes</li><li>To reveal encrypted or hidden codes</li></ul><h4><strong>Dynamic Analysis Tools</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RHyWS9JiJ-MivsfGe_X32w.png" /><figcaption>dynamic analysis tools</figcaption></figure><h4>How to Perform Dynamic Analysis?</h4><p><strong>1. Build a Secure Enivronment</strong></p><ul><li>Use Virtual Machine (VMware, VirtualBox)</li><li>Turn off network connection or use fake network (INetSim)</li><li>Take snapshots so you can restore the system after running the malware</li></ul><p><strong>2. Monitor Process and Registry Changes</strong></p><ul><li>See what processes you started and system changes with ProcMon</li><li>Compare registry before and after malware runs with RegShot</li></ul><p><strong>3. Keep an Eye on Network Activity</strong></p><ul><li>Analyze which servers you are connecting to and what data you are sending with Wireshark</li><li>Monitor HTTP/S requests using Fiddler</li></ul><p><strong>4. Perform Memory Analysis</strong></p><ul><li>Volatility exposes the code and encrypted data that the malware loads into memory while it is running.</li></ul><p><strong>5. Perform In-Depth Analysis with Debugging</strong></p><ul><li>Examine the inner workings of malware step by step using <strong>x64dbg</strong> or <strong>OllyDbg</strong></li></ul><h4>Cuckoo Sandbox Installation</h4><p>Cuckoo Sandbox is an open source dynamic analysis platform used for malware analysis. It allows malware to be run in a virtual machine (VM) and its behavior to be observed.</p><p><strong>What Can You Do with Cuckoo?</strong></p><ul><li>You can analyze the effects of malware on the file system, registry, processes and network traffic.</li><li>You can examine encrypted or packaged malware by taking a memory dump.</li><li>You can detect C2 (Command &amp; Control) communication.</li></ul><p><strong>Supported Environments:</strong></p><ul><li>You can perform malware analysis on different operating systems such as Windows, Linux, macOS, Android.</li><li>It works integrated with virtualization solutions such as VirtualBox, VMware, KVM, QEMU.</li></ul><p><strong>Installation</strong></p><ol><li>Installing System Updates and Dependencies:</li></ol><pre>sudo apt install -y python3 python3-pip python3-venv git libffi-dev libssl-dev<br>pip3 install - upgrade pip setuptools</pre><p>2. Download and Install Cuckoo Sandbox:</p><pre>git clone https://github.com/cuckoosandbox/cuckoo.git<br>cd cuckoo</pre><p>3. Install Python dependencies:</p><pre>pip3 install -r requirements.txt</pre><p>4. Virtual Machine (VM) Installation:</p><p>Install VirtualBox and Necessary Connection Tools:</p><pre>sudo apt install -y virtualbox virtualbox-ext-pack</pre><p>Set Up a Windows 10 Virtual Machine</p><p><strong>Sistem configs:</strong></p><ul><li>RAM: at least 2GB</li><li>HDD: at least 30GB</li><li>Network: Host-Only Adapter (For Cuckoo to perform analysis on the virtual network)</li></ul><p>Install Python 2.7 or 3.8 in it and add Cuckoo Agent.</p><p><strong>Turn off Windows Defender and Firewall</strong>, as malware may be blocked during analysis.</p><p><strong>Cuckoo Configuration</strong></p><p>5. Before starting Cuckoo, edit the conf/cuckoo.conf file:</p><pre>nano ~/.cuckoo/conf/cuckoo.conf</pre><p>6. Make the following settings:</p><pre>[general]<br>machinery = virtualbox<br>memory_dump = yes</pre><p>7. Network Configuration</p><p>In order for Cuckoo to communicate with the Windows VM, the Host-Only Network must be configured.</p><pre>sudo nano ~/.cuckoo/conf/virtualbox.conf</pre><p>and change the content:</p><pre>interface = vboxnet0</pre><p>8. Starting Cuckoo Service</p><p>Before running Cuckoo, initialize the database:</p><pre>cuckoo init</pre><p>Next, start Cuckoo:</p><pre>cuckoo -d</pre><p>9. In another terminal, you can launch the Cuckoo Web Interface:</p><pre>cuckoo web</pre><p>You can access the interface by entering <a href="http://127.0.0.1:8000/">http://127.0.0.1:8000</a> from your browser.</p><h4><strong>Usage</strong></h4><p><strong>Submitting Malware for Analysis</strong></p><p><strong>From the Command Line</strong></p><p>For example, to analyze a malware named malware.exe, you can use the following command:</p><pre>cuckoo submit /home/user/malware.exe</pre><p>If you want to analyze a URL:</p><pre>cuckoo submit - url &quot;http://suspicious-website.com&quot;</pre><p><strong>From the Web Interface</strong></p><p>Enter the Cuckoo Web Interface: <a href="http://127.0.0.1:8000/">http://127.0.0.1:8000</a></p><p>Go to the File Upload Section</p><p>Select the File You Want to Inspect and Press the Submit button</p><p>Follow the Analysis Process</p><p><strong>Follow the Analysis Process<br></strong>After starting the analysis, Cuckoo runs and monitors the malware in the virtual machine. During the analysis, it collects the following information:</p><ul><li>File Actions → Which files did the malware create, delete or modify?</li><li>Process Actions → Did it start new processes? Which API calls did it make?</li><li>Network Traffic → Which IP addresses did it communicate with? Did it send data?</li><li>Memory Analysis → Are there any encrypted/data-storing memory regions?</li></ul><p>To view the analysis progress, you can run the following command:</p><pre>cuckoo status</pre><p><strong>Review Analysis Results</strong></p><p>Cuckoo generates a detailed report once the analysis is complete. You can access this report in JSON, HTML or TXT format.</p><p><strong>Viewing Reports via Command Line</strong></p><p>To view the analysis result:</p><pre>cuckoo report &lt;task_id&gt; json</pre><p><strong>Or in HTML format:</strong></p><pre>cuckoo report &lt;task_id&gt; html &gt; report.html</pre><p>You can open this report in the browser and review the detailed analysis</p><p><strong>Viewing Reports via Web Interface</strong></p><ul><li>Enter the web interface (<a href="http://127.0.0.1:8000/">http://127.0.0.1:8000</a>)</li><li>Click on the “Completed Analyses” section</li><li>Examine the analysis report of the relevant file</li></ul><p><strong>Advanced Analyses That Can Be Performed with Cuckoo Sandbox<br>🛠 1. Dynamic Memory Analysis (Memory Dumping)</strong></p><p>To capture the memory content of the malware:</p><pre>cuckoo submit - memory /home/user/malware.exe</pre><p>With this analysis, encrypted malware payloads or code injections can be detected.</p><p><strong>🔍 2. Network Traffic Monitoring</strong></p><p>To see the network connections of the malware:</p><pre>tcpdump -i eth0 -w traffic.pcap</pre><p>You can then examine the .pcap file with Wireshark.</p><p><strong>📡 3. C2 (Command &amp; Control) Detection</strong></p><p>If a malware is communicating with a remote server, Cuckoo can detect it.</p><pre>cuckoo network</pre><p><strong>🛑 4. Bypassing Anti-VM Techniques</strong></p><p>Some malware detects that it is running in a virtual environment and hides. You can analyze such malware thanks to Cuckoo’s virtualization bypass techniques.</p><h4><strong>Conclusion</strong></h4><p>Cuckoo Sandbox is a powerful and flexible tool for malware analysis. Using it from both the command line and the web interface, you can perform operations such as:</p><ul><li>File movements,</li><li>Process monitoring,</li><li>Network traffic analysis,</li><li>Memory dump analysis.</li></ul><p>If you experience any problems, you can check the logs or get support from the Cuckoo community forums</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=900e5e2e16b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>