<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://elvis.hcw.ac.at/wiki/index.php?action=history&amp;feed=atom&amp;title=Evasive_Malware_Detection_mit_YARA</id>
	<title>Evasive Malware Detection mit YARA - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://elvis.hcw.ac.at/wiki/index.php?action=history&amp;feed=atom&amp;title=Evasive_Malware_Detection_mit_YARA"/>
	<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Evasive_Malware_Detection_mit_YARA&amp;action=history"/>
	<updated>2026-09-10T17:35:44Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.5</generator>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Evasive_Malware_Detection_mit_YARA&amp;diff=18014&amp;oldid=prev</id>
		<title>PPfaffl: Created page with &quot;== Summary ==   This documentation describes the setup of a malware analysis environment and the methodology for detecting evasive malware using static analysis with YARA. The focus is on identifying byte patterns (hardware instructions) and suspicious strings in order to distinguish evasive malware from legitimate software.  == Requirements ==  * VirtualBox * YARA * Windows 10 * 6 evasive malware samples * 6 additional malware samples * 6 benign .exe files (Windows syst...&quot;</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Evasive_Malware_Detection_mit_YARA&amp;diff=18014&amp;oldid=prev"/>
		<updated>2026-01-19T19:55:51Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Summary ==   This documentation describes the setup of a malware analysis environment and the methodology for detecting evasive malware using static analysis with YARA. The focus is on identifying byte patterns (hardware instructions) and suspicious strings in order to distinguish evasive malware from legitimate software.  == Requirements ==  * VirtualBox * YARA * Windows 10 * 6 evasive malware samples * 6 additional malware samples * 6 benign .exe files (Windows syst...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
This documentation describes the setup of a malware analysis environment and the methodology for detecting evasive malware using static analysis with YARA. The focus is on identifying byte patterns (hardware instructions) and suspicious strings in order to distinguish evasive malware from legitimate software.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* VirtualBox&lt;br /&gt;
* YARA&lt;br /&gt;
* Windows 10&lt;br /&gt;
* 6 evasive malware samples&lt;br /&gt;
* 6 additional malware samples&lt;br /&gt;
* 6 benign .exe files (Windows system)&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
Install REMnux in VirtualBox by downloading and importing the official distribution from [[https://remnux.org/#distro DownloadREMnux]]&lt;br /&gt;
, and also set up a Windows 10 VM for executing and transferring the required .exe files. Ensure both VMs start correctly.&lt;br /&gt;
&lt;br /&gt;
== Hardening ==&lt;br /&gt;
&lt;br /&gt;
Perform the installation steps inside the REMnux and Windows 10 in VirtualBox as part of system hardening for safe, isolated malware analysis.&lt;br /&gt;
&lt;br /&gt;
Shared Clipboard disabled:&lt;br /&gt;
&lt;br /&gt;
[[File:SharedClipboard.png|400px]]&lt;br /&gt;
&lt;br /&gt;
No Drag and Drop:&lt;br /&gt;
&lt;br /&gt;
[[File:DragAndDrop.png|400px]]&lt;br /&gt;
&lt;br /&gt;
No USB Passthrough:&lt;br /&gt;
&lt;br /&gt;
[[File:USB.png|400px]]&lt;br /&gt;
&lt;br /&gt;
No Shared Folders:&lt;br /&gt;
&lt;br /&gt;
[[File:SharedFolder.png|400px]]&lt;br /&gt;
&lt;br /&gt;
Take a clean snapshot of both VMs before introducing malware. This allows for a quick revert the start state after infection.&lt;br /&gt;
&lt;br /&gt;
== Network ==&lt;br /&gt;
&lt;br /&gt;
=== Gateway REMnux Config ===&lt;br /&gt;
&lt;br /&gt;
Shows a host-only adapter configured for a secure, internet-isolated analysis environment on both machines:&lt;br /&gt;
&lt;br /&gt;
[[File:Adapter1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
Shows a second NAT/bridged adapter used temporarily for downloading tools and samples, which is disabled before malware analysis on REMNUX (as Gateway):&lt;br /&gt;
&lt;br /&gt;
[[File:Adapter2.png|400px]]&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
[[File:IPForwarding.png|400px]]&lt;br /&gt;
&lt;br /&gt;
 # activate:&lt;br /&gt;
 sudo sysctl -p&lt;br /&gt;
&lt;br /&gt;
 # Routing&lt;br /&gt;
 sudo iptables -t nat -A POSTROUTING -o enp0s8 -j MASQUERADE&lt;br /&gt;
&lt;br /&gt;
 # netplan&lt;br /&gt;
 sudo nano /etc/netplan/01-netcfg.yaml&lt;br /&gt;
&lt;br /&gt;
[[File:RemnuxIPTable.png|400px]]&lt;br /&gt;
&lt;br /&gt;
 sudo netplan apply&lt;br /&gt;
&lt;br /&gt;
 # Check &lt;br /&gt;
 ip a&lt;br /&gt;
&lt;br /&gt;
[[File:IPA.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Windows Config===&lt;br /&gt;
&lt;br /&gt;
Shows a host-only adapter configured for a secure, internet-isolated analysis environment&lt;br /&gt;
&lt;br /&gt;
[[File:Adapter1.png|400px]]&lt;br /&gt;
&lt;br /&gt;
Change the IP address:&lt;br /&gt;
&lt;br /&gt;
[[File:WindowsIP.png|300px]]&lt;br /&gt;
&lt;br /&gt;
== Dataset ==&lt;br /&gt;
&lt;br /&gt;
Download the required malware samples from MalwareBazaar [[https://bazaar.abuse.ch MalewareDatabase]] and store them inside the REMnux virtual machine in a dedicated analysis folder. Keep the VM isolated from the internet before and during analysis.&lt;br /&gt;
&lt;br /&gt;
Warning: Malware samples are live and dangerous. Handle with extreme caution and ensure the analysis environment is completely isolated from the host and local network.&lt;br /&gt;
&lt;br /&gt;
=== Evasive Malware ===&lt;br /&gt;
&lt;br /&gt;
[[File:EvasiveMalware.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Malware ===&lt;br /&gt;
&lt;br /&gt;
[[File:Malware.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Benign Software ===&lt;br /&gt;
&lt;br /&gt;
copy files to REMnux&lt;br /&gt;
&lt;br /&gt;
 scp &amp;quot;C:\Windows\System32\&amp;lt;benignSoftware&amp;gt;.exe&amp;quot; remnux@10.0.0.1:/home/remnux/&lt;br /&gt;
&lt;br /&gt;
[[File:Copyexe.png|500px]]&lt;br /&gt;
&lt;br /&gt;
* calc.exe&lt;br /&gt;
* chrome.exe&lt;br /&gt;
* vlc.exe&lt;br /&gt;
* notepad.exe&lt;br /&gt;
* cmd.exe&lt;br /&gt;
* taskmgr.exe&lt;br /&gt;
&lt;br /&gt;
== YARA ==&lt;br /&gt;
&lt;br /&gt;
=== YARA run ===&lt;br /&gt;
&lt;br /&gt;
Create a YARA rule file inside the REMnux virtual machine and store it in your analysis directory.&lt;br /&gt;
&lt;br /&gt;
 evasive_rules.yar&lt;br /&gt;
&lt;br /&gt;
Run YARA against your samples to scan for static indicators of evasive behavior:&lt;br /&gt;
&lt;br /&gt;
 yara evasive_rules.yar /path/to/malware/&lt;br /&gt;
&lt;br /&gt;
-s option will display the specific strings and patterns that triggered a match and -r for rekurisve:&lt;br /&gt;
&lt;br /&gt;
 yara -r -s evasive_rules.yar /path/to/malware/&lt;br /&gt;
&lt;br /&gt;
=== YARA Final Rule ===&lt;br /&gt;
&lt;br /&gt;
The final rule Evasive_Malware_Final checks for VM artifacts, analysis tools, and RDTSC-based timing evasion into a single detection logic to identify suspicious behavior.&lt;br /&gt;
&lt;br /&gt;
[[File:FinalRulesEvasive.png|500px]]&lt;br /&gt;
&lt;br /&gt;
The condition uint16(0) == 0x5A4D specifically targets the &amp;quot;MZ&amp;quot; magic bytes at the beginning of the file. This ensures the rule only scans Windows Portable Executable files:&lt;br /&gt;
&lt;br /&gt;
[[File:Condition.png|300px]]&lt;br /&gt;
&lt;br /&gt;
A hex dump of a benign sample (notepad.exe) confirms the presence of the signature 4d 5a:&lt;br /&gt;
&lt;br /&gt;
[[File:Stringheader.png|400px]]&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
CPU: AMD Ryzen 7 5800X&lt;br /&gt;
RAM: 32 GB DDR4 System Memory&lt;br /&gt;
GPU: NVIDIA GeForce RTX 3070 Ti&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://remnux.org/&lt;br /&gt;
* https://yara.readthedocs.io/en/latest/&lt;br /&gt;
* https://github.com/virustotal/yara/releases&lt;br /&gt;
* https://bazaar.abuse.ch/ (Sample Source)&lt;br /&gt;
* https://learn.microsoft.com/en-us/windows/win32/debug/pe-format&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>PPfaffl</name></author>
	</entry>
</feed>