<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://elvis.hcw.ac.at/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=CHoerhan</id>
	<title>Elvis Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://elvis.hcw.ac.at/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=CHoerhan"/>
	<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php/Special:Contributions/CHoerhan"/>
	<updated>2026-09-10T16:34:30Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.5</generator>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17888</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17888"/>
		<updated>2025-01-20T20:45:31Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machine(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and several open-source VM-detection tools are executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Hyper-V is used for the virtualization. This is because it is a Type 1, bare-metal, Hypervisor, which runs directly on the host&#039;s hardware to control the hardware and to manage guest operating systems.&lt;br /&gt;
&lt;br /&gt;
The specifications are:&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/a0rtega/pafish Pafish (Paranoid Fish)]&lt;br /&gt;
* [https://github.com/kernelwernel/VMAware VMAware]&lt;br /&gt;
* [https://github.com/ayoubfaouzi/al-khaser Al-Khaser]&lt;br /&gt;
&lt;br /&gt;
===Initial Test Run===&lt;br /&gt;
&lt;br /&gt;
After the virtual machine setup is complete and all the tools have been installed, a first test can be conducted.&lt;br /&gt;
&lt;br /&gt;
In the unmodified, native machine the tools show a number of positive checks, that hint towards a VM.&lt;br /&gt;
&lt;br /&gt;
Number of detections: Pafish 13 + VMAware 13 + Al-Khaser 31 = &#039;&#039;&#039;57 positive detections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These numbers are likely to vary between different setups and tool versions.&lt;br /&gt;
&lt;br /&gt;
== Hardening Steps ==&lt;br /&gt;
&lt;br /&gt;
This section contains system modifications that aim to lower the number of positive detections.&lt;br /&gt;
&lt;br /&gt;
===Virtual Hardware Specifications===&lt;br /&gt;
&lt;br /&gt;
Common checks aim at the system hardware. If the disk, memory or processor contain strange values, which typically cannot be found on normal machines, the malware might see this as a sign of a VM.&lt;br /&gt;
&lt;br /&gt;
Very low or odd numbers are highly unlikely in a physical machine. Therefore, see that the VM has at least the following requirements:&lt;br /&gt;
&lt;br /&gt;
* 60-80 GB disk size&lt;br /&gt;
* 4-8 GB memory size and no odd numbers&lt;br /&gt;
* At least 4 processor cores and no odd numbers&lt;br /&gt;
&lt;br /&gt;
With Hyper-V, these values can be configured in the machine settings:&lt;br /&gt;
&lt;br /&gt;
[[File:VM_specs.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Registry===&lt;br /&gt;
&lt;br /&gt;
The Windows registry is a central database in Microsoft Windows that stores configuration information and settings for the operating system, installed applications and hardware components.&lt;br /&gt;
&lt;br /&gt;
The manufacturers of virtualisation software also store information for their products here. Malware checks whether known keys exist or whether they contain special strings such as &amp;quot;virtual&amp;quot; or the manufacturer&#039;s name.&lt;br /&gt;
&lt;br /&gt;
Delete the following Key: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For this Key, delete the substring &amp;quot;virtual&amp;quot; from the values: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:registry.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Hyper-V EventLogs===&lt;br /&gt;
&lt;br /&gt;
Content in the Windows Hyper-V EventLogs is apparently an indication of a virtual machine.&lt;br /&gt;
&lt;br /&gt;
To delete the log, open the PowerShell as administrator and execute the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; wevtutil cl &amp;quot;Microsoft-Windows-Kernel-PnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check that the logs are empty with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Users\VMuser&amp;gt; Get-WinEvent -LogName &amp;quot;Microsoft-Windows-KernelPnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to disable further logging use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; Set-ItemProperty -Path &amp;quot;HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Microsoft-Windows-Kernel-PnP\Configuration&amp;quot; -Name &amp;quot;Enabled&amp;quot; -Value 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Activation===&lt;br /&gt;
&lt;br /&gt;
It is likely that your VM does not have a valid Windows product key. Most users, however, have a valid windows installed in order to use the system properly.&lt;br /&gt;
&lt;br /&gt;
Instead of buying a key, for this purpose a windows activation script can be used. In this guide, [https://github.com/massgravel/Microsoft-Activation-Scripts/ this] one from GitHub is used.&lt;br /&gt;
&lt;br /&gt;
Again, open the PowerShell and enter this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
irm https://get.activated.win | iex&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tool is easy to use and afterwards the VM´s Windows should be activated.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_activation.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Other Changes===&lt;br /&gt;
&lt;br /&gt;
Some checks can be fended off without really having to change anything on the system.&lt;br /&gt;
&lt;br /&gt;
This includes, for example, how to start the tools. One tool checks whether Windows Explorer is its parent process.&lt;br /&gt;
&lt;br /&gt;
Another check looks at the system uptime, i.e. how long the system has been running. If you do not have the option to manipulate the system time, it is sufficient to let the machine run a little beforehand.&lt;br /&gt;
&lt;br /&gt;
The screen dimensions are also checked, as the VM window can be resized as required. If the dimensions are too small, it is clear that it is a VM, as there are only certain options for physical screens. E.g. a very small screen window or one that is taller than it is wide is very unlikely on a typical end user device.&lt;br /&gt;
&lt;br /&gt;
== Test Run in modified VM ==&lt;br /&gt;
&lt;br /&gt;
After implementing the described hardening measures the number of positive detections drops from &#039;&#039;&#039;57&#039;&#039;&#039; to &#039;&#039;&#039;41&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If the mouse is moved and clicked and keyboard inputs are entered during the execution of the tools, the number even drops to &#039;&#039;&#039;32&#039;&#039;&#039;. This is because of the Reverse-Turing-Tests(RTTs) of the tools. These test focus on detecting human interaction with the system, normally by mouse or keyboard.&lt;br /&gt;
These tests can only be countered by simulating human interaction, which is a complex task. In a typical analysis VM there is no human that is actually operating the system. For this example, it is sufficient if you are manually using mouse and keyboard.&lt;br /&gt;
&lt;br /&gt;
A lot of the remaining positive detections could be countered by implementing hooks. With hooks you could interecpt the return values of many system function and instead return fake information that satisfy the checks of the tools.&lt;br /&gt;
&lt;br /&gt;
However, hooking is a complex mechanism that is not covered in this article.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
There is a wide range of possible VM detection methods.&lt;br /&gt;
&lt;br /&gt;
The most widespread include simply checking static system information. However, new techniques are on the rise that exploit other vulnerabilities. Monitoring system components and observing human interaction with RTTs are powerful methods and also hard to counter.&lt;br /&gt;
&lt;br /&gt;
Malware researchers must constantly keep up with new detection and evasion methods in order to keep their analysis systems transparent. It is essential that malware can be analysed at runtime in order to keep up with increased cybercrime.&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17887</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17887"/>
		<updated>2025-01-20T20:34:40Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machine(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and several open-source VM-detection tools are executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Hyper-V is used for the virtualization. This is because it is a Type 1, bare-metal, Hypervisor, which runs directly on the host&#039;s hardware to control the hardware and to manage guest operating systems.&lt;br /&gt;
&lt;br /&gt;
The specifications are:&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/a0rtega/pafish Pafish (Paranoid Fish)]&lt;br /&gt;
* [https://github.com/kernelwernel/VMAware VMAware]&lt;br /&gt;
* [https://github.com/ayoubfaouzi/al-khaser Al-Khaser]&lt;br /&gt;
&lt;br /&gt;
===Initial Test Run===&lt;br /&gt;
&lt;br /&gt;
After the virtual machine setup is complete and all the tools have been installed, a first test can be conducted.&lt;br /&gt;
&lt;br /&gt;
In the unmodified, native machine the tools show a number of positive checks, that hint towards a VM.&lt;br /&gt;
&lt;br /&gt;
Number of detections: Pafish 13 + VMAware 13 + Al-Khaser 31 = &#039;&#039;&#039;57 positive detections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These numbers are likely to vary between different setups and tool versions.&lt;br /&gt;
&lt;br /&gt;
== Hardening Steps ==&lt;br /&gt;
&lt;br /&gt;
This section contains system modifications that aim to lower the number of positive detections.&lt;br /&gt;
&lt;br /&gt;
===Virtual Hardware Specifications===&lt;br /&gt;
&lt;br /&gt;
Common checks aim at the system hardware. If the disk, memory or processor contain strange values, which typically cannot be found on normal machines, the malware might see this as a sign of a VM.&lt;br /&gt;
&lt;br /&gt;
Very low or odd numbers are highly unlikely in a physical machine. Therefore, see that the VM has at least the following requirements:&lt;br /&gt;
&lt;br /&gt;
* 60-80 GB disk size&lt;br /&gt;
* 4-8 GB memory size and no odd numbers&lt;br /&gt;
* At least 4 processor cores and no odd numbers&lt;br /&gt;
&lt;br /&gt;
With Hyper-V, these values can be configured in the machine settings:&lt;br /&gt;
&lt;br /&gt;
[[File:VM_specs.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Registry===&lt;br /&gt;
&lt;br /&gt;
The Windows registry is a central database in Microsoft Windows that stores configuration information and settings for the operating system, installed applications and hardware components.&lt;br /&gt;
&lt;br /&gt;
The manufacturers of virtualisation software also store information for their products here. Malware checks whether known keys exist or whether they contain special strings such as &amp;quot;virtual&amp;quot; or the manufacturer&#039;s name.&lt;br /&gt;
&lt;br /&gt;
Delete the following Key: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For this Key, delete the substring &amp;quot;virtual&amp;quot; from the values: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:registry.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Hyper-V EventLogs===&lt;br /&gt;
&lt;br /&gt;
Content in the Windows Hyper-V EventLogs is apparently an indication of a virtual machine.&lt;br /&gt;
&lt;br /&gt;
To delete the log, open the PowerShell as administrator and execute the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; wevtutil cl &amp;quot;Microsoft-Windows-Kernel-PnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check that the logs are empty with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Users\VMuser&amp;gt; Get-WinEvent -LogName &amp;quot;Microsoft-Windows-KernelPnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to disable further logging use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; Set-ItemProperty -Path &amp;quot;HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Microsoft-Windows-Kernel-PnP\Configuration&amp;quot; -Name &amp;quot;Enabled&amp;quot; -Value 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Activation===&lt;br /&gt;
&lt;br /&gt;
It is likely that your VM does not have a valid Windows product key. Most users, however, have a valid windows installed in order to use the system properly.&lt;br /&gt;
&lt;br /&gt;
Instead of buying a key, for this purpose a windows activation script can be used. In this guide, [https://github.com/massgravel/Microsoft-Activation-Scripts/ this] one from GitHub is used.&lt;br /&gt;
&lt;br /&gt;
Again, open the PowerShell and enter this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
irm https://get.activated.win | iex&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tool is easy to use and afterwards the VM´s Windows should be activated.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_activation.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Other Changes===&lt;br /&gt;
&lt;br /&gt;
Some checks can be fended off without really having to change anything on the system.&lt;br /&gt;
&lt;br /&gt;
This includes, for example, how to start the tools. One tool checks whether Windows Explorer is its parent process.&lt;br /&gt;
&lt;br /&gt;
Another check looks at the system uptime, i.e. how long the system has been running. If you do not have the option to manipulate the system time, it is sufficient to let the machine run a little beforehand.&lt;br /&gt;
&lt;br /&gt;
The screen dimensions are also checked, as the VM window can be resized as required. If the dimensions are too small, it is clear that it is a VM, as there are only certain options for physical screens. E.g. a very small screen window or one that is taller than it is wide is very unlikely on a typical end user device.&lt;br /&gt;
&lt;br /&gt;
== Test Run in modified VM ==&lt;br /&gt;
&lt;br /&gt;
After implementing the described hardening measures the number of positive detections drops from &#039;&#039;&#039;57&#039;&#039;&#039; to &#039;&#039;&#039;41&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If the mouse is moved and clicked and keyboard inputs are entered during the execution of the tools, the number even drops to &#039;&#039;&#039;32&#039;&#039;&#039;. This is because of the Reverse-Turing-Tests(RTTs) of the tools. These test focus on detecting human interaction with the system, normally by mouse or keyboard.&lt;br /&gt;
These tests can only be countered by simulating human interaction, which is a complex task. In a typical analysis VM there is no human that is actually operating the system. For this example, it is sufficient if you are manually using mouse and keyboard.&lt;br /&gt;
&lt;br /&gt;
A lot of the remaining positive detections could be countered by implementing hooks. With hooks you could interecpt the return values of many system function and instead return fake information that satisfy the checks of the tools.&lt;br /&gt;
&lt;br /&gt;
However, hooking is a complex mechanism that is not covered in this article.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
There is a wide range of possible VM detection methods.&lt;br /&gt;
&lt;br /&gt;
The most widespread include simply checking static system information. However, new techniques are on the rise that exploit other vulnerabilities. Monitoring system components and observing human interaction with RTTs are powerful methods and also hard to counter.&lt;br /&gt;
&lt;br /&gt;
Malware researchers must constantly keep up with new detection and evasion methods in order to keep their analysis systems transparent. It is essential that malware can be analysed at runtime in order to keep up with increased cybercrime.&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17885</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17885"/>
		<updated>2025-01-20T20:33:31Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: /* Windows Activation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machine(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and several open-source VM-detection tools are executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Hyper-V is used for the virtualization. This is because it is a Type 1, bare-metal, Hypervisor, which runs directly on the host&#039;s hardware to control the hardware and to manage guest operating systems.&lt;br /&gt;
&lt;br /&gt;
The specifications are:&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/a0rtega/pafish Pafish (Paranoid Fish)]&lt;br /&gt;
* [https://github.com/kernelwernel/VMAware VMAware]&lt;br /&gt;
* [https://github.com/ayoubfaouzi/al-khaser Al-Khaser]&lt;br /&gt;
&lt;br /&gt;
===Initial Test Run===&lt;br /&gt;
&lt;br /&gt;
After the virtual machine setup is complete and all the tools have been installed, a first test can be conducted.&lt;br /&gt;
&lt;br /&gt;
In the unmodified, native machine the tools show a number of positive checks, that hint towards a VM.&lt;br /&gt;
&lt;br /&gt;
Number of detections: Pafish 13 + VMAware 13 + Al-Khaser 31 = &#039;&#039;&#039;57 positive detections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These numbers are likely to vary between different setups and tool versions.&lt;br /&gt;
&lt;br /&gt;
== Hardening Steps ==&lt;br /&gt;
&lt;br /&gt;
This section contains system modifications that aim to lower the number of positive detections.&lt;br /&gt;
&lt;br /&gt;
===Virtual Hardware Specifications===&lt;br /&gt;
&lt;br /&gt;
Common checks aim at the system hardware. If the disk, memory or processor contain strange values, which typically cannot be found on normal machines, the malware might see this as a sign of a VM.&lt;br /&gt;
&lt;br /&gt;
Very low or odd numbers are highly unlikely in a physical machine. Therefore, see that the VM has at least the following requirements:&lt;br /&gt;
&lt;br /&gt;
* 60-80 GB disk size&lt;br /&gt;
* 4-8 GB memory size and no odd numbers&lt;br /&gt;
* At least 4 processor cores and no odd numbers&lt;br /&gt;
&lt;br /&gt;
With Hyper-V, these values can be configured in the machine settings:&lt;br /&gt;
&lt;br /&gt;
[[File:VM_specs.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Registry===&lt;br /&gt;
&lt;br /&gt;
The Windows registry is a central database in Microsoft Windows that stores configuration information and settings for the operating system, installed applications and hardware components.&lt;br /&gt;
&lt;br /&gt;
The manufacturers of virtualisation software also store information for their products here. Malware checks whether known keys exist or whether they contain special strings such as &amp;quot;virtual&amp;quot; or the manufacturer&#039;s name.&lt;br /&gt;
&lt;br /&gt;
Delete the following Key: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For this Key, delete the substring &amp;quot;virtual&amp;quot; from the values: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:registry.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Hyper-V EventLogs===&lt;br /&gt;
&lt;br /&gt;
Content in the Windows Hyper-V EventLogs is apparently an indication of a virtual machine.&lt;br /&gt;
&lt;br /&gt;
To delete the log, open the PowerShell as administrator and execute the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; wevtutil cl &amp;quot;Microsoft-Windows-Kernel-PnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check that the logs are empty with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Users\VMuser&amp;gt; Get-WinEvent -LogName &amp;quot;Microsoft-Windows-KernelPnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to disable further logging use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; Set-ItemProperty -Path &amp;quot;HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Microsoft-Windows-Kernel-PnP\Configuration&amp;quot; -Name &amp;quot;Enabled&amp;quot; -Value 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Activation===&lt;br /&gt;
&lt;br /&gt;
It is likely that your VM does not have a valid Windows product key. Most users, however, have a valid windows installed in order to use the system properly.&lt;br /&gt;
&lt;br /&gt;
Instead of buying a key, for this purpose a windows activation script can be used. In this guide, [https://github.com/massgravel/Microsoft-Activation-Scripts/ this] one from GitHub is used.&lt;br /&gt;
&lt;br /&gt;
Again, open the PowerShell and enter this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
irm https://get.activated.win | iex&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tool is easy to use and afterwards the VM´s Windows should be activated.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_activation.png|600px]]&lt;br /&gt;
&lt;br /&gt;
===Other Changes===&lt;br /&gt;
&lt;br /&gt;
Some checks can be fended off without really having to change anything on the system.&lt;br /&gt;
&lt;br /&gt;
This includes, for example, how to start the tools. One tool checks whether Windows Explorer is its parent process.&lt;br /&gt;
&lt;br /&gt;
Another check looks at the system uptime, i.e. how long the system has been running. If you do not have the option to manipulate the system time, it is sufficient to let the machine run a little beforehand.&lt;br /&gt;
&lt;br /&gt;
The screen dimensions are also checked, as the VM window can be resized as required. If the dimensions are too small, it is clear that it is a VM, as there are only certain options for physical screens. E.g. a very small screen window or one that is taller than it is wide is very unlikely on a typical end user device.&lt;br /&gt;
&lt;br /&gt;
== Test Run in modified VM ==&lt;br /&gt;
&lt;br /&gt;
After implementing the described hardening measures the number of positive detections drops from &#039;&#039;&#039;57&#039;&#039;&#039; to &#039;&#039;&#039;41&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If the mouse is moved and clicked and keyboard inputs are entered during the execution of the tools, the number even drops to &#039;&#039;&#039;32&#039;&#039;&#039;. This is because of the Reverse-Turing-Tests(RTTs) of the tools. These test focus on detecting human interaction with the system, normally by mouse or keyboard.&lt;br /&gt;
These tests can only be countered by simulating human interaction, which is a complex task. In a typical analysis VM there is no human that is actually operating the system. For this example, it is sufficient if you are manually using mouse and keyboard.&lt;br /&gt;
&lt;br /&gt;
A lot of the remaining positive detections could be countered by implementing hooks. With hooks you could interecpt the return values of many system function and instead return fake information that satisfy the checks of the tools.&lt;br /&gt;
&lt;br /&gt;
However, hooking is a complex mechanism that is not covered in this article.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
There is a wide range of possible VM detection methods.&lt;br /&gt;
&lt;br /&gt;
The most widespread include simply checking static system information. However, new techniques are on the rise that exploit other vulnerabilities. Monitoring system components and observing human interaction with RTTs are powerful methods and also hard to counter.&lt;br /&gt;
&lt;br /&gt;
Malware researchers must constantly keep up with new detection and evasion methods in order to keep their analysis systems transparent. It is essential that malware can be analysed at runtime in order to keep up with increased cybercrime.&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17884</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17884"/>
		<updated>2025-01-20T20:33:00Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machine(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and several open-source VM-detection tools are executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Hyper-V is used for the virtualization. This is because it is a Type 1, bare-metal, Hypervisor, which runs directly on the host&#039;s hardware to control the hardware and to manage guest operating systems.&lt;br /&gt;
&lt;br /&gt;
The specifications are:&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/a0rtega/pafish Pafish (Paranoid Fish)]&lt;br /&gt;
* [https://github.com/kernelwernel/VMAware VMAware]&lt;br /&gt;
* [https://github.com/ayoubfaouzi/al-khaser Al-Khaser]&lt;br /&gt;
&lt;br /&gt;
===Initial Test Run===&lt;br /&gt;
&lt;br /&gt;
After the virtual machine setup is complete and all the tools have been installed, a first test can be conducted.&lt;br /&gt;
&lt;br /&gt;
In the unmodified, native machine the tools show a number of positive checks, that hint towards a VM.&lt;br /&gt;
&lt;br /&gt;
Number of detections: Pafish 13 + VMAware 13 + Al-Khaser 31 = &#039;&#039;&#039;57 positive detections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These numbers are likely to vary between different setups and tool versions.&lt;br /&gt;
&lt;br /&gt;
== Hardening Steps ==&lt;br /&gt;
&lt;br /&gt;
This section contains system modifications that aim to lower the number of positive detections.&lt;br /&gt;
&lt;br /&gt;
===Virtual Hardware Specifications===&lt;br /&gt;
&lt;br /&gt;
Common checks aim at the system hardware. If the disk, memory or processor contain strange values, which typically cannot be found on normal machines, the malware might see this as a sign of a VM.&lt;br /&gt;
&lt;br /&gt;
Very low or odd numbers are highly unlikely in a physical machine. Therefore, see that the VM has at least the following requirements:&lt;br /&gt;
&lt;br /&gt;
* 60-80 GB disk size&lt;br /&gt;
* 4-8 GB memory size and no odd numbers&lt;br /&gt;
* At least 4 processor cores and no odd numbers&lt;br /&gt;
&lt;br /&gt;
With Hyper-V, these values can be configured in the machine settings:&lt;br /&gt;
&lt;br /&gt;
[[File:VM_specs.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Registry===&lt;br /&gt;
&lt;br /&gt;
The Windows registry is a central database in Microsoft Windows that stores configuration information and settings for the operating system, installed applications and hardware components.&lt;br /&gt;
&lt;br /&gt;
The manufacturers of virtualisation software also store information for their products here. Malware checks whether known keys exist or whether they contain special strings such as &amp;quot;virtual&amp;quot; or the manufacturer&#039;s name.&lt;br /&gt;
&lt;br /&gt;
Delete the following Key: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For this Key, delete the substring &amp;quot;virtual&amp;quot; from the values: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:registry.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Hyper-V EventLogs===&lt;br /&gt;
&lt;br /&gt;
Content in the Windows Hyper-V EventLogs is apparently an indication of a virtual machine.&lt;br /&gt;
&lt;br /&gt;
To delete the log, open the PowerShell as administrator and execute the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; wevtutil cl &amp;quot;Microsoft-Windows-Kernel-PnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check that the logs are empty with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Users\VMuser&amp;gt; Get-WinEvent -LogName &amp;quot;Microsoft-Windows-KernelPnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to disable further logging use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; Set-ItemProperty -Path &amp;quot;HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Microsoft-Windows-Kernel-PnP\Configuration&amp;quot; -Name &amp;quot;Enabled&amp;quot; -Value 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Activation===&lt;br /&gt;
&lt;br /&gt;
It is likely that your VM does not have a valid Windows product key. Most users, however, have a valid windows installed in order to use it properly.&lt;br /&gt;
&lt;br /&gt;
Instead of buying a key, for this purpose a windows activation script can be used. In this guide, [https://github.com/massgravel/Microsoft-Activation-Scripts/ this] one from GitHub is used.&lt;br /&gt;
&lt;br /&gt;
Again, open the PowerShell and enter this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
irm https://get.activated.win | iex&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tool is easy to use and afterwards the VM´s Windows should be activated.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_activation.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Other Changes===&lt;br /&gt;
&lt;br /&gt;
Some checks can be fended off without really having to change anything on the system.&lt;br /&gt;
&lt;br /&gt;
This includes, for example, how to start the tools. One tool checks whether Windows Explorer is its parent process.&lt;br /&gt;
&lt;br /&gt;
Another check looks at the system uptime, i.e. how long the system has been running. If you do not have the option to manipulate the system time, it is sufficient to let the machine run a little beforehand.&lt;br /&gt;
&lt;br /&gt;
The screen dimensions are also checked, as the VM window can be resized as required. If the dimensions are too small, it is clear that it is a VM, as there are only certain options for physical screens. E.g. a very small screen window or one that is taller than it is wide is very unlikely on a typical end user device.&lt;br /&gt;
&lt;br /&gt;
== Test Run in modified VM ==&lt;br /&gt;
&lt;br /&gt;
After implementing the described hardening measures the number of positive detections drops from &#039;&#039;&#039;57&#039;&#039;&#039; to &#039;&#039;&#039;41&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If the mouse is moved and clicked and keyboard inputs are entered during the execution of the tools, the number even drops to &#039;&#039;&#039;32&#039;&#039;&#039;. This is because of the Reverse-Turing-Tests(RTTs) of the tools. These test focus on detecting human interaction with the system, normally by mouse or keyboard.&lt;br /&gt;
These tests can only be countered by simulating human interaction, which is a complex task. In a typical analysis VM there is no human that is actually operating the system. For this example, it is sufficient if you are manually using mouse and keyboard.&lt;br /&gt;
&lt;br /&gt;
A lot of the remaining positive detections could be countered by implementing hooks. With hooks you could interecpt the return values of many system function and instead return fake information that satisfy the checks of the tools.&lt;br /&gt;
&lt;br /&gt;
However, hooking is a complex mechanism that is not covered in this article.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
There is a wide range of possible VM detection methods.&lt;br /&gt;
&lt;br /&gt;
The most widespread include simply checking static system information. However, new techniques are on the rise that exploit other vulnerabilities. Monitoring system components and observing human interaction with RTTs are powerful methods and also hard to counter.&lt;br /&gt;
&lt;br /&gt;
Malware researchers must constantly keep up with new detection and evasion methods in order to keep their analysis systems transparent. It is essential that malware can be analysed at runtime in order to keep up with increased cybercrime.&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17883</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17883"/>
		<updated>2025-01-20T20:32:45Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machine(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and several open-source VM-detection tools are executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Hyper-V is used for the virtualization. This is because it is a Type 1, bare-metal, Hypervisor, which runs directly on the host&#039;s hardware to control the hardware and to manage guest operating systems.&lt;br /&gt;
&lt;br /&gt;
The specifications are:&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/a0rtega/pafish Pafish (Paranoid Fish)]&lt;br /&gt;
* [https://github.com/kernelwernel/VMAware VMAware]&lt;br /&gt;
* [https://github.com/ayoubfaouzi/al-khaser Al-Khaser]&lt;br /&gt;
&lt;br /&gt;
===Initial Test Run===&lt;br /&gt;
&lt;br /&gt;
After the virtual machine setup is complete and all the tools have been installed, a first test can be conducted.&lt;br /&gt;
&lt;br /&gt;
In the unmodified, native machine the tools show a number of positive checks, that hint towards a VM.&lt;br /&gt;
&lt;br /&gt;
Number of detections: Pafish 13 + VMAware 13 + Al-Khaser 31 = &#039;&#039;&#039;57 positive detections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These numbers are likely to vary between different setups and tool versions.&lt;br /&gt;
&lt;br /&gt;
== Hardening Steps ==&lt;br /&gt;
&lt;br /&gt;
This section contains system modifications that aim to lower the number of positive detections.&lt;br /&gt;
&lt;br /&gt;
===Virtual Hardware Specifications===&lt;br /&gt;
&lt;br /&gt;
Common checks aim at the system hardware. If the disk, memory or processor contain strange values, which typically cannot be found on normal machines, the malware might see this as a sign of a VM.&lt;br /&gt;
&lt;br /&gt;
Very low or odd numbers are highly unlikely in a physical machine. Therefore, see that the VM has at least the following requirements:&lt;br /&gt;
&lt;br /&gt;
* 60-80 GB disk size&lt;br /&gt;
* 4-8 GB memory size and no odd numbers&lt;br /&gt;
* At least 4 processor cores and no odd numbers&lt;br /&gt;
&lt;br /&gt;
With Hyper-V, these values can be configured in the machine settings:&lt;br /&gt;
&lt;br /&gt;
[[File:VM_specs.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Registry===&lt;br /&gt;
&lt;br /&gt;
The Windows registry is a central database in Microsoft Windows that stores configuration information and settings for the operating system, installed applications and hardware components.&lt;br /&gt;
&lt;br /&gt;
The manufacturers of virtualisation software also store information for their products here. Malware checks whether known keys exist or whether they contain special strings such as &amp;quot;virtual&amp;quot; or the manufacturer&#039;s name.&lt;br /&gt;
&lt;br /&gt;
Delete the following Key: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For this Key, delete the substring &amp;quot;virtual&amp;quot; from the values: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:registry.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Hyper-V EventLogs===&lt;br /&gt;
&lt;br /&gt;
Content in the Windows Hyper-V EventLogs is apparently an indication of a virtual machine.&lt;br /&gt;
&lt;br /&gt;
To delete the log, open the PowerShell as administrator and execute the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; wevtutil cl &amp;quot;Microsoft-Windows-Kernel-PnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check that the logs are empty with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Users\VMuser&amp;gt; Get-WinEvent -LogName &amp;quot;Microsoft-Windows-KernelPnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to disable further logging use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; Set-ItemProperty -Path &amp;quot;HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Microsoft-Windows-Kernel-PnP\Configuration&amp;quot; -Name &amp;quot;Enabled&amp;quot; -Value 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Activation===&lt;br /&gt;
&lt;br /&gt;
It is likely that your VM does not have a valid Windows product key. Most users, however, have a valid windows installed in order to use it properly.&lt;br /&gt;
&lt;br /&gt;
Instead of buying a key, for this purpose a windows activation script can be used. In this guide, [https://github.com/massgravel/Microsoft-Activation-Scripts/ this] one from GitHub is used.&lt;br /&gt;
&lt;br /&gt;
Again, open the PowerShell and enter this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
irm https://get.activated.win | iex&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tool is easy to use and afterwards the VM´s Windows should be activated.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_activation.png|600px]]&lt;br /&gt;
&lt;br /&gt;
===Other Changes===&lt;br /&gt;
&lt;br /&gt;
Some checks can be fended off without really having to change anything on the system.&lt;br /&gt;
&lt;br /&gt;
This includes, for example, how to start the tools. One tool checks whether Windows Explorer is its parent process.&lt;br /&gt;
&lt;br /&gt;
Another check looks at the system uptime, i.e. how long the system has been running. If you do not have the option to manipulate the system time, it is sufficient to let the machine run a little beforehand.&lt;br /&gt;
&lt;br /&gt;
The screen dimensions are also checked, as the VM window can be resized as required. If the dimensions are too small, it is clear that it is a VM, as there are only certain options for physical screens. E.g. a very small screen window or one that is taller than it is wide is very unlikely on a typical end user device.&lt;br /&gt;
&lt;br /&gt;
== Test Run in modified VM ==&lt;br /&gt;
&lt;br /&gt;
After implementing the described hardening measures the number of positive detections drops from &#039;&#039;&#039;57&#039;&#039;&#039; to &#039;&#039;&#039;41&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If the mouse is moved and clicked and keyboard inputs are entered during the execution of the tools, the number even drops to &#039;&#039;&#039;32&#039;&#039;&#039;. This is because of the Reverse-Turing-Tests(RTTs) of the tools. These test focus on detecting human interaction with the system, normally by mouse or keyboard.&lt;br /&gt;
These tests can only be countered by simulating human interaction, which is a complex task. In a typical analysis VM there is no human that is actually operating the system. For this example, it is sufficient if you are manually using mouse and keyboard.&lt;br /&gt;
&lt;br /&gt;
A lot of the remaining positive detections could be countered by implementing hooks. With hooks you could interecpt the return values of many system function and instead return fake information that satisfy the checks of the tools.&lt;br /&gt;
&lt;br /&gt;
However, hooking is a complex mechanism that is not covered in this article.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
There is a wide range of possible VM detection methods.&lt;br /&gt;
&lt;br /&gt;
The most widespread include simply checking static system information. However, new techniques are on the rise that exploit other vulnerabilities. Monitoring system components and observing human interaction with RTTs are powerful methods and also hard to counter.&lt;br /&gt;
&lt;br /&gt;
Malware researchers must constantly keep up with new detection and evasion methods in order to keep their analysis systems transparent. It is essential that malware can be analysed at runtime in order to keep up with increased cybercrime.&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17882</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17882"/>
		<updated>2025-01-20T20:31:55Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: /* Windows Registry */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machine(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and several open-source VM-detection tools are executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Hyper-V is used for the virtualization. This is because it is a Type 1, bare-metal, Hypervisor, which runs directly on the host&#039;s hardware to control the hardware and to manage guest operating systems.&lt;br /&gt;
&lt;br /&gt;
The specifications are:&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/a0rtega/pafish Pafish (Paranoid Fish)]&lt;br /&gt;
* [https://github.com/kernelwernel/VMAware VMAware]&lt;br /&gt;
* [https://github.com/ayoubfaouzi/al-khaser Al-Khaser]&lt;br /&gt;
&lt;br /&gt;
===Initial Test Run===&lt;br /&gt;
&lt;br /&gt;
After the virtual machine setup is complete and all the tools have been installed, a first test can be conducted.&lt;br /&gt;
&lt;br /&gt;
In the unmodified, native machine the tools show a number of positive checks, that hint towards a VM.&lt;br /&gt;
&lt;br /&gt;
Number of detections: Pafish 13 + VMAware 13 + Al-Khaser 31 = &#039;&#039;&#039;57 positive detections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These numbers are likely to vary between different setups and tool versions.&lt;br /&gt;
&lt;br /&gt;
== Hardening Steps ==&lt;br /&gt;
&lt;br /&gt;
This section contains system modifications that aim to lower the number of positive detections.&lt;br /&gt;
&lt;br /&gt;
===Virtual Hardware Specifications===&lt;br /&gt;
&lt;br /&gt;
Common checks aim at the system hardware. If the disk, memory or processor contain strange values, which typically cannot be found on normal machines, the malware might see this as a sign of a VM.&lt;br /&gt;
&lt;br /&gt;
Very low or odd numbers are highly unlikely in a physical machine. Therefore, see that the VM has at least the following requirements:&lt;br /&gt;
&lt;br /&gt;
* 60-80 GB disk size&lt;br /&gt;
* 4-8 GB memory size and no odd numbers&lt;br /&gt;
* At least 4 processor cores and no odd numbers&lt;br /&gt;
&lt;br /&gt;
With Hyper-V, these values can be configured in the machine settings:&lt;br /&gt;
&lt;br /&gt;
[[File:VM_specs.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
===Windows Registry===&lt;br /&gt;
&lt;br /&gt;
The Windows registry is a central database in Microsoft Windows that stores configuration information and settings for the operating system, installed applications and hardware components.&lt;br /&gt;
&lt;br /&gt;
The manufacturers of virtualisation software also store information for their products here. Malware checks whether known keys exist or whether they contain special strings such as &amp;quot;virtual&amp;quot; or the manufacturer&#039;s name.&lt;br /&gt;
&lt;br /&gt;
Delete the following Key: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For this Key, delete the substring &amp;quot;virtual&amp;quot; from the values: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:registry.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
===Hyper-V EventLogs===&lt;br /&gt;
&lt;br /&gt;
Content in the Windows Hyper-V EventLogs is apparently an indication of a virtual machine.&lt;br /&gt;
&lt;br /&gt;
To delete the log, open the PowerShell as administrator and execute the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; wevtutil cl &amp;quot;Microsoft-Windows-Kernel-PnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check that the logs are empty with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Users\VMuser&amp;gt; Get-WinEvent -LogName &amp;quot;Microsoft-Windows-KernelPnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to disable further logging use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; Set-ItemProperty -Path &amp;quot;HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Microsoft-Windows-Kernel-PnP\Configuration&amp;quot; -Name &amp;quot;Enabled&amp;quot; -Value 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Activation===&lt;br /&gt;
&lt;br /&gt;
It is likely that your VM does not have a valid Windows product key. Most users, however, have a valid windows installed in order to use it properly.&lt;br /&gt;
&lt;br /&gt;
Instead of buying a key, for this purpose a windows activation script can be used. In this guide, [https://github.com/massgravel/Microsoft-Activation-Scripts/ this] one from GitHub is used.&lt;br /&gt;
&lt;br /&gt;
Again, open the PowerShell and enter this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
irm https://get.activated.win | iex&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tool is easy to use and afterwards the VM´s Windows should be activated.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_activation.png|600px]]&lt;br /&gt;
&lt;br /&gt;
===Other Changes===&lt;br /&gt;
&lt;br /&gt;
Some checks can be fended off without really having to change anything on the system.&lt;br /&gt;
&lt;br /&gt;
This includes, for example, how to start the tools. One tool checks whether Windows Explorer is its parent process.&lt;br /&gt;
&lt;br /&gt;
Another check looks at the system uptime, i.e. how long the system has been running. If you do not have the option to manipulate the system time, it is sufficient to let the machine run a little beforehand.&lt;br /&gt;
&lt;br /&gt;
The screen dimensions are also checked, as the VM window can be resized as required. If the dimensions are too small, it is clear that it is a VM, as there are only certain options for physical screens. E.g. a very small screen window or one that is taller than it is wide is very unlikely on a typical end user device.&lt;br /&gt;
&lt;br /&gt;
== Test Run in modified VM ==&lt;br /&gt;
&lt;br /&gt;
After implementing the described hardening measures the number of positive detections drops from &#039;&#039;&#039;57&#039;&#039;&#039; to &#039;&#039;&#039;41&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If the mouse is moved and clicked and keyboard inputs are entered during the execution of the tools, the number even drops to &#039;&#039;&#039;32&#039;&#039;&#039;. This is because of the Reverse-Turing-Tests(RTTs) of the tools. These test focus on detecting human interaction with the system, normally by mouse or keyboard.&lt;br /&gt;
These tests can only be countered by simulating human interaction, which is a complex task. In a typical analysis VM there is no human that is actually operating the system. For this example, it is sufficient if you are manually using mouse and keyboard.&lt;br /&gt;
&lt;br /&gt;
A lot of the remaining positive detections could be countered by implementing hooks. With hooks you could interecpt the return values of many system function and instead return fake information that satisfy the checks of the tools.&lt;br /&gt;
&lt;br /&gt;
However, hooking is a complex mechanism that is not covered in this article.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
There is a wide range of possible VM detection methods.&lt;br /&gt;
&lt;br /&gt;
The most widespread include simply checking static system information. However, new techniques are on the rise that exploit other vulnerabilities. Monitoring system components and observing human interaction with RTTs are powerful methods and also hard to counter.&lt;br /&gt;
&lt;br /&gt;
Malware researchers must constantly keep up with new detection and evasion methods in order to keep their analysis systems transparent. It is essential that malware can be analysed at runtime in order to keep up with increased cybercrime.&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17881</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17881"/>
		<updated>2025-01-20T20:30:37Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machine(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and several open-source VM-detection tools are executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Hyper-V is used for the virtualization. This is because it is a Type 1, bare-metal, Hypervisor, which runs directly on the host&#039;s hardware to control the hardware and to manage guest operating systems.&lt;br /&gt;
&lt;br /&gt;
The specifications are:&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/a0rtega/pafish Pafish (Paranoid Fish)]&lt;br /&gt;
* [https://github.com/kernelwernel/VMAware VMAware]&lt;br /&gt;
* [https://github.com/ayoubfaouzi/al-khaser Al-Khaser]&lt;br /&gt;
&lt;br /&gt;
===Initial Test Run===&lt;br /&gt;
&lt;br /&gt;
After the virtual machine setup is complete and all the tools have been installed, a first test can be conducted.&lt;br /&gt;
&lt;br /&gt;
In the unmodified, native machine the tools show a number of positive checks, that hint towards a VM.&lt;br /&gt;
&lt;br /&gt;
Number of detections: Pafish 13 + VMAware 13 + Al-Khaser 31 = &#039;&#039;&#039;57 positive detections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These numbers are likely to vary between different setups and tool versions.&lt;br /&gt;
&lt;br /&gt;
== Hardening Steps ==&lt;br /&gt;
&lt;br /&gt;
This section contains system modifications that aim to lower the number of positive detections.&lt;br /&gt;
&lt;br /&gt;
===Virtual Hardware Specifications===&lt;br /&gt;
&lt;br /&gt;
Common checks aim at the system hardware. If the disk, memory or processor contain strange values, which typically cannot be found on normal machines, the malware might see this as a sign of a VM.&lt;br /&gt;
&lt;br /&gt;
Very low or odd numbers are highly unlikely in a physical machine. Therefore, see that the VM has at least the following requirements:&lt;br /&gt;
&lt;br /&gt;
* 60-80 GB disk size&lt;br /&gt;
* 4-8 GB memory size and no odd numbers&lt;br /&gt;
* At least 4 processor cores and no odd numbers&lt;br /&gt;
&lt;br /&gt;
With Hyper-V, these values can be configured in the machine settings:&lt;br /&gt;
&lt;br /&gt;
[[File:VM_specs.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
===Windows Registry===&lt;br /&gt;
&lt;br /&gt;
The Windows registry is a central database in Microsoft Windows that stores configuration information and settings for the operating system, installed applications and hardware components.&lt;br /&gt;
&lt;br /&gt;
The manufacturers of virtualisation software also store information for their products here. Malware checks whether known keys exist or whether they contain special strings such as ‘virtual’ or the manufacturer&#039;s name.&lt;br /&gt;
&lt;br /&gt;
Delete the following Key: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From this Key, delete the substring &amp;quot;virtual&amp;quot; from the values: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:registry.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Hyper-V EventLogs===&lt;br /&gt;
&lt;br /&gt;
Content in the Windows Hyper-V EventLogs is apparently an indication of a virtual machine.&lt;br /&gt;
&lt;br /&gt;
To delete the log, open the PowerShell as administrator and execute the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; wevtutil cl &amp;quot;Microsoft-Windows-Kernel-PnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check that the logs are empty with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Users\VMuser&amp;gt; Get-WinEvent -LogName &amp;quot;Microsoft-Windows-KernelPnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to disable further logging use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; Set-ItemProperty -Path &amp;quot;HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Microsoft-Windows-Kernel-PnP\Configuration&amp;quot; -Name &amp;quot;Enabled&amp;quot; -Value 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Activation===&lt;br /&gt;
&lt;br /&gt;
It is likely that your VM does not have a valid Windows product key. Most users, however, have a valid windows installed in order to use it properly.&lt;br /&gt;
&lt;br /&gt;
Instead of buying a key, for this purpose a windows activation script can be used. In this guide, [https://github.com/massgravel/Microsoft-Activation-Scripts/ this] one from GitHub is used.&lt;br /&gt;
&lt;br /&gt;
Again, open the PowerShell and enter this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
irm https://get.activated.win | iex&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tool is easy to use and afterwards the VM´s Windows should be activated.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_activation.png|600px]]&lt;br /&gt;
&lt;br /&gt;
===Other Changes===&lt;br /&gt;
&lt;br /&gt;
Some checks can be fended off without really having to change anything on the system.&lt;br /&gt;
&lt;br /&gt;
This includes, for example, how to start the tools. One tool checks whether Windows Explorer is its parent process.&lt;br /&gt;
&lt;br /&gt;
Another check looks at the system uptime, i.e. how long the system has been running. If you do not have the option to manipulate the system time, it is sufficient to let the machine run a little beforehand.&lt;br /&gt;
&lt;br /&gt;
The screen dimensions are also checked, as the VM window can be resized as required. If the dimensions are too small, it is clear that it is a VM, as there are only certain options for physical screens. E.g. a very small screen window or one that is taller than it is wide is very unlikely on a typical end user device.&lt;br /&gt;
&lt;br /&gt;
== Test Run in modified VM ==&lt;br /&gt;
&lt;br /&gt;
After implementing the described hardening measures the number of positive detections drops from &#039;&#039;&#039;57&#039;&#039;&#039; to &#039;&#039;&#039;41&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If the mouse is moved and clicked and keyboard inputs are entered during the execution of the tools, the number even drops to &#039;&#039;&#039;32&#039;&#039;&#039;. This is because of the Reverse-Turing-Tests(RTTs) of the tools. These test focus on detecting human interaction with the system, normally by mouse or keyboard.&lt;br /&gt;
These tests can only be countered by simulating human interaction, which is a complex task. In a typical analysis VM there is no human that is actually operating the system. For this example, it is sufficient if you are manually using mouse and keyboard.&lt;br /&gt;
&lt;br /&gt;
A lot of the remaining positive detections could be countered by implementing hooks. With hooks you could interecpt the return values of many system function and instead return fake information that satisfy the checks of the tools.&lt;br /&gt;
&lt;br /&gt;
However, hooking is a complex mechanism that is not covered in this article.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
There is a wide range of possible VM detection methods.&lt;br /&gt;
&lt;br /&gt;
The most widespread include simply checking static system information. However, new techniques are on the rise that exploit other vulnerabilities. Monitoring system components and observing human interaction with RTTs are powerful methods and also hard to counter.&lt;br /&gt;
&lt;br /&gt;
Malware researchers must constantly keep up with new detection and evasion methods in order to keep their analysis systems transparent. It is essential that malware can be analysed at runtime in order to keep up with increased cybercrime.&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17880</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17880"/>
		<updated>2025-01-20T20:29:11Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machine(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and several open-source VM-detection tools are executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Hyper-V is used for the virtualization. This is because it is a Type 1, bare-metal, Hypervisor, which runs directly on the host&#039;s hardware to control the hardware and to manage guest operating systems.&lt;br /&gt;
&lt;br /&gt;
The specifications are:&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/a0rtega/pafish Pafish (Paranoid Fish)]&lt;br /&gt;
* [https://github.com/kernelwernel/VMAware VMAware]&lt;br /&gt;
* [https://github.com/ayoubfaouzi/al-khaser Al-Khaser]&lt;br /&gt;
&lt;br /&gt;
===Initial Test Run===&lt;br /&gt;
&lt;br /&gt;
After the virtual machine setup is complete and all the tools have been installed, a first test can be conducted.&lt;br /&gt;
&lt;br /&gt;
In the unmodified, native machine the tools show a number of positive checks, that hint towards a VM:&lt;br /&gt;
&lt;br /&gt;
Number of detections: Pafish 13 + VMAware 13 + Al-Khaser 31 = &#039;&#039;&#039;57 positive detections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These numbers are likely to vary between different setups and tool versions.&lt;br /&gt;
&lt;br /&gt;
== Hardening Steps ==&lt;br /&gt;
&lt;br /&gt;
This section contains system modifications that lower the number of positive detections.&lt;br /&gt;
&lt;br /&gt;
===Virtual Hardware Specifications===&lt;br /&gt;
&lt;br /&gt;
Common checks aim at the system hardware. If the disk, memory or processor contain strange values, which typically cannot be found on normal machines, the malware might see this as a sign of a VM.&lt;br /&gt;
&lt;br /&gt;
Very low or odd numbers are highly unlikely in a physical machine. Therefore, see that the VM has at least the following requirements:&lt;br /&gt;
&lt;br /&gt;
* 60-80 GB disk size&lt;br /&gt;
* 4-8 GB memory size and no odd numbers&lt;br /&gt;
* At least 4 processor cores and no odd numbers&lt;br /&gt;
&lt;br /&gt;
With Hyper-V, these values can be configured in the machine settings:&lt;br /&gt;
&lt;br /&gt;
[[File:VM_specs.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
===Windows Registry===&lt;br /&gt;
&lt;br /&gt;
The Windows registry is a central database in Microsoft Windows that stores configuration information and settings for the operating system, installed applications and hardware components.&lt;br /&gt;
&lt;br /&gt;
The manufacturers of virtualisation software also store information for their products here. Malware checks whether known keys exist or whether they contain special strings such as ‘virtual’ or the manufacturer&#039;s name.&lt;br /&gt;
&lt;br /&gt;
Delete the following Key: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From this Key, delete the substring &amp;quot;virtual&amp;quot; from the values: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:registry.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Hyper-V EventLogs===&lt;br /&gt;
&lt;br /&gt;
Content in the Windows Hyper-V EventLogs is apparently an indication of a virtual machine.&lt;br /&gt;
&lt;br /&gt;
To delete the log, open the PowerShell as administrator and execute the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; wevtutil cl &amp;quot;Microsoft-Windows-Kernel-PnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check that the logs are empty with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Users\VMuser&amp;gt; Get-WinEvent -LogName &amp;quot;Microsoft-Windows-KernelPnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to disable further logging use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; Set-ItemProperty -Path &amp;quot;HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Microsoft-Windows-Kernel-PnP\Configuration&amp;quot; -Name &amp;quot;Enabled&amp;quot; -Value 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Activation===&lt;br /&gt;
&lt;br /&gt;
It is likely that your VM does not have a valid Windows product key. Most users, however, have a valid windows installed in order to use it properly.&lt;br /&gt;
&lt;br /&gt;
Instead of buying a key, for this purpose a windows activation script can be used. In this guide, [https://github.com/massgravel/Microsoft-Activation-Scripts/ this] one from GitHub is used.&lt;br /&gt;
&lt;br /&gt;
Again, open the PowerShell and enter this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
irm https://get.activated.win | iex&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tool is easy to use and afterwards the VM´s Windows should be activated.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_activation.png|600px]]&lt;br /&gt;
&lt;br /&gt;
===Other Changes===&lt;br /&gt;
&lt;br /&gt;
Some checks can be fended off without really having to change anything on the system.&lt;br /&gt;
&lt;br /&gt;
This includes, for example, how to start the tools. One tool checks whether Windows Explorer is its parent process.&lt;br /&gt;
&lt;br /&gt;
Another check looks at the system uptime, i.e. how long the system has been running. If you do not have the option to manipulate the system time, it is sufficient to let the machine run a little beforehand.&lt;br /&gt;
&lt;br /&gt;
The screen dimensions are also checked, as the VM window can be resized as required. If the dimensions are too small, it is clear that it is a VM, as there are only certain options for physical screens. E.g. a very small screen window or one that is taller than it is wide is very unlikely on a typical end user device.&lt;br /&gt;
&lt;br /&gt;
== Test Run in modified VM ==&lt;br /&gt;
&lt;br /&gt;
After implementing the described hardening measures the number of positive detections drops from &#039;&#039;&#039;57&#039;&#039;&#039; to &#039;&#039;&#039;41&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If the mouse is moved and clicked and keyboard inputs are entered during the execution of the tools, the number even drops to &#039;&#039;&#039;32&#039;&#039;&#039;. This is because of the Reverse-Turing-Tests(RTTs) of the tools. These test focus on detecting human interaction with the system, normally by mouse or keyboard.&lt;br /&gt;
These tests can only be countered by simulating human interaction, which is a complex task. In a typical analysis VM there is no human that is actually operating the system. For this example, it is sufficient if you are manually using mouse and keyboard.&lt;br /&gt;
&lt;br /&gt;
A lot of the remaining positive detections could be countered by implementing hooks. With hooks you could interecpt the return values of many system function and instead return fake information that satisfy the checks of the tools.&lt;br /&gt;
&lt;br /&gt;
However, hooking is a complex mechanism that is not covered in this article.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
There is a wide range of possible VM detection methods.&lt;br /&gt;
&lt;br /&gt;
The most widespread include simply checking static system information. However, new techniques are on the rise that exploit other vulnerabilities. Monitoring system components and observing human interaction with RTTs are powerful methods and also hard to counter.&lt;br /&gt;
&lt;br /&gt;
Malware researchers must constantly keep up with new detection and evasion methods in order to keep their analysis systems transparent. It is essential that malware can be analysed at runtime in order to keep up with increased cybercrime.&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17878</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17878"/>
		<updated>2025-01-20T20:28:06Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machine(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and several open-source VM-detection tools are executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Hyper-V is used for the virtualization. This is because it is a Type 1, bare-metal, Hypervisor, which runs directly on the host&#039;s hardware to control the hardware and to manage guest operating systems.&lt;br /&gt;
&lt;br /&gt;
The specifications are:&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/a0rtega/pafish Pafish (Paranoid Fish)]&lt;br /&gt;
* [https://github.com/kernelwernel/VMAware VMAware]&lt;br /&gt;
* [https://github.com/ayoubfaouzi/al-khaser Al-Khaser]&lt;br /&gt;
&lt;br /&gt;
===Initial Test Run===&lt;br /&gt;
&lt;br /&gt;
After the virtual machine setup is complete and all the tools have been installed, a first test can be conducted.&lt;br /&gt;
&lt;br /&gt;
In the unmodified, native machine the tools show a number of positive checks, that hint towards a VM:&lt;br /&gt;
&lt;br /&gt;
Number of detections: Pafish 13 + VMAware 13 + Al-Khaser 31 = &#039;&#039;&#039;57 positive detections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These numbers are likely to vary between different setups and tool versions.&lt;br /&gt;
&lt;br /&gt;
== Hardening Steps ==&lt;br /&gt;
&lt;br /&gt;
This section contains system modifications that lower the number of positive detections.&lt;br /&gt;
&lt;br /&gt;
===Virtual Hardware Specifications===&lt;br /&gt;
&lt;br /&gt;
Common checks aim at the system hardware. If the disk, memory or processor contain strange values, which typically cannot be found on normal machines, the malware might see this as a sign of a VM.&lt;br /&gt;
&lt;br /&gt;
Very low or odd numbers are highly unlikely in a physical machine. Therefore, see that the VM has at least the following requirements:&lt;br /&gt;
&lt;br /&gt;
* 60-80 GB disk size&lt;br /&gt;
* 4-8 GB memory size and no odd numbers&lt;br /&gt;
* At least 4 processor cores and no odd numbers&lt;br /&gt;
&lt;br /&gt;
With Hyper-V, these values can be configured in the machine settings:&lt;br /&gt;
&lt;br /&gt;
[[File:VM_specs.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
===Windows Registry===&lt;br /&gt;
&lt;br /&gt;
The Windows registry is a central database in Microsoft Windows that stores configuration information and settings for the operating system, installed applications and hardware components.&lt;br /&gt;
&lt;br /&gt;
The manufacturers of virtualisation software also store information for their products here. Malware checks whether known keys exist or whether they contain special strings such as ‘virtual’ or the manufacturer&#039;s name.&lt;br /&gt;
&lt;br /&gt;
Delete the following Key: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From this Key, delete the substring &amp;quot;virtual&amp;quot; from the values: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:registry.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Hyper-V EventLogs===&lt;br /&gt;
&lt;br /&gt;
Content in the Windows Hyper-V EventLogs is apparently an indication of a virtual machine.&lt;br /&gt;
&lt;br /&gt;
To delete the log, open the PowerShell as administrator and execute the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; wevtutil cl &amp;quot;Microsoft-Windows-Kernel-PnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check that the logs are empty with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Users\VMuser&amp;gt; Get-WinEvent -LogName &amp;quot;Microsoft-Windows-KernelPnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to disable further logging use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; Set-ItemProperty -Path &amp;quot;HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Microsoft-Windows-Kernel-PnP\Configuration&amp;quot; -Name &amp;quot;Enabled&amp;quot; -Value 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Activation===&lt;br /&gt;
&lt;br /&gt;
It is likely that your VM does not have a valid Windows product key. Most users, however, have a valid windows installed in order to use it properly.&lt;br /&gt;
&lt;br /&gt;
Instead of buying a key, for this purpose a windows activation script can be used. In this guide, [https://github.com/massgravel/Microsoft-Activation-Scripts/ this] one from GitHub is used.&lt;br /&gt;
&lt;br /&gt;
Again, open the PowerShell and enter this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
irm https://get.activated.win | iex&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tool is easy to use and afterwards the VM´s Windows should be activated.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_activation.png|600px]]&lt;br /&gt;
&lt;br /&gt;
===Other Changes===&lt;br /&gt;
&lt;br /&gt;
Some checks can be fended off without really having to change anything on the system.&lt;br /&gt;
&lt;br /&gt;
This includes, for example, how to start the tools. One tool checks whether Windows Explorer is its parent process.&lt;br /&gt;
&lt;br /&gt;
Another check looks at the system uptime, i.e. how long the system has been running. If you do not have the option to manipulate the system time, it is sufficient to let the machine run a little beforehand.&lt;br /&gt;
&lt;br /&gt;
The screen dimensions are also checked, as the VM window can be resized as required. If the dimensions are too small, it is clear that it is a VM, as there are only certain options for physical screens. E.g. a very small screen window or one that is taller than it is wide is very unlikely on a typical end user device.&lt;br /&gt;
&lt;br /&gt;
== Test Run in modified VM ==&lt;br /&gt;
&lt;br /&gt;
After implementing the described hardening measures the number of positive detections drops from &#039;&#039;&#039;57&#039;&#039;&#039; to &#039;&#039;&#039;41&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If the mouse is moved and clicked and keyboard inputs are entered during the execution of the tools, the number even drops to &#039;&#039;&#039;32&#039;&#039;&#039;. This is because of the Reverse-Turing-Tests(RTTs) of the tools. These test focus on detecting human interaction with the system, normally by mouse or keyboard.&lt;br /&gt;
These tests can only be countered by simulating human interaction, which is a complex task. In a typical analysis VM there is no human that is actually operating the system. For this example, it is sufficient if you are manually using mouse and keyboard.&lt;br /&gt;
&lt;br /&gt;
A lot of the remaining positive detections could be countered by implementing hooks. With hooks you could interecpt the return values of many system function and instead return fake information that satisfy the checks of the tools.&lt;br /&gt;
&lt;br /&gt;
However, hooking is a complex mechanism that is not covered in this article.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
There is a wide range of possible VM detection methods.&lt;br /&gt;
&lt;br /&gt;
The most widespread include simply checking static system information. However, new techniques are on the rise that exploit other vulnerabilities. Monitoring system components and observing human interaction with RTTs are powerful methods and also hard to counter.&lt;br /&gt;
&lt;br /&gt;
Malware researchers have to constantly keep up with new detection and evasion methods in order to keep their analysis systems tranpartent. It is essential that malware can be analyzed at runtime in order to keep up with increased cybercrime.&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17877</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17877"/>
		<updated>2025-01-20T20:27:02Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machine(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and several open-source VM-detection tools are executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Hyper-V is used for the virtualization. This is because it is a Type 1, bare-metal, Hypervisor, which runs directly on the host&#039;s hardware to control the hardware and to manage guest operating systems.&lt;br /&gt;
&lt;br /&gt;
The specifications are:&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/a0rtega/pafish Pafish (Paranoid Fish)]&lt;br /&gt;
* [https://github.com/kernelwernel/VMAware VMAware]&lt;br /&gt;
* [https://github.com/ayoubfaouzi/al-khaser Al-Khaser]&lt;br /&gt;
&lt;br /&gt;
===Initial Test Run===&lt;br /&gt;
&lt;br /&gt;
After the virtual machine setup is complete and all the tools have been installed, a first test can be conducted.&lt;br /&gt;
&lt;br /&gt;
In the unmodified, native machine the tools show a number of positive checks, that hint towards a VM:&lt;br /&gt;
&lt;br /&gt;
Number of detections: Pafish 13 + VMAware 13 + Al-Khaser 31 = &#039;&#039;&#039;57 positive detections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These numbers are likely to vary between different setups and tool versions.&lt;br /&gt;
&lt;br /&gt;
== Hardening Steps ==&lt;br /&gt;
&lt;br /&gt;
This section contains system modifications that lower the number of positive detections.&lt;br /&gt;
&lt;br /&gt;
===Virtual Hardware Specifications===&lt;br /&gt;
&lt;br /&gt;
Common checks aim at the system hardware. If the disk, memory or processor contain strange values, which typically cannot be found on normal machines, the malware might see this as a sign of a VM.&lt;br /&gt;
&lt;br /&gt;
Very low or odd numbers are highly unlikely in a physical machine. Therefore, see that the VM has at least the following requirements:&lt;br /&gt;
&lt;br /&gt;
* 60-80 GB disk size&lt;br /&gt;
* 4-8 GB memory size and no odd numbers&lt;br /&gt;
* At least 4 processor cores and no odd numbers&lt;br /&gt;
&lt;br /&gt;
With Hyper-V, these values can be configured in the machine settings:&lt;br /&gt;
&lt;br /&gt;
[[File:VM_specs.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
===Windows Registry===&lt;br /&gt;
&lt;br /&gt;
The Windows registry is a central database in Microsoft Windows that stores configuration information and settings for the operating system, installed applications and hardware components.&lt;br /&gt;
&lt;br /&gt;
The manufacturers of virtualisation software also store information for their products here. Malware checks whether known keys exist or whether they contain special strings such as ‘virtual’ or the manufacturer&#039;s name.&lt;br /&gt;
&lt;br /&gt;
Delete the following Key: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From this Key, delete the substring &amp;quot;virtual&amp;quot; from the values: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:registry.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Hyper-V EventLogs===&lt;br /&gt;
&lt;br /&gt;
Content in the Windows Hyper-V EventLogs is apparently an indication of a virtual machine.&lt;br /&gt;
&lt;br /&gt;
To delete the log, open the PowerShell as administrator and execute the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; wevtutil cl &amp;quot;Microsoft-Windows-Kernel-PnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check that the logs are empty with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Users\VMuser&amp;gt; Get-WinEvent -LogName &amp;quot;Microsoft-Windows-KernelPnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to disable further logging use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; Set-ItemProperty -Path &amp;quot;HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Microsoft-Windows-Kernel-PnP\Configuration&amp;quot; -Name &amp;quot;Enabled&amp;quot; -Value 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Activation===&lt;br /&gt;
&lt;br /&gt;
It is likely that your VM does not have a valid Windows product key. Most users, however, have a valid windows installed in order to use it properly.&lt;br /&gt;
&lt;br /&gt;
Instead of buying a key, for this purpose a windows activation script can be used. In this guide, [https://github.com/massgravel/Microsoft-Activation-Scripts/ this] one from GitHub is used.&lt;br /&gt;
&lt;br /&gt;
Again, open the PowerShell and enter this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
irm https://get.activated.win | iex&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tool is easy to use and afterwards the VM´s Windows should be activated.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_activation.png|600px]]&lt;br /&gt;
&lt;br /&gt;
===Other Changes===&lt;br /&gt;
&lt;br /&gt;
Some checks can be fended off without really having to change anything on the system.&lt;br /&gt;
&lt;br /&gt;
This includes, for example, how to start the tools. One tool checks whether Windows Explorer is its parent process.&lt;br /&gt;
&lt;br /&gt;
Another check looks at the system uptime, i.e. how long the system has been running. If you do not have the option to manipulate the system time, it is sufficient to let the machine run a little beforehand.&lt;br /&gt;
&lt;br /&gt;
The screen dimensions are also checked, as the VM window can be resized as required. If the dimensions are too small, it is clear that it is a VM, as there are only certain options for physical screens. E.g. a very small screen window or one that is taller than it is wide is very unlikely on a typical end user device.&lt;br /&gt;
&lt;br /&gt;
== Test Run in modified VM ==&lt;br /&gt;
&lt;br /&gt;
After implementing the descirbed hardening measures the number of positive detections drops from &#039;&#039;&#039;57&#039;&#039;&#039; to &#039;&#039;&#039;41&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If the mouse is moved and clicked and keyboard inputs are entered during the execution of the tools, the number even drops to &#039;&#039;&#039;32&#039;&#039;&#039;. This is because of the Reverse-Turing-Tests(RTTs) of the tools. These test focus on detecting human interaction with the system, normally by mouse or keyboard.&lt;br /&gt;
These tests can only be counterd by simulating human interaction, which is a complex task. In a typical analysis VM there is no human that is actually operating the system. For this example, it is suffencient if you are manually using mouse and keyboard.&lt;br /&gt;
&lt;br /&gt;
A lot of the remaining positive detections could be countered by implementing hooks. With hooks you could interecpt the return values of many system function and instead return fake information that satisfy the checks of the tools.&lt;br /&gt;
&lt;br /&gt;
However, hooking is a complex mechanism that is not covered in this article.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
There is a wide range of possible VM detection methods.&lt;br /&gt;
&lt;br /&gt;
The most widespread include simply checking static system information. However, new techniques are on the rise that exploit other vulnerabilities. Monitoring system components and observing human interaction with RTTs are powerful methods and also hard to counter.&lt;br /&gt;
&lt;br /&gt;
Malware researchers have to constantly keep up with new detection and evasion methods in order to keep their analysis systems tranpartent. It is essential that malware can be analyzed at runtime in order to keep up with increased cybercrime.&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17876</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17876"/>
		<updated>2025-01-20T20:25:44Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machine(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and several open-source VM-detection tools are executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Hyper-V is used for the virtualization. This is because it is a Type 1, bare-metal, Hypervisor, which runs directly on the host&#039;s hardware to control the hardware and to manage guest operating systems.&lt;br /&gt;
&lt;br /&gt;
The specifications are:&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/a0rtega/pafish Pafish (Paranoid Fish)]&lt;br /&gt;
* [https://github.com/kernelwernel/VMAware VMAware]&lt;br /&gt;
* [https://github.com/ayoubfaouzi/al-khaser Al-Khaser]&lt;br /&gt;
&lt;br /&gt;
===Initial Test Run===&lt;br /&gt;
&lt;br /&gt;
After the virtual machine setup is complete and all the tools have been installed, a first test can be conducted.&lt;br /&gt;
&lt;br /&gt;
In the unmodified, native machine the tools show a number of positive checks, that hint towards a VM:&lt;br /&gt;
&lt;br /&gt;
Number of detections: Pafish 13 + VMAware 13 + Al-Khaser 31 = &#039;&#039;&#039;57 positive detections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These numbers are likely to vary between different setups and tool versions.&lt;br /&gt;
&lt;br /&gt;
== Hardening Steps ==&lt;br /&gt;
&lt;br /&gt;
This section contains system modifications that lower the number of positive detections.&lt;br /&gt;
&lt;br /&gt;
===Virtual Hardware Specifications===&lt;br /&gt;
&lt;br /&gt;
Common checks aim at the system hardware. If the disk, memory or processor contain strange values, which typically cannot be found on normal machines, the malware might see this as a sign of a VM.&lt;br /&gt;
&lt;br /&gt;
Very low or odd numbers are highly unlikely in a physical machine. Therefore, see that the VM has at least the following requirements:&lt;br /&gt;
&lt;br /&gt;
* 60-80 GB disk size&lt;br /&gt;
* 4-8 GB memory size and no odd numbers&lt;br /&gt;
* At least 4 processor cores and no odd numbers&lt;br /&gt;
&lt;br /&gt;
With Hyper-V, these values can be configured in the machine settings:&lt;br /&gt;
&lt;br /&gt;
[[File:VM_specs.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
===Windows Registry===&lt;br /&gt;
&lt;br /&gt;
The Windows registry is a central database in Microsoft Windows that stores configuration information and settings for the operating system, installed applications and hardware components.&lt;br /&gt;
&lt;br /&gt;
The manufacturers of virtualisation software also store information for their products here. Malware checks whether known keys exist or whether they contain special strings such as ‘virtual’ or the manufacturer&#039;s name.&lt;br /&gt;
&lt;br /&gt;
Delete the following Key: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From this Key, delete the substring &amp;quot;virtual&amp;quot; from the values: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:registry.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Hyper-V EventLogs===&lt;br /&gt;
&lt;br /&gt;
Content in the Windows Hyper-V EventLogs is apparently an indication of a virtual machine.&lt;br /&gt;
&lt;br /&gt;
To delete the log, open the PowerShell as administrator and execute the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; wevtutil cl &amp;quot;Microsoft-Windows-Kernel-PnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check that the logs are empty with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Users\VMuser&amp;gt; Get-WinEvent -LogName &amp;quot;Microsoft-Windows-KernelPnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to disable further logging use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; Set-ItemProperty -Path &amp;quot;HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Microsoft-Windows-Kernel-PnP\Configuration&amp;quot; -Name &amp;quot;Enabled&amp;quot; -Value 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Activation===&lt;br /&gt;
&lt;br /&gt;
It is likely that your VM does not have a valid Windows product key. Most users, however, have a valid windows installed in order to use it properly.&lt;br /&gt;
&lt;br /&gt;
Instead of buying a key, for this purpose a windows activation script can be used. In this guide, [https://github.com/massgravel/Microsoft-Activation-Scripts/ this] one from GitHub is used.&lt;br /&gt;
&lt;br /&gt;
Again open the PowerShell and enter this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
irm https://get.activated.win | iex&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tool is easy to use and afterwards the VM´s Windows should be activated.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_activation.png|600px]]&lt;br /&gt;
&lt;br /&gt;
===Other Changes===&lt;br /&gt;
&lt;br /&gt;
Some checks can be fended off without really having to change anything on the system.&lt;br /&gt;
&lt;br /&gt;
This includes, for example, how to start the tools. One tool checks whether Windows Explorer is its parent process.&lt;br /&gt;
&lt;br /&gt;
Another check looks at the system uptime, i.e. how how long the system has been running. If you do not have the option to manipulate the system time, it is sufficient to let the machine run a little beforehand.&lt;br /&gt;
&lt;br /&gt;
The screen dimensions are also checked, as the VM window can be resized as required. If the dimensions are too small, it is clear that it is a VM, as there are only certain options for physical screens. E.g. a very small screen window or one that is taller than it is wide is very unlikely on a typical end user device.&lt;br /&gt;
&lt;br /&gt;
== Test Run in modified VM ==&lt;br /&gt;
&lt;br /&gt;
After implementing the descirbed hardening measures the number of positive detections drops from &#039;&#039;&#039;57&#039;&#039;&#039; to &#039;&#039;&#039;41&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If the mouse is moved and clicked and keyboard inputs are entered during the execution of the tools, the number even drops to &#039;&#039;&#039;32&#039;&#039;&#039;. This is because of the Reverse-Turing-Tests(RTTs) of the tools. These test focus on detecting human interaction with the system, normally by mouse or keyboard.&lt;br /&gt;
These tests can only be counterd by simulating human interaction, which is a complex task. In a typical analysis VM there is no human that is actually operating the system. For this example, it is suffencient if you are manually using mouse and keyboard.&lt;br /&gt;
&lt;br /&gt;
A lot of the remaining positive detections could be countered by implementing hooks. With hooks you could interecpt the return values of many system function and instead return fake information that satisfy the checks of the tools.&lt;br /&gt;
&lt;br /&gt;
However, hooking is a complex mechanism that is not covered in this article.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
There is a wide range of possible VM detection methods.&lt;br /&gt;
&lt;br /&gt;
The most widespread include simply checking static system information. However, new techniques are on the rise that exploit other vulnerabilities. Monitoring system components and observing human interaction with RTTs are powerful methods and also hard to counter.&lt;br /&gt;
&lt;br /&gt;
Malware researchers have to constantly keep up with new detection and evasion methods in order to keep their analysis systems tranpartent. It is essential that malware can be analyzed at runtime in order to keep up with increased cybercrime.&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17875</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17875"/>
		<updated>2025-01-20T20:24:32Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machine(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and several open-source VM-detection tools are executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Hyper-V is used for the virtualization. This is because it is a Type 1, bare-metal, Hypervisor, which runs directly on the host&#039;s hardware to control the hardware and to manage guest operating systems.&lt;br /&gt;
&lt;br /&gt;
The specifications are:&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/a0rtega/pafish Pafish (Paranoid Fish)]&lt;br /&gt;
* [https://github.com/kernelwernel/VMAware VMAware]&lt;br /&gt;
* [https://github.com/ayoubfaouzi/al-khaser Al-Khaser]&lt;br /&gt;
&lt;br /&gt;
===Initial Test Run===&lt;br /&gt;
&lt;br /&gt;
After the virtual machine setup is complete and all the tools have been installed, a first test can be conducted.&lt;br /&gt;
&lt;br /&gt;
In the unmodified, native machine the tools show a number of positive checks, that hint towards a VM:&lt;br /&gt;
&lt;br /&gt;
Number of detections: Pafish 13 + VMAware 13 + Al-Khaser 31 = &#039;&#039;&#039;57 positive detections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These numbers are likely to vary between different setups and tool versions.&lt;br /&gt;
&lt;br /&gt;
== Hardening Steps ==&lt;br /&gt;
&lt;br /&gt;
This section contains system modifications that lower the number of positive detections.&lt;br /&gt;
&lt;br /&gt;
===Virtual Hardware Specifications===&lt;br /&gt;
&lt;br /&gt;
Common checks aim at the system hardware. If the disk, memory or processor contain strange values, which typically cannot be found on normal machines, the malware might see this as a sign of a VM.&lt;br /&gt;
&lt;br /&gt;
Very low or odd numbers are highly unlikely in a physical machine. Therefore, see that the VM has at least the following requirements:&lt;br /&gt;
&lt;br /&gt;
* 60-80 GB disk size&lt;br /&gt;
* 4-8 GB memory size and no odd numbers&lt;br /&gt;
* At least 4 processor cores and no odd numbers&lt;br /&gt;
&lt;br /&gt;
With Hyper-V, these values can be configured in the machine settings:&lt;br /&gt;
&lt;br /&gt;
[[File:VM_specs.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
===Windows Registry===&lt;br /&gt;
&lt;br /&gt;
The Windows registry is a central database in Microsoft Windows that stores configuration information and settings for the operating system, installed applications and hardware components.&lt;br /&gt;
&lt;br /&gt;
The manufacturers of virtualisation software also store information for their products here. Malware checks whether known keys exist or whether they contain special strings such as ‘virtual’ or the manufacturer&#039;s name.&lt;br /&gt;
&lt;br /&gt;
Delete the following Key: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From this Key, delete the substring &amp;quot;virtual&amp;quot; from the values: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:registry.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Hyper-V EventLogs===&lt;br /&gt;
&lt;br /&gt;
Content in the Windows Hyper-V EventLogs is apparently an indication of a virtual machine.&lt;br /&gt;
&lt;br /&gt;
To delete the loge, open the PowerShell as administrator and execute the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; wevtutil cl &amp;quot;Microsoft-Windows-Kernel-PnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check that the logs are empty with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Users\VMuser&amp;gt; Get-WinEvent -LogName &amp;quot;Microsoft-Windows-KernelPnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to disable further logging use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; Set-ItemProperty -Path &amp;quot;HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Microsoft-Windows-Kernel-PnP\Configuration&amp;quot; -Name &amp;quot;Enabled&amp;quot; -Value 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Activation===&lt;br /&gt;
&lt;br /&gt;
It is likely that your VM does not have a valid Windows product key. Most users, however, have a valid windows installed in order to use it properly.&lt;br /&gt;
&lt;br /&gt;
Instead of buying a key, for this purpose a windows activation script can be used. In this guide, [https://github.com/massgravel/Microsoft-Activation-Scripts/ this] one from GitHub is used.&lt;br /&gt;
&lt;br /&gt;
Again open the PowerShell and enter this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
irm https://get.activated.win | iex&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tool is easy to use and afterwards the VM´s Windows should be activated.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_activation.png|600px]]&lt;br /&gt;
&lt;br /&gt;
===Other Changes===&lt;br /&gt;
&lt;br /&gt;
Some checks can be fended off without really having to change anything on the system.&lt;br /&gt;
&lt;br /&gt;
This includes, for example, how to start the tools. One tool checks whether Windows Explorer is its parent process.&lt;br /&gt;
&lt;br /&gt;
Another check looks at the system uptime, i.e. how how long the system has been running. If you do not have the option to manipulate the system time, it is sufficient to let the machine run a little beforehand.&lt;br /&gt;
&lt;br /&gt;
The screen dimensions are also checked, as the VM window can be resized as required. If the dimensions are too small, it is clear that it is a VM, as there are only certain options for physical screens. E.g. a very small screen window or one that is taller than it is wide is very unlikely on a typical end user device.&lt;br /&gt;
&lt;br /&gt;
== Test Run in modified VM ==&lt;br /&gt;
&lt;br /&gt;
After implementing the descirbed hardening measures the number of positive detections drops from &#039;&#039;&#039;57&#039;&#039;&#039; to &#039;&#039;&#039;41&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If the mouse is moved and clicked and keyboard inputs are entered during the execution of the tools, the number even drops to &#039;&#039;&#039;32&#039;&#039;&#039;. This is because of the Reverse-Turing-Tests(RTTs) of the tools. These test focus on detecting human interaction with the system, normally by mouse or keyboard.&lt;br /&gt;
These tests can only be counterd by simulating human interaction, which is a complex task. In a typical analysis VM there is no human that is actually operating the system. For this example, it is suffencient if you are manually using mouse and keyboard.&lt;br /&gt;
&lt;br /&gt;
A lot of the remaining positive detections could be countered by implementing hooks. With hooks you could interecpt the return values of many system function and instead return fake information that satisfy the checks of the tools.&lt;br /&gt;
&lt;br /&gt;
However, hooking is a complex mechanism that is not covered in this article.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
There is a wide range of possible VM detection methods.&lt;br /&gt;
&lt;br /&gt;
The most widespread include simply checking static system information. However, new techniques are on the rise that exploit other vulnerabilities. Monitoring system components and observing human interaction with RTTs are powerful methods and also hard to counter.&lt;br /&gt;
&lt;br /&gt;
Malware researchers have to constantly keep up with new detection and evasion methods in order to keep their analysis systems tranpartent. It is essential that malware can be analyzed at runtime in order to keep up with increased cybercrime.&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17874</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17874"/>
		<updated>2025-01-20T20:22:58Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machine(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and several open-source VM-detection tools are executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Hyper-V is used for the virtualization. This is because it is a Type 1, bare-metal, Hypervisor, which runs directly on the host&#039;s hardware to control the hardware and to manage guest operating systems.&lt;br /&gt;
&lt;br /&gt;
The specifications are:&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/a0rtega/pafish Pafish (Paranoid Fish)]&lt;br /&gt;
* [https://github.com/kernelwernel/VMAware VMAware]&lt;br /&gt;
* [https://github.com/ayoubfaouzi/al-khaser Al-Khaser]&lt;br /&gt;
&lt;br /&gt;
===Initial Test Run===&lt;br /&gt;
&lt;br /&gt;
After the virtual machine setup is complete and all the tools have been installed, a first test can be conducted.&lt;br /&gt;
&lt;br /&gt;
In the unmodified, native machine the tools show a number of positive checks, that hint towards a VM:&lt;br /&gt;
&lt;br /&gt;
Number of detections: Pafish 13 + VMAware 13 + Al-Khaser 31 = &#039;&#039;&#039;57 positive detections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These numbers are likely to vary between different setups and tool versions.&lt;br /&gt;
&lt;br /&gt;
== Hardening Steps ==&lt;br /&gt;
&lt;br /&gt;
This section contains some system modifications that lower the number of positive detections.&lt;br /&gt;
&lt;br /&gt;
===Virtual Hardware Specifications===&lt;br /&gt;
&lt;br /&gt;
Common checks aim at the system hardware. If the disk, memory or processor contain strange values, which typcially cannot be found on normal machines, the malware might see this as a sign of a VM.&lt;br /&gt;
&lt;br /&gt;
Very low or odd numbers are highly unlikey in a physical machine. Therefore, see that the VM has at least the following requirements:&lt;br /&gt;
&lt;br /&gt;
* 60-80 GB disk size&lt;br /&gt;
* 4-8 GB memory size and no odd numbers&lt;br /&gt;
* At least 4 processor cores and no odd numbers&lt;br /&gt;
&lt;br /&gt;
With Hyper-V, these values can be configured in the machine settings:&lt;br /&gt;
&lt;br /&gt;
[[File:VM_specs.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
===Windows Registry===&lt;br /&gt;
&lt;br /&gt;
The Windows registry is a central database in Microsoft Windows that stores configuration information and settings for the operating system, installed applications and hardware components.&lt;br /&gt;
&lt;br /&gt;
The manufacturers of virtualisation software also store information for their products here. Malware checks whether known keys exist or whether they contain special strings such as ‘virtual’ or the manufacturer&#039;s name.&lt;br /&gt;
&lt;br /&gt;
Delete the following Key: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From this Key, delete the substring &amp;quot;virtual&amp;quot; from the values: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:registry.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Hyper-V EventLogs===&lt;br /&gt;
&lt;br /&gt;
Content in the Windows Hyper-V EventLogs is apparently an indication of a virtual machine.&lt;br /&gt;
&lt;br /&gt;
To delete the loge, open the PowerShell as administrator and execute the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; wevtutil cl &amp;quot;Microsoft-Windows-Kernel-PnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check that the logs are empty with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Users\VMuser&amp;gt; Get-WinEvent -LogName &amp;quot;Microsoft-Windows-KernelPnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to disable further logging use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; Set-ItemProperty -Path &amp;quot;HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Microsoft-Windows-Kernel-PnP\Configuration&amp;quot; -Name &amp;quot;Enabled&amp;quot; -Value 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Activation===&lt;br /&gt;
&lt;br /&gt;
It is likely that your VM does not have a valid Windows product key. Most users, however, have a valid windows installed in order to use it properly.&lt;br /&gt;
&lt;br /&gt;
Instead of buying a key, for this purpose a windows activation script can be used. In this guide, [https://github.com/massgravel/Microsoft-Activation-Scripts/ this] one from GitHub is used.&lt;br /&gt;
&lt;br /&gt;
Again open the PowerShell and enter this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
irm https://get.activated.win | iex&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tool is easy to use and afterwards the VM´s Windows should be activated.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_activation.png|600px]]&lt;br /&gt;
&lt;br /&gt;
===Other Changes===&lt;br /&gt;
&lt;br /&gt;
Some checks can be fended off without really having to change anything on the system.&lt;br /&gt;
&lt;br /&gt;
This includes, for example, how to start the tools. One tool checks whether Windows Explorer is its parent process.&lt;br /&gt;
&lt;br /&gt;
Another check looks at the system uptime, i.e. how how long the system has been running. If you do not have the option to manipulate the system time, it is sufficient to let the machine run a little beforehand.&lt;br /&gt;
&lt;br /&gt;
The screen dimensions are also checked, as the VM window can be resized as required. If the dimensions are too small, it is clear that it is a VM, as there are only certain options for physical screens. E.g. a very small screen window or one that is taller than it is wide is very unlikely on a typical end user device.&lt;br /&gt;
&lt;br /&gt;
== Test Run in modified VM ==&lt;br /&gt;
&lt;br /&gt;
After implementing the descirbed hardening measures the number of positive detections drops from &#039;&#039;&#039;57&#039;&#039;&#039; to &#039;&#039;&#039;41&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If the mouse is moved and clicked and keyboard inputs are entered during the execution of the tools, the number even drops to &#039;&#039;&#039;32&#039;&#039;&#039;. This is because of the Reverse-Turing-Tests(RTTs) of the tools. These test focus on detecting human interaction with the system, normally by mouse or keyboard.&lt;br /&gt;
These tests can only be counterd by simulating human interaction, which is a complex task. In a typical analysis VM there is no human that is actually operating the system. For this example, it is suffencient if you are manually using mouse and keyboard.&lt;br /&gt;
&lt;br /&gt;
A lot of the remaining positive detections could be countered by implementing hooks. With hooks you could interecpt the return values of many system function and instead return fake information that satisfy the checks of the tools.&lt;br /&gt;
&lt;br /&gt;
However, hooking is a complex mechanism that is not covered in this article.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
There is a wide range of possible VM detection methods.&lt;br /&gt;
&lt;br /&gt;
The most widespread include simply checking static system information. However, new techniques are on the rise that exploit other vulnerabilities. Monitoring system components and observing human interaction with RTTs are powerful methods and also hard to counter.&lt;br /&gt;
&lt;br /&gt;
Malware researchers have to constantly keep up with new detection and evasion methods in order to keep their analysis systems tranpartent. It is essential that malware can be analyzed at runtime in order to keep up with increased cybercrime.&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17872</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17872"/>
		<updated>2025-01-20T20:22:03Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machine(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and several open-source VM-detection tools are executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Hyper-V is used for the virtualization. This is because it is a Type 1, bare-metal, Hypervisor, which runs directly on the host&#039;s hardware to control the hardware and to manage guest operating systems.&lt;br /&gt;
&lt;br /&gt;
The specifications are:&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/a0rtega/pafish Pafish (Paranoid Fish)]&lt;br /&gt;
* [https://github.com/kernelwernel/VMAware VMAware]&lt;br /&gt;
* [https://github.com/ayoubfaouzi/al-khaser Al-Khaser]&lt;br /&gt;
&lt;br /&gt;
===Initial Test Run===&lt;br /&gt;
&lt;br /&gt;
After the virtual machine setup is complete and all the tools have been installed, a first test can be conducted.&lt;br /&gt;
&lt;br /&gt;
In the unmodified, native machine the tools show a number of positive checks, that hint towards a VM:&lt;br /&gt;
&lt;br /&gt;
Pafish 13 + VMAware 13 + Al-Khaser 31 = &#039;&#039;&#039;57 positive detections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These numbers are likely to vary between different setups and tool versions.&lt;br /&gt;
&lt;br /&gt;
== Hardening Steps ==&lt;br /&gt;
&lt;br /&gt;
This section contains some system modifications that lower the number of positive detections.&lt;br /&gt;
&lt;br /&gt;
===Virtual Hardware Specifications===&lt;br /&gt;
&lt;br /&gt;
Common checks aim at the system hardware. If the disk, memory or processor contain strange values, which typcially cannot be found on normal machines, the malware might see this as a sign of a VM.&lt;br /&gt;
&lt;br /&gt;
Very low or odd numbers are highly unlikey in a physical machine. Therefore, see that the VM has at least the following requirements:&lt;br /&gt;
&lt;br /&gt;
* 60-80 GB disk size&lt;br /&gt;
* 4-8 GB memory size and no odd numbers&lt;br /&gt;
* At least 4 processor cores and no odd numbers&lt;br /&gt;
&lt;br /&gt;
With Hyper-V, these values can be configured in the machine settings:&lt;br /&gt;
&lt;br /&gt;
[[File:VM_specs.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
===Windows Registry===&lt;br /&gt;
&lt;br /&gt;
The Windows registry is a central database in Microsoft Windows that stores configuration information and settings for the operating system, installed applications and hardware components.&lt;br /&gt;
&lt;br /&gt;
The manufacturers of virtualisation software also store information for their products here. Malware checks whether known keys exist or whether they contain special strings such as ‘virtual’ or the manufacturer&#039;s name.&lt;br /&gt;
&lt;br /&gt;
Delete the following Key: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From this Key, delete the substring &amp;quot;virtual&amp;quot; from the values: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:registry.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Hyper-V EventLogs===&lt;br /&gt;
&lt;br /&gt;
Content in the Windows Hyper-V EventLogs is apparently an indication of a virtual machine.&lt;br /&gt;
&lt;br /&gt;
To delete the loge, open the PowerShell as administrator and execute the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; wevtutil cl &amp;quot;Microsoft-Windows-Kernel-PnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check that the logs are empty with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Users\VMuser&amp;gt; Get-WinEvent -LogName &amp;quot;Microsoft-Windows-KernelPnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to disable further logging use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; Set-ItemProperty -Path &amp;quot;HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Microsoft-Windows-Kernel-PnP\Configuration&amp;quot; -Name &amp;quot;Enabled&amp;quot; -Value 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Activation===&lt;br /&gt;
&lt;br /&gt;
It is likely that your VM does not have a valid Windows product key. Most users, however, have a valid windows installed in order to use it properly.&lt;br /&gt;
&lt;br /&gt;
Instead of buying a key, for this purpose a windows activation script can be used. In this guide, [https://github.com/massgravel/Microsoft-Activation-Scripts/ this] one from GitHub is used.&lt;br /&gt;
&lt;br /&gt;
Again open the PowerShell and enter this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
irm https://get.activated.win | iex&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tool is easy to use and afterwards the VM´s Windows should be activated.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_activation.png|600px]]&lt;br /&gt;
&lt;br /&gt;
===Other Changes===&lt;br /&gt;
&lt;br /&gt;
Some checks can be fended off without really having to change anything on the system.&lt;br /&gt;
&lt;br /&gt;
This includes, for example, how to start the tools. One tool checks whether Windows Explorer is its parent process.&lt;br /&gt;
&lt;br /&gt;
Another check looks at the system uptime, i.e. how how long the system has been running. If you do not have the option to manipulate the system time, it is sufficient to let the machine run a little beforehand.&lt;br /&gt;
&lt;br /&gt;
The screen dimensions are also checked, as the VM window can be resized as required. If the dimensions are too small, it is clear that it is a VM, as there are only certain options for physical screens. E.g. a very small screen window or one that is taller than it is wide is very unlikely on a typical end user device.&lt;br /&gt;
&lt;br /&gt;
== Test Run in modified VM ==&lt;br /&gt;
&lt;br /&gt;
After implementing the descirbed hardening measures the number of positive detections drops from &#039;&#039;&#039;57&#039;&#039;&#039; to &#039;&#039;&#039;41&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If the mouse is moved and clicked and keyboard inputs are entered during the execution of the tools, the number even drops to &#039;&#039;&#039;32&#039;&#039;&#039;. This is because of the Reverse-Turing-Tests(RTTs) of the tools. These test focus on detecting human interaction with the system, normally by mouse or keyboard.&lt;br /&gt;
These tests can only be counterd by simulating human interaction, which is a complex task. In a typical analysis VM there is no human that is actually operating the system. For this example, it is suffencient if you are manually using mouse and keyboard.&lt;br /&gt;
&lt;br /&gt;
A lot of the remaining positive detections could be countered by implementing hooks. With hooks you could interecpt the return values of many system function and instead return fake information that satisfy the checks of the tools.&lt;br /&gt;
&lt;br /&gt;
However, hooking is a complex mechanism that is not covered in this article.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
There is a wide range of possible VM detection methods.&lt;br /&gt;
&lt;br /&gt;
The most widespread include simply checking static system information. However, new techniques are on the rise that exploit other vulnerabilities. Monitoring system components and observing human interaction with RTTs are powerful methods and also hard to counter.&lt;br /&gt;
&lt;br /&gt;
Malware researchers have to constantly keep up with new detection and evasion methods in order to keep their analysis systems tranpartent. It is essential that malware can be analyzed at runtime in order to keep up with increased cybercrime.&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17871</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17871"/>
		<updated>2025-01-20T20:21:08Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machine(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and several open-source VM-detection tools are executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Hyper-V is used for the virtualization. This is because it is a Type 1, bare-metal, Hypervisor, which runs directly on the host&#039;s hardware to control the hardware and to manage guest operating systems.&lt;br /&gt;
&lt;br /&gt;
Further specifications are:&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/a0rtega/pafish Pafish (Paranoid Fish)]&lt;br /&gt;
* [https://github.com/kernelwernel/VMAware VMAware]&lt;br /&gt;
* [https://github.com/ayoubfaouzi/al-khaser Al-Khaser]&lt;br /&gt;
&lt;br /&gt;
===Initial Test Run===&lt;br /&gt;
&lt;br /&gt;
After the virtual machine setup is complete and all the tools have been installed, a first test can be conducted.&lt;br /&gt;
&lt;br /&gt;
In the unmodified, native machine the tools show a number of positive checks, that hint towards a VM:&lt;br /&gt;
&lt;br /&gt;
Pafish 13 + VMAware 13 + Al-Khaser 31 = &#039;&#039;&#039;57 positive detections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These numbers are likely to vary between different setups and tool versions.&lt;br /&gt;
&lt;br /&gt;
== Hardening Steps ==&lt;br /&gt;
&lt;br /&gt;
This section contains some system modifications that lower the number of positive detections.&lt;br /&gt;
&lt;br /&gt;
===Virtual Hardware Specifications===&lt;br /&gt;
&lt;br /&gt;
Common checks aim at the system hardware. If the disk, memory or processor contain strange values, which typcially cannot be found on normal machines, the malware might see this as a sign of a VM.&lt;br /&gt;
&lt;br /&gt;
Very low or odd numbers are highly unlikey in a physical machine. Therefore, see that the VM has at least the following requirements:&lt;br /&gt;
&lt;br /&gt;
* 60-80 GB disk size&lt;br /&gt;
* 4-8 GB memory size and no odd numbers&lt;br /&gt;
* At least 4 processor cores and no odd numbers&lt;br /&gt;
&lt;br /&gt;
With Hyper-V, these values can be configured in the machine settings:&lt;br /&gt;
&lt;br /&gt;
[[File:VM_specs.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
===Windows Registry===&lt;br /&gt;
&lt;br /&gt;
The Windows registry is a central database in Microsoft Windows that stores configuration information and settings for the operating system, installed applications and hardware components.&lt;br /&gt;
&lt;br /&gt;
The manufacturers of virtualisation software also store information for their products here. Malware checks whether known keys exist or whether they contain special strings such as ‘virtual’ or the manufacturer&#039;s name.&lt;br /&gt;
&lt;br /&gt;
Delete the following Key: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From this Key, delete the substring &amp;quot;virtual&amp;quot; from the values: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:registry.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Hyper-V EventLogs===&lt;br /&gt;
&lt;br /&gt;
Content in the Windows Hyper-V EventLogs is apparently an indication of a virtual machine.&lt;br /&gt;
&lt;br /&gt;
To delete the loge, open the PowerShell as administrator and execute the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; wevtutil cl &amp;quot;Microsoft-Windows-Kernel-PnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check that the logs are empty with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Users\VMuser&amp;gt; Get-WinEvent -LogName &amp;quot;Microsoft-Windows-KernelPnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to disable further logging use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; Set-ItemProperty -Path &amp;quot;HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Microsoft-Windows-Kernel-PnP\Configuration&amp;quot; -Name &amp;quot;Enabled&amp;quot; -Value 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Activation===&lt;br /&gt;
&lt;br /&gt;
It is likely that your VM does not have a valid Windows product key. Most users, however, have a valid windows installed in order to use it properly.&lt;br /&gt;
&lt;br /&gt;
Instead of buying a key, for this purpose a windows activation script can be used. In this guide, [https://github.com/massgravel/Microsoft-Activation-Scripts/ this] one from GitHub is used.&lt;br /&gt;
&lt;br /&gt;
Again open the PowerShell and enter this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
irm https://get.activated.win | iex&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tool is easy to use and afterwards the VM´s Windows should be activated.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_activation.png|600px]]&lt;br /&gt;
&lt;br /&gt;
===Other Changes===&lt;br /&gt;
&lt;br /&gt;
Some checks can be fended off without really having to change anything on the system.&lt;br /&gt;
&lt;br /&gt;
This includes, for example, how to start the tools. One tool checks whether Windows Explorer is its parent process.&lt;br /&gt;
&lt;br /&gt;
Another check looks at the system uptime, i.e. how how long the system has been running. If you do not have the option to manipulate the system time, it is sufficient to let the machine run a little beforehand.&lt;br /&gt;
&lt;br /&gt;
The screen dimensions are also checked, as the VM window can be resized as required. If the dimensions are too small, it is clear that it is a VM, as there are only certain options for physical screens. E.g. a very small screen window or one that is taller than it is wide is very unlikely on a typical end user device.&lt;br /&gt;
&lt;br /&gt;
== Test Run in modified VM ==&lt;br /&gt;
&lt;br /&gt;
After implementing the descirbed hardening measures the number of positive detections drops from &#039;&#039;&#039;57&#039;&#039;&#039; to &#039;&#039;&#039;41&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If the mouse is moved and clicked and keyboard inputs are entered during the execution of the tools, the number even drops to &#039;&#039;&#039;32&#039;&#039;&#039;. This is because of the Reverse-Turing-Tests(RTTs) of the tools. These test focus on detecting human interaction with the system, normally by mouse or keyboard.&lt;br /&gt;
These tests can only be counterd by simulating human interaction, which is a complex task. In a typical analysis VM there is no human that is actually operating the system. For this example, it is suffencient if you are manually using mouse and keyboard.&lt;br /&gt;
&lt;br /&gt;
A lot of the remaining positive detections could be countered by implementing hooks. With hooks you could interecpt the return values of many system function and instead return fake information that satisfy the checks of the tools.&lt;br /&gt;
&lt;br /&gt;
However, hooking is a complex mechanism that is not covered in this article.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
There is a wide range of possible VM detection methods.&lt;br /&gt;
&lt;br /&gt;
The most widespread include simply checking static system information. However, new techniques are on the rise that exploit other vulnerabilities. Monitoring system components and observing human interaction with RTTs are powerful methods and also hard to counter.&lt;br /&gt;
&lt;br /&gt;
Malware researchers have to constantly keep up with new detection and evasion methods in order to keep their analysis systems tranpartent. It is essential that malware can be analyzed at runtime in order to keep up with increased cybercrime.&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17866</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17866"/>
		<updated>2025-01-20T16:41:02Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machin(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and a number of open-source VM-detection tools is executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Hyper-V is used for the virtualization. This is because it is a Type 1, bare-metal, Hypervisor, which runs directly on the host&#039;s hardware to control the hardware and to manage guest operating systems.&lt;br /&gt;
&lt;br /&gt;
Further specifications are:&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/a0rtega/pafish Pafish (Paranoid Fish)]&lt;br /&gt;
* [https://github.com/kernelwernel/VMAware VMAware]&lt;br /&gt;
* [https://github.com/ayoubfaouzi/al-khaser Al-Khaser]&lt;br /&gt;
&lt;br /&gt;
===Initial Test Run===&lt;br /&gt;
&lt;br /&gt;
After the virtual machine setup is complete and all the tools have been installed, a first test can be conducted.&lt;br /&gt;
&lt;br /&gt;
In the unmodified, native machine the tools show a number of positive checks, that hint towards a VM:&lt;br /&gt;
&lt;br /&gt;
Pafish 13 + VMAware 13 + Al-Khaser 31 = &#039;&#039;&#039;57 positive detections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These numbers are likely to vary between different setups and tool versions.&lt;br /&gt;
&lt;br /&gt;
== Hardening Steps ==&lt;br /&gt;
&lt;br /&gt;
This section contains some system modifications that lower the number of positive detections.&lt;br /&gt;
&lt;br /&gt;
===Virtual Hardware Specifications===&lt;br /&gt;
&lt;br /&gt;
Common checks aim at the system hardware. If the disk, memory or processor contain strange values, which typcially cannot be found on normal machines, the malware might see this as a sign of a VM.&lt;br /&gt;
&lt;br /&gt;
Very low or odd numbers are highly unlikey in a physical machine. Therefore, see that the VM has at least the following requirements:&lt;br /&gt;
&lt;br /&gt;
* 60-80 GB disk size&lt;br /&gt;
* 4-8 GB memory size and no odd numbers&lt;br /&gt;
* At least 4 processor cores and no odd numbers&lt;br /&gt;
&lt;br /&gt;
With Hyper-V, these values can be configured in the machine settings:&lt;br /&gt;
&lt;br /&gt;
[[File:VM_specs.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
===Windows Registry===&lt;br /&gt;
&lt;br /&gt;
The Windows registry is a central database in Microsoft Windows that stores configuration information and settings for the operating system, installed applications and hardware components.&lt;br /&gt;
&lt;br /&gt;
The manufacturers of virtualisation software also store information for their products here. Malware checks whether known keys exist or whether they contain special strings such as ‘virtual’ or the manufacturer&#039;s name.&lt;br /&gt;
&lt;br /&gt;
Delete the following Key: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From this Key, delete the substring &amp;quot;virtual&amp;quot; from the values: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:registry.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Hyper-V EventLogs===&lt;br /&gt;
&lt;br /&gt;
Content in the Windows Hyper-V EventLogs is apparently an indication of a virtual machine.&lt;br /&gt;
&lt;br /&gt;
To delete the loge, open the PowerShell as administrator and execute the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; wevtutil cl &amp;quot;Microsoft-Windows-Kernel-PnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check that the logs are empty with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Users\VMuser&amp;gt; Get-WinEvent -LogName &amp;quot;Microsoft-Windows-KernelPnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to disable further logging use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; Set-ItemProperty -Path &amp;quot;HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Microsoft-Windows-Kernel-PnP\Configuration&amp;quot; -Name &amp;quot;Enabled&amp;quot; -Value 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Activation===&lt;br /&gt;
&lt;br /&gt;
It is likely that your VM does not have a valid Windows product key. Most users, however, have a valid windows installed in order to use it properly.&lt;br /&gt;
&lt;br /&gt;
Instead of buying a key, for this purpose a windows activation script can be used. In this guide, [https://github.com/massgravel/Microsoft-Activation-Scripts/ this] one from GitHub is used.&lt;br /&gt;
&lt;br /&gt;
Again open the PowerShell and enter this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
irm https://get.activated.win | iex&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tool is easy to use and afterwards the VM´s Windows should be activated.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_activation.png|600px]]&lt;br /&gt;
&lt;br /&gt;
===Other Changes===&lt;br /&gt;
&lt;br /&gt;
Some checks can be fended off without really having to change anything on the system.&lt;br /&gt;
&lt;br /&gt;
This includes, for example, how to start the tools. One tool checks whether Windows Explorer is its parent process.&lt;br /&gt;
&lt;br /&gt;
Another check looks at the system uptime, i.e. how how long the system has been running. If you do not have the option to manipulate the system time, it is sufficient to let the machine run a little beforehand.&lt;br /&gt;
&lt;br /&gt;
The screen dimensions are also checked, as the VM window can be resized as required. If the dimensions are too small, it is clear that it is a VM, as there are only certain options for physical screens. E.g. a very small screen window or one that is taller than it is wide is very unlikely on a typical end user device.&lt;br /&gt;
&lt;br /&gt;
== Test Run in modified VM ==&lt;br /&gt;
&lt;br /&gt;
After implementing the descirbed hardening measures the number of positive detections drops from &#039;&#039;&#039;57&#039;&#039;&#039; to &#039;&#039;&#039;41&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If the mouse is moved and clicked and keyboard inputs are entered during the execution of the tools, the number even drops to &#039;&#039;&#039;32&#039;&#039;&#039;. This is because of the Reverse-Turing-Tests(RTTs) of the tools. These test focus on detecting human interaction with the system, normally by mouse or keyboard.&lt;br /&gt;
These tests can only be counterd by simulating human interaction, which is a complex task. In a typical analysis VM there is no human that is actually operating the system. For this example, it is suffencient if you are manually using mouse and keyboard.&lt;br /&gt;
&lt;br /&gt;
A lot of the remaining positive detections could be countered by implementing hooks. With hooks you could interecpt the return values of many system function and instead return fake information that satisfy the checks of the tools.&lt;br /&gt;
&lt;br /&gt;
However, hooking is a complex mechanism that is not covered in this article.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
There is a wide range of possible VM detection methods.&lt;br /&gt;
&lt;br /&gt;
The most widespread include simply checking static system information. However, new techniques are on the rise that exploit other vulnerabilities. Monitoring system components and observing human interaction with RTTs are powerful methods and also hard to counter.&lt;br /&gt;
&lt;br /&gt;
Malware researchers have to constantly keep up with new detection and evasion methods in order to keep their analysis systems tranpartent. It is essential that malware can be analyzed at runtime in order to keep up with increased cybercrime.&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17865</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17865"/>
		<updated>2025-01-20T16:34:43Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machin(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and a number of open-source VM-detection tools is executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Hyper-V is used for the virtualization. This is because it is a Type 1, bare-metal, Hypervisor, which runs directly on the host&#039;s hardware to control the hardware and to manage guest operating systems.&lt;br /&gt;
&lt;br /&gt;
Further specifications are:&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/a0rtega/pafish Pafish (Paranoid Fish)]&lt;br /&gt;
* [https://github.com/kernelwernel/VMAware VMAware]&lt;br /&gt;
* [https://github.com/ayoubfaouzi/al-khaser Al-Khaser]&lt;br /&gt;
&lt;br /&gt;
===Initial Test Run===&lt;br /&gt;
&lt;br /&gt;
After the virtual machine setup is complete and all the tools have been installed, a first test can be conducted.&lt;br /&gt;
&lt;br /&gt;
In the unmodified, native machine the tools show a number of positive checks, that hint towards a VM:&lt;br /&gt;
&lt;br /&gt;
Pafish 13 + VMAware 13 + Al-Khaser 31 = &#039;&#039;&#039;57 positive detections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These numbers are likely to vary between different setups and tool versions.&lt;br /&gt;
&lt;br /&gt;
== Hardening Steps ==&lt;br /&gt;
&lt;br /&gt;
This section contains some system modifications that lower the number of positive detections.&lt;br /&gt;
&lt;br /&gt;
===Virtual Hardware Specifications===&lt;br /&gt;
&lt;br /&gt;
Common checks aim at the system hardware. If the disk, memory or processor contain strange values, which typcially cannot be found on normal machines, the malware might see this as a sign of a VM.&lt;br /&gt;
&lt;br /&gt;
Very low or odd numbers are highly unlikey in a physical machine. Therefore, see that the VM has at least the following requirements:&lt;br /&gt;
&lt;br /&gt;
* 60-80 GB disk size&lt;br /&gt;
* 4-8 GB memory size and no odd numbers&lt;br /&gt;
* At least 4 processor cores and no odd numbers&lt;br /&gt;
&lt;br /&gt;
With Hyper-V, these values can be configured in the machine settings:&lt;br /&gt;
&lt;br /&gt;
[[File:VM_specs.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
===Windows Registry===&lt;br /&gt;
&lt;br /&gt;
The Windows registry is a central database in Microsoft Windows that stores configuration information and settings for the operating system, installed applications and hardware components.&lt;br /&gt;
&lt;br /&gt;
The manufacturers of virtualisation software also store information for their products here. Malware checks whether known keys exist or whether they contain special strings such as ‘virtual’ or the manufacturer&#039;s name.&lt;br /&gt;
&lt;br /&gt;
Delete the following Key: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From this Key, delete the substring &amp;quot;virtual&amp;quot; from the values: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:registry.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Hyper-V EventLogs===&lt;br /&gt;
&lt;br /&gt;
Content in the Windows Hyper-V EventLogs is apparently an indication of a virtual machine.&lt;br /&gt;
&lt;br /&gt;
To delete the loge, open the PowerShell as administrator and execute the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; wevtutil cl &amp;quot;Microsoft-Windows-Kernel-PnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check that the logs are empty with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Users\VMuser&amp;gt; Get-WinEvent -LogName &amp;quot;Microsoft-Windows-KernelPnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to disable further logging use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; Set-ItemProperty -Path &amp;quot;HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Microsoft-Windows-Kernel-PnP\Configuration&amp;quot; -Name &amp;quot;Enabled&amp;quot; -Value 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Activation===&lt;br /&gt;
&lt;br /&gt;
It is likely that your VM does not have a valid Windows product key. Most users, however, have a valid windows installed in order to use it properly.&lt;br /&gt;
&lt;br /&gt;
Instead of buying a key, for this purpose a windows activation script can be used. In this guide, [https://github.com/massgravel/Microsoft-Activation-Scripts/ this] one from GitHub is used.&lt;br /&gt;
&lt;br /&gt;
Again open the PowerShell and enter this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
irm https://get.activated.win | iex&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tool is easy to use and afterwards the VM´s Windows should be activated.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_activation.png|600px]]&lt;br /&gt;
&lt;br /&gt;
===Other Changes===&lt;br /&gt;
&lt;br /&gt;
Some checks can be fended off without really having to change anything on the system.&lt;br /&gt;
&lt;br /&gt;
This includes, for example, how to start the tools. One tool checks whether Windows Explorer is its parent process.&lt;br /&gt;
&lt;br /&gt;
Another check looks at the system uptime, i.e. how how long the system has been running. If you do not have the option to manipulate the system time, it is sufficient to let the machine run a little beforehand.&lt;br /&gt;
&lt;br /&gt;
The screen dimensions are also checked, as the VM window can be resized as required. If the dimensions are too small, it is clear that it is a VM, as there are only certain options for physical screens. E.g. a very small screen window or one that is taller than it is wide is very unlikely on a typical end user device.&lt;br /&gt;
&lt;br /&gt;
== Test Run in modified VM ==&lt;br /&gt;
&lt;br /&gt;
After implementing the descirbed hardening measures the number of positive detections drops from &#039;&#039;&#039;57&#039;&#039;&#039; to &#039;&#039;&#039;41&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If the mouse is moved and clicked and keyboard inputs are entered during the execution of the tools, the number even drops to &#039;&#039;&#039;32&#039;&#039;&#039;. This is because of the Reverse-Turing-Tests(RTTs) of the tools. These test focus on detecting human interaction with the system, normally by mouse or keyboard.&lt;br /&gt;
These tests can only be counterd by simulating human interaction, which is a complex task. In a typical analysis VM there is no human that is actually operating the system. For this example, it is suffencient if you are manually using mouse and keyboard.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
There is a wide range of possible VM detection methods.&lt;br /&gt;
&lt;br /&gt;
The most widespread include simply checking static system information. However, new techniques are on the rise that exploit other vulnerabilities. Monitoring system components and observing human interaction with RTTs are powerful methods and also hard to counter.&lt;br /&gt;
&lt;br /&gt;
Malware researchers have to constantly keep up with new detection and evasion methods in order to keep their analysis systems tranpartent. It is essential that malware can be analyzed at runtime in order to keep up with increased cybercrime.&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17864</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17864"/>
		<updated>2025-01-20T16:33:15Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machin(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and a number of open-source VM-detection tools is executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Hyper-V is used for the virtualization. This is because it is a Type 1, bare-metal, Hypervisor, which runs directly on the host&#039;s hardware to control the hardware and to manage guest operating systems.&lt;br /&gt;
&lt;br /&gt;
Further specifications are:&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/a0rtega/pafish Pafish (Paranoid Fish)]&lt;br /&gt;
* [https://github.com/kernelwernel/VMAware VMAware]&lt;br /&gt;
* [https://github.com/ayoubfaouzi/al-khaser Al-Khaser]&lt;br /&gt;
&lt;br /&gt;
===Initial Test Run===&lt;br /&gt;
&lt;br /&gt;
After the virtual machine setup is complete and all the tools have been installed, a first test can be conducted.&lt;br /&gt;
&lt;br /&gt;
In the unmodified, native machine the tools show a number of positive checks, that hint towards a VM:&lt;br /&gt;
&lt;br /&gt;
Pafish 13 + VMAware 13 + Al-Khaser 31 = &#039;&#039;&#039;57 positive detections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These numbers are likely to vary between different setups and tool versions.&lt;br /&gt;
&lt;br /&gt;
== Hardening Steps ==&lt;br /&gt;
&lt;br /&gt;
This section contains some system modifications that lower the number of positive detections.&lt;br /&gt;
&lt;br /&gt;
===Virtual Hardware Specifications===&lt;br /&gt;
&lt;br /&gt;
Common checks aim at the system hardware. If the disk, memory or processor contain strange values, which typcially cannot be found on normal machines, the malware might see this as a sign of a VM.&lt;br /&gt;
&lt;br /&gt;
Very low or odd numbers are highly unlikey in a physical machine. Therefore, see that the VM has at least the following requirements:&lt;br /&gt;
&lt;br /&gt;
* 60-80 GB disk size&lt;br /&gt;
* 4-8 GB memory size and no odd numbers&lt;br /&gt;
* At least 4 processor cores and no odd numbers&lt;br /&gt;
&lt;br /&gt;
With Hyper-V, these values can be configured in the machine settings:&lt;br /&gt;
&lt;br /&gt;
[[File:VM_specs.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
===Windows Registry===&lt;br /&gt;
&lt;br /&gt;
The Windows registry is a central database in Microsoft Windows that stores configuration information and settings for the operating system, installed applications and hardware components.&lt;br /&gt;
&lt;br /&gt;
The manufacturers of virtualisation software also store information for their products here. Malware checks whether known keys exist or whether they contain special strings such as ‘virtual’ or the manufacturer&#039;s name.&lt;br /&gt;
&lt;br /&gt;
Delete the following Key: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From this Key, delete the substring &amp;quot;virtual&amp;quot; from the values: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:registry.png| 600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Hyper-V EventLogs===&lt;br /&gt;
&lt;br /&gt;
Content in the Windows Hyper-V EventLogs is apparently an indication of a virtual machine.&lt;br /&gt;
&lt;br /&gt;
To delete the loge, open the PowerShell as administrator and execute the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; wevtutil cl &amp;quot;Microsoft-Windows-Kernel-PnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check that the logs are empty with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Users\VMuser&amp;gt; Get-WinEvent -LogName &amp;quot;Microsoft-Windows-KernelPnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to disable further logging use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; Set-ItemProperty -Path &amp;quot;HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Microsoft-Windows-Kernel-PnP\Configuration&amp;quot; -Name &amp;quot;Enabled&amp;quot; -Value 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Activation===&lt;br /&gt;
&lt;br /&gt;
It is likely that your VM does not have a valid Windows product key. Most users, however, have a valid windows installed in order to use it properly.&lt;br /&gt;
&lt;br /&gt;
Instead of buying a key, for this purpose a windows activation script can be used. In this guide, [https://github.com/massgravel/Microsoft-Activation-Scripts/ this] one from GitHub is used.&lt;br /&gt;
&lt;br /&gt;
Again open the PowerShell and enter this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
irm https://get.activated.win | iex&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tool is easy to use and afterwards the VM´s Windows should be activated.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_activation.png|600px]]&lt;br /&gt;
&lt;br /&gt;
===Other Changes===&lt;br /&gt;
&lt;br /&gt;
Some checks can be fended off without really having to change anything on the system.&lt;br /&gt;
&lt;br /&gt;
This includes, for example, how to start the tools. One tool checks whether Windows Explorer is its parent process.&lt;br /&gt;
&lt;br /&gt;
Another check looks at the system uptime, i.e. how how long the system has been running. If you do not have the option to manipulate the system time, it is sufficient to let the machine run a little beforehand.&lt;br /&gt;
&lt;br /&gt;
The screen dimensions are also checked, as the VM window can be resized as required. If the dimensions are too small, it is clear that it is a VM, as there are only certain options for physical screens. E.g. a very small screen window or one that is taller than it is wide is very unlikely on a typical end user device.&lt;br /&gt;
&lt;br /&gt;
== Test Run in modified VM ==&lt;br /&gt;
&lt;br /&gt;
After implementing the descirbed hardening measures the number of positive detections drops from &#039;&#039;&#039;57&#039;&#039;&#039; to &#039;&#039;&#039;41&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If the mouse is moved and clicked and keyboard inputs are entered during the execution of the tools, the number even drops to &#039;&#039;&#039;32&#039;&#039;&#039;. This is because of the Reverse-Turing-Tests(RTTs) of the tools. These test focus on detecting human interaction with the system, normally by mouse or keyboard.&lt;br /&gt;
These tests can only be counterd by simulating human interaction, which is a complex task. In a typical analysis VM there is no human that is actually operating the system. For this example, it is suffencient if you are manually using mouse and keyboard.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
There is a wide range of possible VM detection methods. The most widespread include simply checking static system information. However, new techniques are on the rise that exploit other vulnerabilities. Monitoring system components and observing human interaction with RTTs are powerful methods and also hard to counter.&lt;br /&gt;
Malware researchers have to constantly keep up with new detection and evasion methods in order to keep their analysis systems tranpartent. It is essential that malware can be analyzed at runtime in order to keep up with increased cybercrime.&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17863</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17863"/>
		<updated>2025-01-20T16:29:57Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machin(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and a number of open-source VM-detection tools is executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Hyper-V is used for the virtualization. This is because it is a Type 1, bare-metal, Hypervisor, which runs directly on the host&#039;s hardware to control the hardware and to manage guest operating systems.&lt;br /&gt;
&lt;br /&gt;
Further specifications are:&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/a0rtega/pafish Pafish (Paranoid Fish)]&lt;br /&gt;
* [https://github.com/kernelwernel/VMAware VMAware]&lt;br /&gt;
* [https://github.com/ayoubfaouzi/al-khaser Al-Khaser]&lt;br /&gt;
&lt;br /&gt;
===Initial Test Run===&lt;br /&gt;
&lt;br /&gt;
After the virtual machine setup is complete and all the tools have been installed, a first test can be conducted.&lt;br /&gt;
&lt;br /&gt;
In the unmodified, native machine the tools show a number of positive checks, that hint towards a VM:&lt;br /&gt;
&lt;br /&gt;
Pafish 13 + VMAware 13 + Al-Khaser 31 = &#039;&#039;&#039;57 positive detections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These numbers are likely to vary between different setups and tool versions.&lt;br /&gt;
&lt;br /&gt;
== Hardening Steps ==&lt;br /&gt;
&lt;br /&gt;
This section contains some system modifications that lower the number of positive detections.&lt;br /&gt;
&lt;br /&gt;
===Virtual Hardware Specifications===&lt;br /&gt;
&lt;br /&gt;
Common checks aim at the system hardware. If the disk, memory or processor contain strange values, which typcially cannot be found on normal machines, the malware might see this as a sign of a VM.&lt;br /&gt;
&lt;br /&gt;
Very low or odd numbers are highly unlikey in a physical machine. Therefore, see that the VM has at least the following requirements:&lt;br /&gt;
&lt;br /&gt;
* 60-80 GB disk size&lt;br /&gt;
* 4-8 GB memory size and no odd numbers&lt;br /&gt;
* At least 4 processor cores and no odd numbers&lt;br /&gt;
&lt;br /&gt;
With Hyper-V, these values can be configured in the machine settings:&lt;br /&gt;
&lt;br /&gt;
[[File:VM_specs.png|600px|center|thumb|VM Hardware Settings]]&lt;br /&gt;
&lt;br /&gt;
===Windows Registry===&lt;br /&gt;
&lt;br /&gt;
The Windows registry is a central database in Microsoft Windows that stores configuration information and settings for the operating system, installed applications and hardware components.&lt;br /&gt;
&lt;br /&gt;
The manufacturers of virtualisation software also store information for their products here. Malware checks whether known keys exist or whether they contain special strings such as ‘virtual’ or the manufacturer&#039;s name.&lt;br /&gt;
&lt;br /&gt;
Delete the following Key: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From this Key, delete the substring &amp;quot;virtual&amp;quot; from the values: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:registry.png|600px|thumb|center|Windows Activation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Hyper-V EventLogs===&lt;br /&gt;
&lt;br /&gt;
Content in the Windows Hyper-V EventLogs is apparently an indication of a virtual machine.&lt;br /&gt;
&lt;br /&gt;
To delete the loge, open the PowerShell as administrator and execute the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; wevtutil cl &amp;quot;Microsoft-Windows-Kernel-PnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check that the logs are empty with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Users\VMuser&amp;gt; Get-WinEvent -LogName &amp;quot;Microsoft-Windows-KernelPnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to disable further logging use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; Set-ItemProperty -Path &amp;quot;HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Microsoft-Windows-Kernel-PnP\Configuration&amp;quot; -Name &amp;quot;Enabled&amp;quot; -Value 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Activation===&lt;br /&gt;
&lt;br /&gt;
It is likely that your VM does not have a valid Windows product key. Most users, however, have a valid windows installed in order to use it properly.&lt;br /&gt;
&lt;br /&gt;
Instead of buying a key, for this purpose a windows activation script can be used. In this guide, [https://github.com/massgravel/Microsoft-Activation-Scripts/ this] one from GitHub is used.&lt;br /&gt;
&lt;br /&gt;
Again open the PowerShell and enter this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
irm https://get.activated.win | iex&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tool is easy to use and afterwards the VM´s Windows should be activated.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_activation.png|600px|thumb|center|Windows Activation]]&lt;br /&gt;
&lt;br /&gt;
===Other Changes===&lt;br /&gt;
&lt;br /&gt;
Some checks can be fended off without really having to change anything on the system.&lt;br /&gt;
&lt;br /&gt;
This includes, for example, how to start the tools. One tool checks whether Windows Explorer is its parent process.&lt;br /&gt;
&lt;br /&gt;
Another check looks at the system uptime, i.e. how how long the system has been running. If you do not have the option to manipulate the system time, it is sufficient to let the machine run a little beforehand.&lt;br /&gt;
&lt;br /&gt;
The screen dimensions are also checked, as the VM window can be resized as required. If the dimensions are too small, it is clear that it is a VM, as there are only certain options for physical screens. E.g. a very small screen window or one that is taller than it is wide is very unlikely on a typical end user device.&lt;br /&gt;
&lt;br /&gt;
== Test Run in modified VM ==&lt;br /&gt;
&lt;br /&gt;
After implementing the descirbed hardening measures the number of positive detections drops from &#039;&#039;&#039;57&#039;&#039;&#039; to &#039;&#039;&#039;41&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If the mouse is moved and clicked and keyboard inputs are entered during the execution of the tools, the number even drops to &#039;&#039;&#039;32&#039;&#039;&#039;. This is because of the Reverse-Turing-Tests(RTTs) of the tools. These test focus on detecting human interaction with the system, normally by mouse or keyboard.&lt;br /&gt;
These tests can only be counterd by simulating human interaction, which is a complex task. In a typical analysis VM there is no human that is actually operating the system. For this example, it is suffencient if you are manually using mouse and keyboard.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
There is a wide range of possible VM detection methods. The most widespread include simply checking static system information. However, new techniques are on the rise that exploit other vulnerabilities. Monitoring system components and observing human interaction with RTTs are powerful methods and also hard to counter.&lt;br /&gt;
Malware researchers have to constantly keep up with new detection and evasion methods in order to keep their analysis systems tranpartent. It is essential that malware can be analyzed at runtime in order to keep up with increased cybercrime.&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Registry.png&amp;diff=17862</id>
		<title>File:Registry.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Registry.png&amp;diff=17862"/>
		<updated>2025-01-20T16:29:12Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:VM_specs.png&amp;diff=17861</id>
		<title>File:VM specs.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:VM_specs.png&amp;diff=17861"/>
		<updated>2025-01-20T16:27:02Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17860</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17860"/>
		<updated>2025-01-20T16:22:12Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machin(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and a number of open-source VM-detection tools is executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Hyper-V is used for the virtualization. This is because it is a Type 1, bare-metal, Hypervisor, which runs directly on the host&#039;s hardware to control the hardware and to manage guest operating systems.&lt;br /&gt;
&lt;br /&gt;
Further specifications are:&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/a0rtega/pafish Pafish (Paranoid Fish)]&lt;br /&gt;
* [https://github.com/kernelwernel/VMAware VMAware]&lt;br /&gt;
* [https://github.com/ayoubfaouzi/al-khaser Al-Khaser]&lt;br /&gt;
&lt;br /&gt;
===Initial Test Run===&lt;br /&gt;
&lt;br /&gt;
After the virtual machine setup is complete and all the tools have been installed, a first test can be conducted.&lt;br /&gt;
&lt;br /&gt;
In the unmodified, native machine the tools show a number of positive checks, that hint towards a VM:&lt;br /&gt;
&lt;br /&gt;
Pafish 13 + VMAware 13 + Al-Khaser 31 = &#039;&#039;&#039;57 positive detections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These numbers are likely to vary between different setups and tool versions.&lt;br /&gt;
&lt;br /&gt;
== Hardening Steps ==&lt;br /&gt;
&lt;br /&gt;
This section contains some system modifications that lower the number of positive detections.&lt;br /&gt;
&lt;br /&gt;
===Virtual Hardware Specifications===&lt;br /&gt;
&lt;br /&gt;
Common checks aim at the system hardware. If the disk, memory or processor contain strange values, which typcially cannot be found on normal machines, the malware might see this as a sign of a VM.&lt;br /&gt;
&lt;br /&gt;
Very low or odd numbers are highly unlikey in a physical machine. Therefore, see that the VM has at least the following requirements:&lt;br /&gt;
&lt;br /&gt;
* 60-80 GB disk size&lt;br /&gt;
* 4-8 GB memory size and no odd numbers&lt;br /&gt;
* At least 4 processor cores and no odd numbers&lt;br /&gt;
&lt;br /&gt;
With Hyper-V, these values can be configured in the machine settings:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Registry===&lt;br /&gt;
&lt;br /&gt;
The Windows registry is a central database in Microsoft Windows that stores configuration information and settings for the operating system, installed applications and hardware components.&lt;br /&gt;
&lt;br /&gt;
The manufacturers of virtualisation software also store information for their products here. Malware checks whether known keys exist or whether they contain special strings such as ‘virtual’ or the manufacturer&#039;s name.&lt;br /&gt;
&lt;br /&gt;
Delete the following Key: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From this Key, delete the substring &amp;quot;virtual&amp;quot; from the values: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Hyper-V EventLogs===&lt;br /&gt;
&lt;br /&gt;
Content in the Windows Hyper-V EventLogs is apparently an indication of a virtual machine.&lt;br /&gt;
&lt;br /&gt;
To delete the loge, open the PowerShell as administrator and execute the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; wevtutil cl &amp;quot;Microsoft-Windows-Kernel-PnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check that the logs are empty with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Users\VMuser&amp;gt; Get-WinEvent -LogName &amp;quot;Microsoft-Windows-KernelPnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to disable further logging use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; Set-ItemProperty -Path &amp;quot;HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Microsoft-Windows-Kernel-PnP\Configuration&amp;quot; -Name &amp;quot;Enabled&amp;quot; -Value 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Activation===&lt;br /&gt;
&lt;br /&gt;
It is likely that your VM does not have a valid Windows product key. Most users, however, have a valid windows installed in order to use it properly.&lt;br /&gt;
&lt;br /&gt;
Instead of buying a key, for this purpose a windows activation script can be used. In this guide, [https://github.com/massgravel/Microsoft-Activation-Scripts/ this] one from GitHub is used.&lt;br /&gt;
&lt;br /&gt;
Again open the PowerShell and enter this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
irm https://get.activated.win | iex&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tool is easy to use and afterwards the VM´s Windows should be activated.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_activation.png|600px|left|thumb|Windows Activation]]&lt;br /&gt;
&lt;br /&gt;
===Other Changes===&lt;br /&gt;
&lt;br /&gt;
Some checks can be fended off without really having to change anything on the system.&lt;br /&gt;
&lt;br /&gt;
This includes, for example, how to start the tools. One tool checks whether Windows Explorer is its parent process.&lt;br /&gt;
&lt;br /&gt;
Another check looks at the system uptime, i.e. how how long the system has been running. If you do not have the option to manipulate the system time, it is sufficient to let the machine run a little beforehand.&lt;br /&gt;
&lt;br /&gt;
The screen dimensions are also checked, as the VM window can be resized as required. If the dimensions are too small, it is clear that it is a VM, as there are only certain options for physical screens. E.g. a very small screen window or one that is taller than it is wide is very unlikely on a typical end user device.&lt;br /&gt;
&lt;br /&gt;
== Test Run in modified VM ==&lt;br /&gt;
&lt;br /&gt;
After implementing the descirbed hardening measures the number of positive detections drops from &#039;&#039;&#039;57&#039;&#039;&#039; to &#039;&#039;&#039;41&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If the mouse is moved and clicked and keyboard inputs are entered during the execution of the tools, the number even drops to &#039;&#039;&#039;32&#039;&#039;&#039;. This is because of the Reverse-Turing-Tests(RTTs) of the tools. These test focus on detecting human interaction with the system, normally by mouse or keyboard.&lt;br /&gt;
These tests can only be counterd by simulating human interaction, which is a complex task. In a typical analysis VM there is no human that is actually operating the system. For this example, it is suffencient if you are manually using mouse and keyboard.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
There is a wide range of possible VM detection methods. The most widespread include simply checking static system information. However, new techniques are on the rise that exploit other vulnerabilities. Monitoring system components and observing human interaction with RTTs are powerful methods and also hard to counter.&lt;br /&gt;
Malware researchers have to constantly keep up with new detection and evasion methods in order to keep their analysis systems tranpartent. It is essential that malware can be analyzed at runtime in order to keep up with increased cybercrime.&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17859</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17859"/>
		<updated>2025-01-20T16:15:40Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machin(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and a number of open-source VM-detection tools is executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Hyper-V is used for the virtualization. This is because it is a Type 1, bare-metal, Hypervisor, which runs directly on the host&#039;s hardware to control the hardware and to manage guest operating systems.&lt;br /&gt;
&lt;br /&gt;
Further specifications are:&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/a0rtega/pafish Pafish (Paranoid Fish)]&lt;br /&gt;
* [https://github.com/kernelwernel/VMAware VMAware]&lt;br /&gt;
* [https://github.com/ayoubfaouzi/al-khaser Al-Khaser]&lt;br /&gt;
&lt;br /&gt;
===Initial Test Run===&lt;br /&gt;
&lt;br /&gt;
After the virtual machine setup is complete and all the tools have been installed, a first test can be conducted.&lt;br /&gt;
&lt;br /&gt;
In the unmodified, native machine the tools show a number of positive checks, that hint towards a VM:&lt;br /&gt;
&lt;br /&gt;
Pafish 13 + VMAware 13 + Al-Khaser 31 = &#039;&#039;&#039;57 positive detections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These numbers are likely to vary between different setups and tool versions.&lt;br /&gt;
&lt;br /&gt;
== Hardening Steps ==&lt;br /&gt;
&lt;br /&gt;
This section contains some system modifications that lower the number of positive detections.&lt;br /&gt;
&lt;br /&gt;
===Virtual Hardware Specifications===&lt;br /&gt;
&lt;br /&gt;
Common checks aim at the system hardware. If the disk, memory or processor contain strange values, which typcially cannot be found on normal machines, the malware might see this as a sign of a VM.&lt;br /&gt;
&lt;br /&gt;
Very low or odd numbers are highly unlikey in a physical machine. Therefore, see that the VM has at least the following requirements:&lt;br /&gt;
&lt;br /&gt;
* 60-80 GB disk size&lt;br /&gt;
* 4-8 GB memory size and no odd numbers&lt;br /&gt;
* At least 4 processor cores and no odd numbers&lt;br /&gt;
&lt;br /&gt;
With Hyper-V, these values can be configured in the machine settings:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Registry===&lt;br /&gt;
&lt;br /&gt;
The Windows registry is a central database in Microsoft Windows that stores configuration information and settings for the operating system, installed applications and hardware components.&lt;br /&gt;
&lt;br /&gt;
The manufacturers of virtualisation software also store information for their products here. Malware checks whether known keys exist or whether they contain special strings such as ‘virtual’ or the manufacturer&#039;s name.&lt;br /&gt;
&lt;br /&gt;
Delete the following Key: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From this Key, delete the substring &amp;quot;virtual&amp;quot; from the values: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Hyper-V EventLogs===&lt;br /&gt;
&lt;br /&gt;
Content in the Windows Hyper-V EventLogs is apparently an indication of a virtual machine.&lt;br /&gt;
&lt;br /&gt;
To delete the loge, open the PowerShell as administrator and execute the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; wevtutil cl &amp;quot;Microsoft-Windows-Kernel-PnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check that the logs are empty with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Users\VMuser&amp;gt; Get-WinEvent -LogName &amp;quot;Microsoft-Windows-KernelPnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to disable further logging use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; Set-ItemProperty -Path &amp;quot;HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Microsoft-Windows-Kernel-PnP\Configuration&amp;quot; -Name &amp;quot;Enabled&amp;quot; -Value 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Activation===&lt;br /&gt;
&lt;br /&gt;
It is likely that your VM does not have a valid Windows product key. Most users, however, have a valid windows installed in order to use it properly.&lt;br /&gt;
&lt;br /&gt;
Instead of buying a key, for this purpose a windows activation script can be used. In this guide, [https://github.com/massgravel/Microsoft-Activation-Scripts/ this] one from GitHub is used.&lt;br /&gt;
&lt;br /&gt;
Again open the PowerShell and enter this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
irm https://get.activated.win | iex&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tool is easy to use and afterwards the VM´s Windows should be activated.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_activation.png|600px|left|thumb|Windows Activation]]&lt;br /&gt;
&lt;br /&gt;
===Other Changes===&lt;br /&gt;
&lt;br /&gt;
Some checks can be fended off without really having to change anything on the system.&lt;br /&gt;
&lt;br /&gt;
This includes, for example, how to start the tools. One tool checks whether Windows Explorer is its parent process.&lt;br /&gt;
&lt;br /&gt;
Another check looks at the system uptime, i.e. how how long the system has been running. If you do not have the option to manipulate the system time, it is sufficient to let the machine run a little beforehand.&lt;br /&gt;
&lt;br /&gt;
The screen dimensions are also checked, as the VM window can be resized as required. If the dimensions are too small, it is clear that it is a VM, as there are only certain options for physical screens. E.g. a very small screen window or one that is taller than it is wide is very unlikely on a typical end user device.&lt;br /&gt;
&lt;br /&gt;
== Test Run in modified VM ==&lt;br /&gt;
&lt;br /&gt;
After implementing the descirbed hardening measures the number of positive detections drops from &#039;&#039;&#039;57&#039;&#039;&#039; to &#039;&#039;&#039;41&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If the mouse is moved and clicked and keyboard inputs are entered during the execution of the tools, the number even drops to &#039;&#039;&#039;32&#039;&#039;&#039;. This is because of the Reverse-Turing-Tests of the tools. These test focus on detecting human interaction with the system, normally by mouse or keyboard.&lt;br /&gt;
These tests can only be counterd by simulating human interaction, which is a complex task. In a typical analysis VM there is no human that is actually operating the system. For this example, it is suffencient if you are manually using mouse and keyboard.&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17858</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17858"/>
		<updated>2025-01-20T16:08:15Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machin(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and a number of open-source VM-detection tools is executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Hyper-V is used for the virtualization. This is because it is a Type 1, bare-metal, Hypervisor, which runs directly on the host&#039;s hardware to control the hardware and to manage guest operating systems.&lt;br /&gt;
&lt;br /&gt;
Further specifications are:&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/a0rtega/pafish Pafish (Paranoid Fish)]&lt;br /&gt;
* [https://github.com/kernelwernel/VMAware VMAware]&lt;br /&gt;
* [https://github.com/ayoubfaouzi/al-khaser Al-Khaser]&lt;br /&gt;
&lt;br /&gt;
===Initial Test Run===&lt;br /&gt;
&lt;br /&gt;
After the virtual machine setup is complete and all the tools have been installed, a first test can be conducted.&lt;br /&gt;
&lt;br /&gt;
In the unmodified, native machine the tools show a number of positive checks, that hint towards a VM:&lt;br /&gt;
&lt;br /&gt;
Pafish 13 + VMAware 13 + Al-Khaser 31 = &#039;&#039;&#039;57 positive detections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These numbers are likely to vary between different setups and tool versions.&lt;br /&gt;
&lt;br /&gt;
== Hardening Steps ==&lt;br /&gt;
&lt;br /&gt;
This section contains some system modifications that lower the number of positive detections.&lt;br /&gt;
&lt;br /&gt;
===Virtual Hardware Specifications===&lt;br /&gt;
&lt;br /&gt;
Common checks aim at the system hardware. If the disk, memory or processor contain strange values, which typcially cannot be found on normal machines, the malware might see this as a sign of a VM.&lt;br /&gt;
&lt;br /&gt;
Very low or odd numbers are highly unlikey in a physical machine. Therefore, see that the VM has at least the following requirements:&lt;br /&gt;
&lt;br /&gt;
* 60-80 GB disk size&lt;br /&gt;
* 4-8 GB memory size and no odd numbers&lt;br /&gt;
* At least 4 processor cores and no odd numbers&lt;br /&gt;
&lt;br /&gt;
With Hyper-V, these values can be configured in the machine settings:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Registry===&lt;br /&gt;
&lt;br /&gt;
The Windows registry is a central database in Microsoft Windows that stores configuration information and settings for the operating system, installed applications and hardware components.&lt;br /&gt;
&lt;br /&gt;
The manufacturers of virtualisation software also store information for their products here. Malware checks whether known keys exist or whether they contain special strings such as ‘virtual’ or the manufacturer&#039;s name.&lt;br /&gt;
&lt;br /&gt;
Delete the following Key: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From this Key, delete the substring &amp;quot;virtual&amp;quot; from the values: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Hyper-V EventLogs===&lt;br /&gt;
&lt;br /&gt;
Content in the Windows Hyper-V EventLogs is apparently an indication of a virtual machine.&lt;br /&gt;
&lt;br /&gt;
To delete the loge, open the PowerShell as administrator and execute the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; wevtutil cl &amp;quot;Microsoft-Windows-Kernel-PnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check that the logs are empty with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Users\VMuser&amp;gt; Get-WinEvent -LogName &amp;quot;Microsoft-Windows-KernelPnP/Configuration&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to disable further logging use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
PS C:\Windows\system32&amp;gt; Set-ItemProperty -Path &amp;quot;HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Microsoft-Windows-Kernel-PnP\Configuration&amp;quot; -Name &amp;quot;Enabled&amp;quot; -Value 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Activation===&lt;br /&gt;
&lt;br /&gt;
It is likely that your VM does not have a valid Windows product key. Most users, however, have a valid windows installed in order to use it properly.&lt;br /&gt;
&lt;br /&gt;
Instead of buying a key, for this purpose a windows activation script can be used. In this guide, [https://github.com/massgravel/Microsoft-Activation-Scripts/ this] one from GitHub is used.&lt;br /&gt;
&lt;br /&gt;
Again open the PowerShell and enter this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
irm https://get.activated.win | iex&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tool is easy to use and afterwards the VM´s Windows should be activated.&lt;br /&gt;
&lt;br /&gt;
[[File:Windows_activation.png|600px|left|thumb|Windows Activation]]&lt;br /&gt;
&lt;br /&gt;
===Other Changes===&lt;br /&gt;
&lt;br /&gt;
Some checks can be fended off without really having to change anything on the system.&lt;br /&gt;
&lt;br /&gt;
This includes, for example, how to start the tools. One tool checks whether Windows Explorer is its parent process.&lt;br /&gt;
&lt;br /&gt;
Another check looks at the system uptime, i.e. how how long the system has been running. If you do not have the option to manipulate the system time, it is sufficient to let the machine run a little beforehand.&lt;br /&gt;
&lt;br /&gt;
The screen dimensions are also checked, as the VM window can be resized as required. If the dimensions are too small, it is clear that it is a VM, as there are only certain options for physical screens. E.g. a very small screen window or one that is taller than it is wide is very unlikely on a typical end user device.&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Windows_activation.png&amp;diff=17857</id>
		<title>File:Windows activation.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Windows_activation.png&amp;diff=17857"/>
		<updated>2025-01-20T15:45:00Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17856</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17856"/>
		<updated>2025-01-20T15:35:29Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machin(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and a number of open-source VM-detection tools is executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Hyper-V is used for the virtualization. This is because it is a Type 1, bare-metal, Hypervisor, which runs directly on the host&#039;s hardware to control the hardware and to manage guest operating systems.&lt;br /&gt;
&lt;br /&gt;
Further specifications are:&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/a0rtega/pafish Pafish (Paranoid Fish)]&lt;br /&gt;
* [https://github.com/kernelwernel/VMAware VMAware]&lt;br /&gt;
* [https://github.com/ayoubfaouzi/al-khaser Al-Khaser]&lt;br /&gt;
&lt;br /&gt;
===Initial Test Run===&lt;br /&gt;
&lt;br /&gt;
After the virtual machine setup is complete and all the tools have been installed, a first test can be conducted.&lt;br /&gt;
&lt;br /&gt;
In the unmodified, native machine the tools show a number of positive checks, that hint towards a VM:&lt;br /&gt;
&lt;br /&gt;
Pafish 13 + VMAware 13 + Al-Khaser 31 = &#039;&#039;&#039;57 positive detections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These numbers are likely to vary between different setups and tool versions.&lt;br /&gt;
&lt;br /&gt;
== Hardening Steps ==&lt;br /&gt;
&lt;br /&gt;
This section contains some system modifications that lower the number of positive detections.&lt;br /&gt;
&lt;br /&gt;
===Virtual Hardware Specifications===&lt;br /&gt;
&lt;br /&gt;
Common checks aim at the system hardware. If the disk, memory or processor contain strange values, which typcially cannot be found on normal machines, the malware might see this as a sign of a VM.&lt;br /&gt;
&lt;br /&gt;
Very low or odd numbers are highly unlikey in a physical machine. Therefore, see that the VM has at least the following requirements:&lt;br /&gt;
&lt;br /&gt;
* 60-80 GB disk size&lt;br /&gt;
* 4-8 GB memory size and no odd numbers&lt;br /&gt;
* At least 4 processor cores and no odd numbers&lt;br /&gt;
&lt;br /&gt;
With Hyper-V, these values can be configured in the machine settings:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Windows Registry===&lt;br /&gt;
&lt;br /&gt;
The Windows registry is a central database in Microsoft Windows that stores configuration information and settings for the operating system, installed applications and hardware components.&lt;br /&gt;
&lt;br /&gt;
The manufacturers of virtualisation software also store information for their products here. products. Malware checks whether known keys exist or whether they contain special strings such as ‘virtual’ or the manufacturer&#039;s name.&lt;br /&gt;
&lt;br /&gt;
Delete the following Key: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From this Key, delete the substring &amp;quot;virtual&amp;quot; from the values: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17855</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17855"/>
		<updated>2025-01-20T15:35:07Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machin(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and a number of open-source VM-detection tools is executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Hyper-V is used for the virtualization. This is because it is a Type 1, bare-metal, Hypervisor, which runs directly on the host&#039;s hardware to control the hardware and to manage guest operating systems.&lt;br /&gt;
&lt;br /&gt;
Further specifications are:&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/a0rtega/pafish Pafish (Paranoid Fish)]&lt;br /&gt;
* [https://github.com/kernelwernel/VMAware VMAware]&lt;br /&gt;
* [https://github.com/ayoubfaouzi/al-khaser Al-Khaser]&lt;br /&gt;
&lt;br /&gt;
===Initial Test Run===&lt;br /&gt;
&lt;br /&gt;
After the virtual machine setup is complete and all the tools have been installed, a first test can be conducted.&lt;br /&gt;
&lt;br /&gt;
In the unmodified, native machine the tools show a number of positive checks, that hint towards a VM:&lt;br /&gt;
&lt;br /&gt;
Pafish 13 + VMAware 13 + Al-Khaser 31 = &#039;&#039;&#039;57 positive detections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These numbers are likely to vary between different setups and tool versions.&lt;br /&gt;
&lt;br /&gt;
== Hardening Steps ==&lt;br /&gt;
&lt;br /&gt;
This section contains some system modifications that lower the number of positive detections.&lt;br /&gt;
&lt;br /&gt;
===Virtual Hardware Specifications===&lt;br /&gt;
&lt;br /&gt;
Common checks aim at the system hardware. If the disk, memory or processor contain strange values, which typcially cannot be found on normal machines, the malware might see this as a sign of a VM.&lt;br /&gt;
&lt;br /&gt;
Very low or odd numbers are highly unlikey in a physical machine. Therefore, see that the VM has at least the following requirements:&lt;br /&gt;
&lt;br /&gt;
* 60-80 GB disk size&lt;br /&gt;
* 4-8 GB memory size and no odd numbers&lt;br /&gt;
* At least 4 processor cores and no odd numbers&lt;br /&gt;
&lt;br /&gt;
With Hyper-V, these values can be configured in the machine settings:&lt;br /&gt;
&lt;br /&gt;
[[File:VM_specifications.png|600px|left|thumb|VirtualBox Kali VM]]&lt;br /&gt;
&lt;br /&gt;
===Windows Registry===&lt;br /&gt;
&lt;br /&gt;
The Windows registry is a central database in Microsoft Windows that stores configuration information and settings for the operating system, installed applications and hardware components.&lt;br /&gt;
&lt;br /&gt;
The manufacturers of virtualisation software also store information for their products here. products. Malware checks whether known keys exist or whether they contain special strings such as ‘virtual’ or the manufacturer&#039;s name.&lt;br /&gt;
&lt;br /&gt;
Delete the following Key: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From this Key, delete the substring &amp;quot;virtual&amp;quot; from the values: &#039;&#039;&#039;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\Enum&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:VM_specifications.png&amp;diff=17854</id>
		<title>File:VM specifications.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:VM_specifications.png&amp;diff=17854"/>
		<updated>2025-01-20T15:24:45Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17853</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17853"/>
		<updated>2025-01-20T15:21:32Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machin(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and a number of open-source VM-detection tools is executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Hyper-V is used for the virtualization. This is because it is a Type 1, bare-metal, Hypervisor, which runs directly on the host&#039;s hardware to control the hardware and to manage guest operating systems.&lt;br /&gt;
&lt;br /&gt;
Further specifications are:&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/a0rtega/pafish Pafish (Paranoid Fish)]&lt;br /&gt;
* [https://github.com/kernelwernel/VMAware VMAware]&lt;br /&gt;
* [https://github.com/ayoubfaouzi/al-khaser Al-Khaser]&lt;br /&gt;
&lt;br /&gt;
===Initial Test Run===&lt;br /&gt;
&lt;br /&gt;
After the virtual machine setup is complete and all the tools have been installed, a first test can be conducted.&lt;br /&gt;
&lt;br /&gt;
In the unmodified, native machine the tools show a number of positive checks, that hint towards a VM:&lt;br /&gt;
&lt;br /&gt;
Pafish 13 + VMAware 13 + Al-Khaser 31 = &#039;&#039;&#039;57 positive detections&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These numbers are likely to vary between different setups and tool versions.&lt;br /&gt;
&lt;br /&gt;
== Hardening Steps ==&lt;br /&gt;
&lt;br /&gt;
This section contains some system modifications that lower the number of positive detections.&lt;br /&gt;
&lt;br /&gt;
===Virtual Hardware Specifications===&lt;br /&gt;
&lt;br /&gt;
Common checks aim at the system hardware. If the disk, memory or processor contain strange values, which typcially cannot be found on normal machines, the malware might see this as a sign of a VM.&lt;br /&gt;
&lt;br /&gt;
Very low or odd numbers are highly unlikey in a physical machine. Therefore, see that the VM has at least the following requirements:&lt;br /&gt;
&lt;br /&gt;
* 60-80 GB disk size&lt;br /&gt;
* 4-8 GB memory size and no odd numbers&lt;br /&gt;
* At least 4 processor cores and no odd numbers&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17852</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17852"/>
		<updated>2025-01-20T15:02:12Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machin(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and a number of open-source VM-detection tools is executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Hyper-V is used for the virtualization. This is because it is a Type 1, bare-metal, Hypervisor, which runs directly on the host&#039;s hardware to control the hardware and to manage guest operating systems.&lt;br /&gt;
&lt;br /&gt;
Further specifications are:&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/a0rtega/pafish Pafish (Paranoid Fish)]&lt;br /&gt;
* [https://github.com/kernelwernel/VMAware VMAware]&lt;br /&gt;
* [https://github.com/ayoubfaouzi/al-khaser Al-Khaser]&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17851</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17851"/>
		<updated>2025-01-20T15:01:23Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machin(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and a number of open-source VM-detection tools is executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Hyper-V is used for the virtualization. This is because it is a Type 1, bare-metal, Hypervisor, which runs directly on the host&#039;s hardware to control the hardware and to manage guest operating systems.&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/a0rtega/pafish Pafish (Paranoid Fish)]&lt;br /&gt;
* [https://github.com/kernelwernel/VMAware VMAware]&lt;br /&gt;
* [https://github.com/ayoubfaouzi/al-khaser Al-Khaser]&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17850</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17850"/>
		<updated>2025-01-20T14:58:12Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machin(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and a number of open-source VM-detection tools is executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
* Host OS: Windows 11&lt;br /&gt;
* Hypervisor: Microsoft Hyper-V&lt;br /&gt;
* Guest OS (VM OS): Windows 10&lt;br /&gt;
&lt;br /&gt;
Three tools are used for the VM detection. They are all open-source and can be found on GitHub:&lt;br /&gt;
&lt;br /&gt;
* Pafish (Paranoid Fish)&lt;br /&gt;
* VMAware&lt;br /&gt;
* Al-Khaser&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17849</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17849"/>
		<updated>2025-01-20T14:55:20Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machin(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. In this article a virtual machine is set up and a number of open-source VM-detection tools is executed to see how the VM can be detected by malware. Afterwards countermeasures are implemented to mitigate the detection rate of the tools.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17848</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17848"/>
		<updated>2025-01-20T14:50:41Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machin(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machines to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. &lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17847</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17847"/>
		<updated>2025-01-20T14:50:32Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machin(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machine to execute malware in a safe and isolated environment in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. &lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17846</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17846"/>
		<updated>2025-01-20T14:49:25Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machin(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machine to execute malware samples in order to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. &lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17845</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17845"/>
		<updated>2025-01-20T14:48:27Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article shows how a virtual machin(VM) can be modified to evade detection from malware. This process is also called VM hardening. In dynamic malware analysis, researchers use virtual machine to execute malware samples to monitor and investigate its behavior. This is why malware author started to use Anit-VM techniques to detect if their programs are running inside a virtual environment and subsequently evade the analysis process. &lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17844</id>
		<title>Hyper-V Virtual Machine Hardening</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Hyper-V_Virtual_Machine_Hardening&amp;diff=17844"/>
		<updated>2025-01-20T14:40:44Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: Created page with &amp;quot;This article  == Setup ==&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=The_Trans2open_Vulnerability&amp;diff=17476</id>
		<title>The Trans2open Vulnerability</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=The_Trans2open_Vulnerability&amp;diff=17476"/>
		<updated>2024-12-18T16:46:11Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The trans2open vulnerability, sometimes also referred to as ”trans2 vulnerability”, is a weakness that can be found in Samba versions 2.2.0 to 2.2.8. It was disclosed in 2003, at which time the Samba Port 139 was one of the most attacked ports worldwide. The vulnerability consists in a buffer overflow (BOF) that can be exploited remotely. Basically, this overflow provides an adversary with lots of attacking options. For once, it can be used to execute arbitrary code on the affected system and even open a reverse-shell with root privileges. Another exploitation includes implanting a backdoor. The trans2open vulnerability poses an extreme danger to any system that employs an effected Samba version and should be removed immediately.&lt;br /&gt;
&lt;br /&gt;
Related CVEs include [https://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2003-0196 CVE-2003-0196], [https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2003-0201 CVE-2003-0201] and [https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2003-0345 CVE-2003-0345].&lt;br /&gt;
&lt;br /&gt;
== Samba ==&lt;br /&gt;
&lt;br /&gt;
Samba is an open-source, cross-platform software that facilitates file and printer sharing across different operating systems within a network. Primarily, it enables seamless file sharing between Windows and Linux/Unix systems. With Samba, a Linux file server can function within a Windows network, allowing users to access directories and files as if they were on a Windows machine. Initially released in 1992, Samba has grown significantly in popularity over the years. According to its official website, it is recognized as the standard suite of programs for Windows interoperability on Linux and Unix systems.&lt;br /&gt;
&lt;br /&gt;
== SMB ==&lt;br /&gt;
&lt;br /&gt;
Samba implements the Server Message Block (SMB) protocol, which is a network protocol designed for sharing files, printers, and serial ports between nodes on a network. It operates over TCP/IP. Originally developed by IBM in 1983, SMB was later adapted by Microsoft in 1996 into the Common Internet File System (CIFS). While CIFS is sometimes used interchangeably with SMB, it only encompasses the features of SMB 1.0 and is largely outdated today. SMB has evolved over the years, with several versions, including SMB1, SMB2, and SMB3, each introducing improvements in performance, security, and functionality. Modern versions of SMB support interprocess communication and authentication methods such as Kerberos and NTLM (NT LAN Manager). Both Samba and SMB are widely used for communication and resource sharing across various IT systems.&lt;br /&gt;
&lt;br /&gt;
== Exploitation ==&lt;br /&gt;
&lt;br /&gt;
The vulnerability can be exploited in many different ways. However, they all rely on the remote command execution that is enabled through the buffer overflow.&lt;br /&gt;
&lt;br /&gt;
A client-supplied string is copied into a fixed-size buffer. However, this is done without comparing the size of the buffer to the length of the string beforehand. The buffer is allocated on the stack during a function call. Therefore, the overflow can easily overwrite the copy of the instruction pointer that is saved on the stack.&lt;br /&gt;
&lt;br /&gt;
===Metasploit===&lt;br /&gt;
&lt;br /&gt;
The metasploit framework offers modules that target the vulnerability. One module is specifically designed to determine the version of Samba running on a specific port. It can be found in scanner/smb/smb_version.&lt;br /&gt;
&lt;br /&gt;
For exploitation metasploit offers the following modules:&lt;br /&gt;
&lt;br /&gt;
* exploit/freebsd/samba/trans2open&lt;br /&gt;
* exploit/linux/samba/trans2open&lt;br /&gt;
* exploit/osx/samba/trans2open&lt;br /&gt;
* exploit/solaris/samba/trans2open&lt;br /&gt;
&lt;br /&gt;
Most of them open a TCP shell back to the attacker.&lt;br /&gt;
&lt;br /&gt;
A lot of other exploits can be found on the internet. Many of them seem to have roots going back trans2root.pl and sambal.c, which where one of the first exploits.&lt;br /&gt;
&lt;br /&gt;
== Prevention ==&lt;br /&gt;
&lt;br /&gt;
The best defensive action is to remove the vulnerability before it can be exploited. The following nmap command be used to scan for servers running Samba:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
nmap -sT -p 137,139,445 -O TARGET_IP&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a vulnerable Samba version is running on a server, the following countermeasures can be taken:&lt;br /&gt;
&lt;br /&gt;
* Upgrade the software to higher safe version (2.2.9 or 3.X.X). This is the best solution.&lt;br /&gt;
* Block external access to TCP port 139 (and 445) from any network firewalls.&lt;br /&gt;
* &amp;quot;Misconfigure&amp;quot; Samba so that anonymous access does not work. At lot of exploits rely on this feature. Do this by setting the guest account user to a non-existent name in the smb.conf file.&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://www.giac.org/paper/gcih/484/exploiting-sambas-smbtrans2-vulnerability/105385&lt;br /&gt;
* https://www.samba.org/samba/history/samba-2.2.9.html&lt;br /&gt;
* https://seclists.org/bugtraq/2003/Apr/103&lt;br /&gt;
* https://www.rapid7.com/db/modules/exploit/linux/samba/trans2open/&lt;br /&gt;
* https://www.exploit-db.com/exploits/22468&lt;br /&gt;
* https://nvd.nist.gov/vuln/detail/CVE-2003-0201&lt;br /&gt;
* https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2003-0201&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=The_Trans2open_Vulnerability&amp;diff=17418</id>
		<title>The Trans2open Vulnerability</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=The_Trans2open_Vulnerability&amp;diff=17418"/>
		<updated>2024-12-18T15:58:01Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The trans2open vulnerability, sometimes also referred to as ”trans2 vulnerability”, is a weakness that can be found in Samba versions 2.2.0 to 2.2.8. It was disclosed in 2003, at which time the Samba Port 139 was one of the most attacked ports worldwide. The vulnerability consists in a buffer overflow (BOF) that can be exploited remotely. Basically, this overflow provides an adversary with lots of attacking options. For once, it can be used to execute arbitrary code on the affected system and even open a reverse-shell with root privileges. Another exploitation includes implanting a backdoor. The trans2open vulnerability poses an extreme danger to any system that employs an effected Samba version and should be removed immediately.&lt;br /&gt;
&lt;br /&gt;
Related CVEs include [https://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2003-0196 CVE-2003-0196], [https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2003-0201 CVE-2003-0201] and [https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2003-0345 CVE-2003-0345].&lt;br /&gt;
&lt;br /&gt;
== Samba ==&lt;br /&gt;
&lt;br /&gt;
Samba is an open-source, cross-platform software that facilitates file and printer sharing across different operating systems within a network. Primarily, it enables seamless file sharing between Windows and Linux/Unix systems. With Samba, a Linux file server can function within a Windows network, allowing users to access directories and files as if they were on a Windows machine. Initially released in 1992, Samba has grown significantly in popularity over the years. According to its official website, it is recognized as the standard suite of programs for Windows interoperability on Linux and Unix systems.&lt;br /&gt;
&lt;br /&gt;
== SMB ==&lt;br /&gt;
&lt;br /&gt;
Samba implements the Server Message Block (SMB) protocol, which is a network protocol designed for sharing files, printers, and serial ports between nodes on a network. It operates over TCP/IP. Originally developed by IBM in 1983, SMB was later adapted by Microsoft in 1996 into the Common Internet File System (CIFS). While CIFS is sometimes used interchangeably with SMB, it only encompasses the features of SMB 1.0 and is largely outdated today. SMB has evolved over the years, with several versions, including SMB1, SMB2, and SMB3, each introducing improvements in performance, security, and functionality. Modern versions of SMB support interprocess communication and authentication methods such as Kerberos and NTLM (NT LAN Manager). Both Samba and SMB are widely used for communication and resource sharing across various IT systems.&lt;br /&gt;
&lt;br /&gt;
== Exploitation ==&lt;br /&gt;
&lt;br /&gt;
The vulnerability can be exploited in many different ways. However, they all rely on the remote command execution that is enabled through the buffer overflow.&lt;br /&gt;
&lt;br /&gt;
A client-supplied string is copied into a fixed-size buffer. However, this is done without comparing the size of the buffer to the length of the string beforehand. The buffer is allocated on the stack during a function call. Therefore, the overflow can easily overwrite the copy of the instruction pointer that is saved on the stack.&lt;br /&gt;
&lt;br /&gt;
===Metasploit===&lt;br /&gt;
&lt;br /&gt;
The metasploit framework offers modules that target the vulnerability. One module is specifically designed to determine the version of Samba running on a specific port. It can be found in scanner/smb/smb_version.&lt;br /&gt;
&lt;br /&gt;
For exploitation metasploit offers the following modules:&lt;br /&gt;
&lt;br /&gt;
* exploit/freebsd/samba/trans2open&lt;br /&gt;
* exploit/linux/samba/trans2open&lt;br /&gt;
* exploit/osx/samba/trans2open&lt;br /&gt;
* exploit/solaris/samba/trans2open&lt;br /&gt;
&lt;br /&gt;
Most of them open a TCP shell back to the attacker.&lt;br /&gt;
&lt;br /&gt;
A lot of other exploits can be found on the internet. Many of them seem to have roots going back trans2root.pl and sambal.c, which where one of the first exploits.&lt;br /&gt;
&lt;br /&gt;
== Prevention ==&lt;br /&gt;
&lt;br /&gt;
The best defensive action is to remove the vulnerability before it can be exploited. The following nmap command be used to scan for servers running Samba:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
nmap -sT -p 137,139,445 -O TARGET_IP&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a vulnerable Samba version is running on a server, the following countermeasures can be taken:&lt;br /&gt;
&lt;br /&gt;
* Upgrade the software to higher safe version (2.2.9 or 3.X.X). This is the best solution.&lt;br /&gt;
* Block external access to TCP port 139 (and 445) from any network firewalls.&lt;br /&gt;
* &amp;quot;Misconfigure&amp;quot; Samba so that anonymous access does not work. At lot of exploits rely on this feature. Do this by setting the guest account user to a non-existent name in the smb.conf file.&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://www.giac.org/paper/gcih/484/exploiting-sambas-smbtrans2-vulnerability/105385&lt;br /&gt;
* https://www.samba.org/samba/history/samba-2.2.9.html&lt;br /&gt;
* https://www.rapid7.com/db/modules/exploit/linux/samba/trans2open/&lt;br /&gt;
* https://www.exploit-db.com/exploits/22468&lt;br /&gt;
* https://nvd.nist.gov/vuln/detail/CVE-2003-0201&lt;br /&gt;
* https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2003-0201&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=VirtualBox:_How_to_set_up_a_Basic_Pentesting_Lab&amp;diff=17414</id>
		<title>VirtualBox: How to set up a Basic Pentesting Lab</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=VirtualBox:_How_to_set_up_a_Basic_Pentesting_Lab&amp;diff=17414"/>
		<updated>2024-12-18T15:57:27Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Training penetration testing typically occurs in a dedicated environment known as a pentesting lab, which is isolated from regular user applications and operating systems for security and convenience reasons. A pentesting lab can vary in complexity, with a minimalist setup involving a single computer running multiple virtual machines (VMs), often referred to as a virtual or basic pentesting lab. This variant uses virtualization software like VMware or VirtualBox to create an attacker VM with a specialized OS, such as Kali, Parrot or Arch, and allows for the addition of target machines. These machines are then consolidated in a virtual network. Users can log into the attacker machine to begin testing. More advanced labs may incorporate real hardware, such as real computers, routers, and firewalls, but this increases costs and electricity usage. However, these sophisticated environments enable more realistic scenarios and complex tasks.&lt;br /&gt;
&lt;br /&gt;
This page explains how a basic pentesting lab that can be set up with VirtualBox. This environment will suffice for most people who want to try out or train pentesting and hacking at home. The system will consist of a base machine at performs the actual operations (the attacker machine) and arbitrary target machines, the user can add and remove at will.&lt;br /&gt;
&lt;br /&gt;
The software used in this tutorial:&lt;br /&gt;
&lt;br /&gt;
* Windows 10 or 11 (as the Host OS)&lt;br /&gt;
* [https://www.virtualbox.org/wiki/Downloads VirtualBox]&lt;br /&gt;
* [https://www.kali.org/get-kali/#kali-virtual-machines Kali Linux]&lt;br /&gt;
&lt;br /&gt;
== Setup Steps ==&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
Download and install VirutalBox on your Windows machine. There is no need to manually configure anything in this installation process, you can just leave everything at default.&lt;br /&gt;
&lt;br /&gt;
On the Kali Linux download-page, make sure you go to &amp;quot;Pre-built Virtual Machines&amp;quot; and select the VirtualBox option. Using a pre-built image will make the OS setup much easier than with traditional ISO-files. This download might take a while.&lt;br /&gt;
&lt;br /&gt;
===Attacker Setup===&lt;br /&gt;
&lt;br /&gt;
Downloading the Kali pre-built VM will get you a .ZIP-folder. Extract it to a directory of your choice. Inside you should find a .VBOX-file. Double-click it and the VM will be automatically imported to the VirtulBox Manager.&lt;br /&gt;
&lt;br /&gt;
This machine can now be used out-of-the-box. The login credentials are &amp;quot;kali&amp;quot; and &amp;quot;kali&amp;quot;. This is OK because, this is just a training environment. The password does not need to be strong or protected.&lt;br /&gt;
&lt;br /&gt;
If the machine automatically boots up when imported, you can shut it down again. Do this by clicking &amp;quot;File&amp;quot; in the top bar of the machine window. Then &amp;quot;Close&amp;quot; and &amp;quot;Power off the machine&amp;quot; -&amp;gt; OK. Alternatively, you can login and shut it down from there normally.&lt;br /&gt;
&lt;br /&gt;
Now you should have the Kali VM in your list, looking something like this:&lt;br /&gt;
&lt;br /&gt;
[[File:VboxKali.png|600px|center|thumb|VirtualBox Kali VM]]&lt;br /&gt;
&lt;br /&gt;
===Network Configuration===&lt;br /&gt;
&lt;br /&gt;
The goal is to create a testing network that is separated from the host OS. The easiest way to do this is by creating a virtual network that only contains the attacker and target machines. This can be achieved by setting up a DHCP-service within VirtualBox, that automatically assigns IP-addresses to the VMs when booted up. &lt;br /&gt;
&lt;br /&gt;
Open the windows command prompt and navigate to the VirtualBox installation directory. By default, this is &#039;&#039;C:\Program Files\Oracle\VirtualBox&#039;&#039;. Now use the vboxmanage tool to create the DHCP server:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
vboxmanage dhcpserver add --network=vnet --server-ip=172.16.0.1 --lower-ip=172.16.0.2 --upper-id=172.16.0.100 --netmask=255.255.255.0 --enable&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also choose other settings for your network, but make sure to use private IP addresses. If you don´t know what values to pick, you can just copy this command.&lt;br /&gt;
&lt;br /&gt;
For every machine you want to add to the pentesting network, go into the settings for the VM and go to Network. Enable one adapter and set it as attached to &#039;&#039;Internal Network&#039;&#039;. Below, enter the same name that was used in the vboxmanage-command (&#039;&#039;vnet&#039;&#039; in this example).&lt;br /&gt;
&lt;br /&gt;
[[File:Vboxnwconf.png|600px|center|thumb|VirtualBox VM network settings]]&lt;br /&gt;
&lt;br /&gt;
At the end, you can start the machine and verify the network configuration. If the machine has an IP from the defined pool, the DHCP service works correctly.&lt;br /&gt;
&lt;br /&gt;
[[File:Kalinwconf.png|400px|center|thumb|VirtualBox VM network settings]]&lt;br /&gt;
&lt;br /&gt;
===Add Target Machines===&lt;br /&gt;
&lt;br /&gt;
Now your virtual pentesting lab is ready. You can add vulnerable target machines that you can hack from your Kali-Base-VM. A great source for such VMs is [https://www.vulnhub.com/ VulnHub.com]. This site offers a vast collection of virtual machines that are intentionally vulnerably. You can legally hack and break them inside your environment.&lt;br /&gt;
&lt;br /&gt;
However, always make sure to &#039;&#039;&#039;add your machine to the testing network&#039;&#039;&#039;, like we did with the attacker machine.&lt;br /&gt;
&lt;br /&gt;
Once a target is added you can use nmap, fping, ping, netdiscover or some other tool to find it on the network. Now you can start hacking and exploring the machine for weaknesses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Optional: Host-to-VM Connection===&lt;br /&gt;
&lt;br /&gt;
With the current network configuration there is no connection between the physical host machine, that is running the VMs, and the attacker machine. Therefore, the attacker also has no internet connection.&lt;br /&gt;
&lt;br /&gt;
This is not necessary for such an environment. But if you want this, you can enable a second adapter in the VM settings and set it to &#039;&#039;NAT&#039;&#039;. This way the VM will have host and internet connectivity. But this goes only in one direction, the host or the internet cannot reach the VM.&lt;br /&gt;
&lt;br /&gt;
If you want the connection to go bidirectional, set the adapter to &#039;&#039;Bridged Adapter&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
[[Category:Pentesting]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://ieeexplore.ieee.org/document/10108187&lt;br /&gt;
* https://ia802202.us.archive.org/9/items/1.-the-pentester-blueprint/1.%20The%20Pentester%20Blueprint.pdf&lt;br /&gt;
* https://www.vulnhub.com/&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=The_Trans2open_Vulnerability&amp;diff=17405</id>
		<title>The Trans2open Vulnerability</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=The_Trans2open_Vulnerability&amp;diff=17405"/>
		<updated>2024-12-18T15:55:24Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The trans2open vulnerability, sometimes also referred to as ”trans2 vulnerability”, is a weakness that can be found in Samba versions 2.2.0 to 2.2.8. It was disclosed in 2003, at which time the Samba Port 139 was one of the most attacked ports worldwide. The vulnerability consists in a buffer overflow (BOF) that can be exploited remotely. Basically, this overflow provides an adversary with lots of attacking options. For once, it can be used to execute arbitrary code on the affected system and even open a reverse-shell with root privileges. Another exploitation includes implanting a backdoor. The trans2open vulnerability poses an extreme danger to any system that employs an effected Samba version and should be removed immediately.&lt;br /&gt;
&lt;br /&gt;
Related CVEs include [https://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2003-0196 CVE-2003-0196], [https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2003-0201 CVE-2003-0201] and [https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2003-0345 CVE-2003-0345].&lt;br /&gt;
&lt;br /&gt;
== Samba ==&lt;br /&gt;
&lt;br /&gt;
Samba is an open-source, cross-platform software that facilitates file and printer sharing across different operating systems within a network. Primarily, it enables seamless file sharing between Windows and Linux/Unix systems. With Samba, a Linux file server can function within a Windows network, allowing users to access directories and files as if they were on a Windows machine. Initially released in 1992, Samba has grown significantly in popularity over the years. According to its official website, it is recognized as the standard suite of programs for Windows interoperability on Linux and Unix systems.&lt;br /&gt;
&lt;br /&gt;
== SMB ==&lt;br /&gt;
&lt;br /&gt;
Samba implements the Server Message Block (SMB) protocol, which is a network protocol designed for sharing files, printers, and serial ports between nodes on a network. It operates over TCP/IP. Originally developed by IBM in 1983, SMB was later adapted by Microsoft in 1996 into the Common Internet File System (CIFS). While CIFS is sometimes used interchangeably with SMB, it only encompasses the features of SMB 1.0 and is largely outdated today. SMB has evolved over the years, with several versions, including SMB1, SMB2, and SMB3, each introducing improvements in performance, security, and functionality. Modern versions of SMB support interprocess communication and authentication methods such as Kerberos and NTLM (NT LAN Manager). Both Samba and SMB are widely used for communication and resource sharing across various IT systems.&lt;br /&gt;
&lt;br /&gt;
== Exploitation ==&lt;br /&gt;
&lt;br /&gt;
The vulnerability can be exploited in many different ways. However, they all rely on the remote command execution that is enabled through the buffer overflow.&lt;br /&gt;
&lt;br /&gt;
A client-supplied string is copied into a fixed-size buffer. However, this is done without comparing the size of the buffer to the length of the string beforehand. The buffer is allocated on the stack during a function call. Therefore, the overflow can easily overwrite the copy of the instruction pointer that is saved on the stack.&lt;br /&gt;
&lt;br /&gt;
===Metasploit===&lt;br /&gt;
&lt;br /&gt;
The metasploit framework offers modules that target the vulnerability. One module is specifically designed to determine the version of Samba running on a specific port. It can be found in scanner/smb/smb_version.&lt;br /&gt;
&lt;br /&gt;
For exploitation metasploit offers the following modules:&lt;br /&gt;
&lt;br /&gt;
* exploit/freebsd/samba/trans2open&lt;br /&gt;
* exploit/linux/samba/trans2open&lt;br /&gt;
* exploit/osx/samba/trans2open&lt;br /&gt;
* exploit/solaris/samba/trans2open&lt;br /&gt;
&lt;br /&gt;
Most of them open a TCP shell back to the attacker.&lt;br /&gt;
&lt;br /&gt;
A lot of other exploits can be found on the internet. Many of them seem to have roots going back trans2root.pl and sambal.c, which where one of the first exploits.&lt;br /&gt;
&lt;br /&gt;
== Prevention ==&lt;br /&gt;
&lt;br /&gt;
The best defensive action is to remove the vulnerability before it can be exploited. The following nmap command be used to scan for servers running Samba:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
nmap -sT -p 137,139,445 -O TARGET_IP&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a vulnerable Samba version is running on a server, the following countermeasures can be taken:&lt;br /&gt;
&lt;br /&gt;
* Upgrade the software to higher safe version (2.2.9 or 3.X.X). This is the best solution.&lt;br /&gt;
* Block external access to TCP port 139 (and 445) from any network firewalls.&lt;br /&gt;
* &amp;quot;Misconfigure&amp;quot; Samba so that anonymous access does not work. At lot of exploits rely on this feature. Do this by setting the guest account user to a non-existent name in the smb.conf file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://www.giac.org/paper/gcih/484/exploiting-sambas-smbtrans2-vulnerability/105385&lt;br /&gt;
* https://www.samba.org/samba/history/samba-2.2.9.html&lt;br /&gt;
* https://www.rapid7.com/db/modules/exploit/linux/samba/trans2open/&lt;br /&gt;
* https://www.exploit-db.com/exploits/22468&lt;br /&gt;
* https://nvd.nist.gov/vuln/detail/CVE-2003-0201&lt;br /&gt;
* https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2003-0201&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=VirtualBox:_How_to_set_up_a_Basic_Pentesting_Lab&amp;diff=17386</id>
		<title>VirtualBox: How to set up a Basic Pentesting Lab</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=VirtualBox:_How_to_set_up_a_Basic_Pentesting_Lab&amp;diff=17386"/>
		<updated>2024-12-18T15:43:33Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Training penetration testing typically occurs in a dedicated environment known as a pentesting lab, which is isolated from regular user applications and operating systems for security and convenience reasons. A pentesting lab can vary in complexity, with a minimalist setup involving a single computer running multiple virtual machines (VMs), often referred to as a virtual or basic pentesting lab. This variant uses virtualization software like VMware or VirtualBox to create an attacker VM with a specialized OS, such as Kali, Parrot or Arch, and allows for the addition of target machines. These machines are then consolidated in a virtual network. Users can log into the attacker machine to begin testing. More advanced labs may incorporate real hardware, such as real computers, routers, and firewalls, but this increases costs and electricity usage. However, these sophisticated environments enable more realistic scenarios and complex tasks.&lt;br /&gt;
&lt;br /&gt;
This page explains how a basic pentesting lab that can be set up with VirtualBox. This environment will suffice for most people who want to try out or train pentesting and hacking at home. The system will consist of a base machine at performs the actual operations (the attacker machine) and arbitrary target machines, the user can add and remove at will.&lt;br /&gt;
&lt;br /&gt;
The software used in this tutorial:&lt;br /&gt;
&lt;br /&gt;
* Windows 10 or 11 (as the Host OS)&lt;br /&gt;
* [https://www.virtualbox.org/wiki/Downloads VirtualBox]&lt;br /&gt;
* [https://www.kali.org/get-kali/#kali-virtual-machines Kali Linux]&lt;br /&gt;
&lt;br /&gt;
== Setup Steps ==&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
Download and install VirutalBox on your Windows machine. There is no need to manually configure anything in this installation process, you can just leave everything at default.&lt;br /&gt;
&lt;br /&gt;
On the Kali Linux download-page, make sure you go to &amp;quot;Pre-built Virtual Machines&amp;quot; and select the VirtualBox option. Using a pre-built image will make the OS setup much easier than with traditional ISO-files. This download might take a while.&lt;br /&gt;
&lt;br /&gt;
===Attacker Setup===&lt;br /&gt;
&lt;br /&gt;
Downloading the Kali pre-built VM will get you a .ZIP-folder. Extract it to a directory of your choice. Inside you should find a .VBOX-file. Double-click it and the VM will be automatically imported to the VirtulBox Manager.&lt;br /&gt;
&lt;br /&gt;
This machine can now be used out-of-the-box. The login credentials are &amp;quot;kali&amp;quot; and &amp;quot;kali&amp;quot;. This is OK because, this is just a training environment. The password does not need to be strong or protected.&lt;br /&gt;
&lt;br /&gt;
If the machine automatically boots up when imported, you can shut it down again. Do this by clicking &amp;quot;File&amp;quot; in the top bar of the machine window. Then &amp;quot;Close&amp;quot; and &amp;quot;Power off the machine&amp;quot; -&amp;gt; OK. Alternatively, you can login and shut it down from there normally.&lt;br /&gt;
&lt;br /&gt;
Now you should have the Kali VM in your list, looking something like this:&lt;br /&gt;
&lt;br /&gt;
[[File:VboxKali.png|600px|center|thumb|VirtualBox Kali VM]]&lt;br /&gt;
&lt;br /&gt;
===Network Configuration===&lt;br /&gt;
&lt;br /&gt;
The goal is to create a testing network that is separated from the host OS. The easiest way to do this is by creating a virtual network that only contains the attacker and target machines. This can be achieved by setting up a DHCP-service within VirtualBox, that automatically assigns IP-addresses to the VMs when booted up. &lt;br /&gt;
&lt;br /&gt;
Open the windows command prompt and navigate to the VirtualBox installation directory. By default, this is &#039;&#039;C:\Program Files\Oracle\VirtualBox&#039;&#039;. Now use the vboxmanage tool to create the DHCP server:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
vboxmanage dhcpserver add --network=vnet --server-ip=172.16.0.1 --lower-ip=172.16.0.2 --upper-id=172.16.0.100 --netmask=255.255.255.0 --enable&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also choose other settings for your network, but make sure to use private IP addresses. If you don´t know what values to pick, you can just copy this command.&lt;br /&gt;
&lt;br /&gt;
For every machine you want to add to the pentesting network, go into the settings for the VM and go to Network. Enable one adapter and set it as attached to &#039;&#039;Internal Network&#039;&#039;. Below, enter the same name that was used in the vboxmanage-command (&#039;&#039;vnet&#039;&#039; in this example).&lt;br /&gt;
&lt;br /&gt;
[[File:Vboxnwconf.png|600px|center|thumb|VirtualBox VM network settings]]&lt;br /&gt;
&lt;br /&gt;
At the end, you can start the machine and verify the network configuration. If the machine has an IP from the defined pool, the DHCP service works correctly.&lt;br /&gt;
&lt;br /&gt;
[[File:Kalinwconf.png|400px|center|thumb|VirtualBox VM network settings]]&lt;br /&gt;
&lt;br /&gt;
===Add Target Machines===&lt;br /&gt;
&lt;br /&gt;
Now your virtual pentesting lab is ready. You can add vulnerable target machines that you can hack from your Kali-Base-VM. A great source for such VMs is [https://www.vulnhub.com/ VulnHub.com]. This site offers a vast collection of virtual machines that are intentionally vulnerably. You can legally hack and break them inside your environment.&lt;br /&gt;
&lt;br /&gt;
However, always make sure to &#039;&#039;&#039;add your machine to the testing network&#039;&#039;&#039;, like we did with the attacker machine.&lt;br /&gt;
&lt;br /&gt;
Once a target is added you can use nmap, fping, ping, netdiscover or some other tool to find it on the network. Now you can start hacking and exploring the machine for weaknesses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Optional: Host-to-VM Connection===&lt;br /&gt;
&lt;br /&gt;
With the current network configuration there is no connection between the physical host machine, that is running the VMs, and the attacker machine. Therefore, the attacker also has no internet connection.&lt;br /&gt;
&lt;br /&gt;
This is not necessary for such an environment. But if you want this, you can enable a second adapter in the VM settings and set it to &#039;&#039;NAT&#039;&#039;. This way the VM will have host and internet connectivity. But this goes only in one direction, the host or the internet cannot reach the VM.&lt;br /&gt;
&lt;br /&gt;
If you want the connection to go bidirectional, set the adapter to &#039;&#039;Bridged Adapter&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://ieeexplore.ieee.org/document/10108187&lt;br /&gt;
* https://ia802202.us.archive.org/9/items/1.-the-pentester-blueprint/1.%20The%20Pentester%20Blueprint.pdf&lt;br /&gt;
* https://www.vulnhub.com/&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=VirtualBox:_How_to_set_up_a_Basic_Pentesting_Lab&amp;diff=17385</id>
		<title>VirtualBox: How to set up a Basic Pentesting Lab</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=VirtualBox:_How_to_set_up_a_Basic_Pentesting_Lab&amp;diff=17385"/>
		<updated>2024-12-18T15:37:48Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Training penetration testing typically occurs in a dedicated environment known as a pentesting lab, which is isolated from regular user applications and operating systems for security and convenience reasons. A pentesting lab can vary in complexity, with a minimalist setup involving a single computer running multiple virtual machines (VMs), often referred to as a virtual or basic pentesting lab. This variant uses virtualization software like VMware or VirtualBox to create an attacker VM with a specialized OS, such as Kali, Parrot or Arch, and allows for the addition of target machines. These machines are then consolidated in a virtual network. Users can log into the attacker machine to begin testing. More advanced labs may incorporate real hardware, such as real computers, routers, and firewalls, but this increases costs and electricity usage. However, these sophisticated environments enable more realistic scenarios and complex tasks.&lt;br /&gt;
&lt;br /&gt;
This page explains how a basic pentesting lab that can be set up with VirtualBox. This environment will suffice for most people who want to try out or train pentesting and hacking at home. The system will consist of a base machine at performs the actual operations (the attacker machine) and arbitrary target machines, the user can add and remove at will.&lt;br /&gt;
&lt;br /&gt;
The software used in this tutorial:&lt;br /&gt;
&lt;br /&gt;
* Windows 10 or 11 (as the Host OS)&lt;br /&gt;
* [https://www.virtualbox.org/wiki/Downloads VirtualBox]&lt;br /&gt;
* [https://www.kali.org/get-kali/#kali-virtual-machines Kali Linux]&lt;br /&gt;
&lt;br /&gt;
== Setup Steps ==&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
Download and install VirutalBox on your Windows machine. There is no need to manually configure anything in this installation process, you can just leave everything at default.&lt;br /&gt;
&lt;br /&gt;
On the Kali Linux download-page, make sure you go to &amp;quot;Pre-built Virtual Machines&amp;quot; and select the VirtualBox option. Using a pre-built image will make the OS setup much easier than with traditional ISO-files. This download might take a while.&lt;br /&gt;
&lt;br /&gt;
===Attacker Setup===&lt;br /&gt;
&lt;br /&gt;
Downloading the Kali pre-built VM will get you a .ZIP-folder. Extract it to a directory of your choice. Inside you should find a .VBOX-file. Double-click it and the VM will be automatically imported to the VirtulBox Manager.&lt;br /&gt;
&lt;br /&gt;
This machine can now be used out-of-the-box. The login credentials are &amp;quot;kali&amp;quot; and &amp;quot;kali&amp;quot;. This is OK because, this is just a training environment. The password does not need to be strong or protected.&lt;br /&gt;
&lt;br /&gt;
If the machine automatically boots up when imported, you can shut it down again. Do this by clicking &amp;quot;File&amp;quot; in the top bar of the machine window. Then &amp;quot;Close&amp;quot; and &amp;quot;Power off the machine&amp;quot; -&amp;gt; OK. Alternatively, you can login and shut it down from there normally.&lt;br /&gt;
&lt;br /&gt;
Now you should have the Kali VM in your list, looking something like this:&lt;br /&gt;
&lt;br /&gt;
[[File:VboxKali.png|600px|center|thumb|VirtualBox Kali VM]]&lt;br /&gt;
&lt;br /&gt;
===Network Configuration===&lt;br /&gt;
&lt;br /&gt;
The goal is to create a testing network that is separated from the host OS. The easiest way to do this is by creating a virtual network that only contains the attacker and target machines. This can be achieved by setting up a DHCP-service within VirtualBox, that automatically assigns IP-addresses to the VMs when booted up. &lt;br /&gt;
&lt;br /&gt;
Open the windows command prompt and navigate to the VirtualBox installation directory. By default this is &#039;&#039;C:\Program Files\Oracle\VirtualBox&#039;&#039;. Now use the vboxmanage tool to create the DHCP server:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
vboxmanage dhcpserver add --network=vnet --server-ip=172.16.0.1 --lower-ip=172.16.0.2 --upper-id=172.16.0.100 --netmask=255.255.255.0 --enable&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also choose other settings for you network, but make sure to use private IP addresses. If you don´t know what values to pick, you can just copy this command.&lt;br /&gt;
&lt;br /&gt;
For every machine you want to add to the pentesting network, go into the settings for the VM and go to Network. Enable one adapter and set it as attachted to &#039;&#039;Internal Network&#039;&#039;. Below, enter the same name that was used in the vboxmanage-command (&#039;&#039;vnet&#039;&#039; in this example).&lt;br /&gt;
&lt;br /&gt;
[[File:Vboxnwconf.png|600px|center|thumb|VirtualBox VM network settings]]&lt;br /&gt;
&lt;br /&gt;
At the end, you can start the machine and verify the network configuration. If the machine has an IP from the defined pool, the DHCP service works correctly.&lt;br /&gt;
&lt;br /&gt;
[[File:Kalinwconf.png|400px|center|thumb|VirtualBox VM network settings]]&lt;br /&gt;
&lt;br /&gt;
===Add Target Machines===&lt;br /&gt;
&lt;br /&gt;
Now your virtual pentesting lab is ready. You can add vulnerable target machines that you can hack from your Kali-Base-VM. A great source for such VMs is [https://www.vulnhub.com/ VulnHub.com]. This site offers a vast catalog of virtual machines that are intentionally vulnerably. You can legally hack and break them inside your environment.&lt;br /&gt;
&lt;br /&gt;
However, always make sure to &#039;&#039;&#039;add your machine to the testing network&#039;&#039;&#039;, like we did with that attacker machine.&lt;br /&gt;
&lt;br /&gt;
Once a target is added you can use nmap, fping, ping, netdiscover or some other tool to find it on the network. Now you can start hacking and exploring the machine for weaknesses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Optional: Host-to-VM Connection===&lt;br /&gt;
&lt;br /&gt;
With the current network configuration there is no connection between the physical host machine, that is running the VMs, and the attacker machine. Therefore the attacker also has no internet connection.&lt;br /&gt;
&lt;br /&gt;
This is not necessary for such an environment. But if you want this, you can enable a second adapter in the VM settings and set it to &#039;&#039;NAT&#039;&#039;. This way the VM will have host and internet connectivity. But this goes only in one direction, the host or the internet cannot reach the VM.&lt;br /&gt;
&lt;br /&gt;
If you want the connection to go bidirectional, set the adapter to &#039;&#039;Birdged Adapter&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://ieeexplore.ieee.org/document/10108187&lt;br /&gt;
* https://ia802202.us.archive.org/9/items/1.-the-pentester-blueprint/1.%20The%20Pentester%20Blueprint.pdf&lt;br /&gt;
* https://www.vulnhub.com/&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=VirtualBox:_How_to_set_up_a_Basic_Pentesting_Lab&amp;diff=17383</id>
		<title>VirtualBox: How to set up a Basic Pentesting Lab</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=VirtualBox:_How_to_set_up_a_Basic_Pentesting_Lab&amp;diff=17383"/>
		<updated>2024-12-18T15:36:51Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Training penetration testing typically occurs in a dedicated environment known as a pentesting lab, which is isolated from regular user applications and operating systems for security and convenience reasons. A pentesting lab can vary in complexity, with a minimalist setup involving a single computer running multiple virtual machines (VMs), often referred to as a virtual or basic pentesting lab. This variant uses virtualization software like VMware or VirtualBox to create an attacker VM with a specialized OS, such as Kali, Parrot or Arch, and allows for the addition of target machines. These machines are then consolidated in a virtual network. Users can log into the attacker machine to begin testing. More advanced labs may incorporate real hardware, such as real computers, routers, and firewalls, but this increases costs and electricity usage. However, these sophisticated environments enable more realistic scenarios and complex tasks.&lt;br /&gt;
&lt;br /&gt;
This page explains how a basic pentesting lab that can be set up with VirtualBox. This environment will suffice for most people who want to try out or train pentesting and hacking at home. The system will consist of a base machine at performs the actual operations (the attacker machine) and arbitrary target machines, the user can add and remove at will.&lt;br /&gt;
&lt;br /&gt;
The software used in this tutorial:&lt;br /&gt;
&lt;br /&gt;
* Windows 10 or 11 (as the Host OS)&lt;br /&gt;
* [https://www.virtualbox.org/wiki/Downloads VirtualBox]&lt;br /&gt;
* [https://www.kali.org/get-kali/#kali-virtual-machines Kali Linux]&lt;br /&gt;
&lt;br /&gt;
== Setup Steps ==&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
Download and install VirutalBox on your Windows machine. There is no need to manually configure anything in this installation process, you can just leave everything at default.&lt;br /&gt;
&lt;br /&gt;
On the Kali Linux download-page, make sure you go to &amp;quot;Pre-built Virtual Machines&amp;quot; and select the VirtualBox option. Using a pre-built image will make the OS setup much easier than with traditional ISO-files. This download might take a while.&lt;br /&gt;
&lt;br /&gt;
===Attacker Setup===&lt;br /&gt;
&lt;br /&gt;
Downloading the Kali pre-built VM will get you a .ZIP-folder. Extract it to a directory of your choice. Inside you should find a .VBOX-file. Double-click it and the VM will be automatically imported to the VirtulBox Manager.&lt;br /&gt;
&lt;br /&gt;
This machine can now be used out-of-the-box. The login credentials are &amp;quot;kali&amp;quot; and &amp;quot;kali&amp;quot;. This is OK because, this is just a training environment. The password does not need to be strong or protected.&lt;br /&gt;
&lt;br /&gt;
If the machine automatically boots up when imported, you can shut it down again. Do this by click &amp;quot;File&amp;quot; in the top bar of the machine windows. Then &amp;quot;Close&amp;quot; and &amp;quot;Power off the machine&amp;quot; -&amp;gt; OK. Alternatively, you can login and shut it down from there normally.&lt;br /&gt;
&lt;br /&gt;
Now you should have the Kali VM in your list, looking something like this:&lt;br /&gt;
&lt;br /&gt;
[[File:VboxKali.png|600px|center|thumb|VirtualBox Kali VM]]&lt;br /&gt;
&lt;br /&gt;
===Network Configuration===&lt;br /&gt;
&lt;br /&gt;
The goal is to create a testing network that is separated from the host OS. The easiest way to do this is by creating a virtual network that only contains the attacker and target machines. This can be achieved by setting up a DHCP-service within VirtualBox, that automatically assigns IP-addresses to the VMs when booted up. &lt;br /&gt;
&lt;br /&gt;
Open the windows command prompt and navigate to the VirtualBox installation directory. By default this is &#039;&#039;C:\Program Files\Oracle\VirtualBox&#039;&#039;. Now use the vboxmanage tool to create the DHCP server:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
vboxmanage dhcpserver add --network=vnet --server-ip=172.16.0.1 --lower-ip=172.16.0.2 --upper-id=172.16.0.100 --netmask=255.255.255.0 --enable&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also choose other settings for you network, but make sure to use private IP addresses. If you don´t know what values to pick, you can just copy this command.&lt;br /&gt;
&lt;br /&gt;
For every machine you want to add to the pentesting network, go into the settings for the VM and go to Network. Enable one adapter and set it as attachted to &#039;&#039;Internal Network&#039;&#039;. Below, enter the same name that was used in the vboxmanage-command (&#039;&#039;vnet&#039;&#039; in this example).&lt;br /&gt;
&lt;br /&gt;
[[File:Vboxnwconf.png|600px|center|thumb|VirtualBox VM network settings]]&lt;br /&gt;
&lt;br /&gt;
At the end, you can start the machine and verify the network configuration. If the machine has an IP from the defined pool, the DHCP service works correctly.&lt;br /&gt;
&lt;br /&gt;
[[File:Kalinwconf.png|400px|center|thumb|VirtualBox VM network settings]]&lt;br /&gt;
&lt;br /&gt;
===Add Target Machines===&lt;br /&gt;
&lt;br /&gt;
Now your virtual pentesting lab is ready. You can add vulnerable target machines that you can hack from your Kali-Base-VM. A great source for such VMs is [https://www.vulnhub.com/ VulnHub.com]. This site offers a vast catalog of virtual machines that are intentionally vulnerably. You can legally hack and break them inside your environment.&lt;br /&gt;
&lt;br /&gt;
However, always make sure to &#039;&#039;&#039;add your machine to the testing network&#039;&#039;&#039;, like we did with that attacker machine.&lt;br /&gt;
&lt;br /&gt;
Once a target is added you can use nmap, fping, ping, netdiscover or some other tool to find it on the network. Now you can start hacking and exploring the machine for weaknesses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Optional: Host-to-VM Connection===&lt;br /&gt;
&lt;br /&gt;
With the current network configuration there is no connection between the physical host machine, that is running the VMs, and the attacker machine. Therefore the attacker also has no internet connection.&lt;br /&gt;
&lt;br /&gt;
This is not necessary for such an environment. But if you want this, you can enable a second adapter in the VM settings and set it to &#039;&#039;NAT&#039;&#039;. This way the VM will have host and internet connectivity. But this goes only in one direction, the host or the internet cannot reach the VM.&lt;br /&gt;
&lt;br /&gt;
If you want the connection to go bidirectional, set the adapter to &#039;&#039;Birdged Adapter&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://ieeexplore.ieee.org/document/10108187&lt;br /&gt;
* https://ia802202.us.archive.org/9/items/1.-the-pentester-blueprint/1.%20The%20Pentester%20Blueprint.pdf&lt;br /&gt;
* https://www.vulnhub.com/&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=VirtualBox:_How_to_set_up_a_Basic_Pentesting_Lab&amp;diff=17382</id>
		<title>VirtualBox: How to set up a Basic Pentesting Lab</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=VirtualBox:_How_to_set_up_a_Basic_Pentesting_Lab&amp;diff=17382"/>
		<updated>2024-12-18T15:34:50Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Training penetration testing typically occurs in a dedicated environment known as a pentesting lab, which is isolated from regular user applications and operating systems for security and convenience reasons. A pentesting lab can vary in complexity, with a minimalist setup involving a single computer running multiple virtual machines (VMs), often referred to as a virtual or basic pentesting lab. This variant uses virtualization software like VMware or VirtualBox to create an attacker VM with a specialized OS, such as Kali, Parrot or Arch, and allows for the addition of target machines. These machines are then consolidated in a virtual network. Users can log into the attacker machine to begin testing. More advanced labs may incorporate real hardware, such as real computers, routers, and firewalls, but this increases costs and electricity usage. However, these sophisticated environments enable more realistic scenarios and complex tasks.&lt;br /&gt;
&lt;br /&gt;
This page explains how a basic pentesting lab that can be set up with VirtualBox. This environment will suffice for most people who want to try out or train pentesting and hacking at home. The system will consist of a base machine at performs the actual operations (the attacker machine) and arbitrary target machines, the user can add and remove at will.&lt;br /&gt;
&lt;br /&gt;
The software used in this tutorial:&lt;br /&gt;
&lt;br /&gt;
* Windows 10 or 11 (as the Host OS)&lt;br /&gt;
* [https://www.virtualbox.org/wiki/Downloads VirtualBox]&lt;br /&gt;
* [https://www.kali.org/get-kali/#kali-virtual-machines Kali Linux]&lt;br /&gt;
&lt;br /&gt;
== Setup Steps ==&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
Download and install VirutalBox on your Windows machine. There is no need to manually configure anything in this installation process, you can just leave everything at default.&lt;br /&gt;
&lt;br /&gt;
On the Kali Linux download-page, make sure you go to &amp;quot;Pre-built Virtual Machines&amp;quot; and select the VirtualBox option. Using a pre-built image will make the OS setup much easier than with traditional ISO-files. This download might take a while.&lt;br /&gt;
&lt;br /&gt;
===Attacker Setup===&lt;br /&gt;
&lt;br /&gt;
Downloading the Kali pre-build VM will get you a .ZIP-folder. Extract it to a directory of your choice. Inside you should find a .VBOX-file. Double-click it and the VM will be automatically imported to the VirtulBox Manager.&lt;br /&gt;
&lt;br /&gt;
This machine can now be used out-of-the-box. The login credentials are &amp;quot;kali&amp;quot; and &amp;quot;kali&amp;quot;. This is OK because, this is just a training environment, the password does not need to be strong or protected.&lt;br /&gt;
&lt;br /&gt;
If the machine automatically boots up when imported, you can shut it down again. Do this by click &amp;quot;File&amp;quot; in the top bar of the machine windows. Then &amp;quot;Close&amp;quot; and &amp;quot;Power off the machine&amp;quot; -&amp;gt; OK. Alternatively, you can login and shut it down from there normally.&lt;br /&gt;
&lt;br /&gt;
Now you should have the Kali VM in your list, looking something like this:&lt;br /&gt;
&lt;br /&gt;
[[File:VboxKali.png|600px|center|thumb|VirtualBox Kali VM]]&lt;br /&gt;
&lt;br /&gt;
===Network Configuration===&lt;br /&gt;
&lt;br /&gt;
The goal is to create a testing network that is separated from the host OS. The easiest way to do this is by creating a virtual network that only contains the attacker and target machines. This can be achieved by setting up a DHCP-service within VirtualBox, that automatically assigns IP-addresses to the VMs when booted up. &lt;br /&gt;
&lt;br /&gt;
Open the windows command prompt and navigate to the VirtualBox installation directory. By default this is &#039;&#039;C:\Program Files\Oracle\VirtualBox&#039;&#039;. Now use the vboxmanage tool to create the DHCP server:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
vboxmanage dhcpserver add --network=vnet --server-ip=172.16.0.1 --lower-ip=172.16.0.2 --upper-id=172.16.0.100 --netmask=255.255.255.0 --enable&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also choose other settings for you network, but make sure to use private IP addresses. If you don´t know what values to pick, you can just copy this command.&lt;br /&gt;
&lt;br /&gt;
For every machine you want to add to the pentesting network, go into the settings for the VM and go to Network. Enable one adapter and set it as attachted to &#039;&#039;Internal Network&#039;&#039;. Below, enter the same name that was used in the vboxmanage-command (&#039;&#039;vnet&#039;&#039; in this example).&lt;br /&gt;
&lt;br /&gt;
[[File:Vboxnwconf.png|600px|center|thumb|VirtualBox VM network settings]]&lt;br /&gt;
&lt;br /&gt;
At the end, you can start the machine and verify the network configuration. If the machine has an IP from the defined pool, the DHCP service works correctly.&lt;br /&gt;
&lt;br /&gt;
[[File:Kalinwconf.png|400px|center|thumb|VirtualBox VM network settings]]&lt;br /&gt;
&lt;br /&gt;
===Add Target Machines===&lt;br /&gt;
&lt;br /&gt;
Now your virtual pentesting lab is ready. You can add vulnerable target machines that you can hack from your Kali-Base-VM. A great source for such VMs is [https://www.vulnhub.com/ VulnHub.com]. This site offers a vast catalog of virtual machines that are intentionally vulnerably. You can legally hack and break them inside your environment.&lt;br /&gt;
&lt;br /&gt;
However, always make sure to &#039;&#039;&#039;add your machine to the testing network&#039;&#039;&#039;, like we did with that attacker machine.&lt;br /&gt;
&lt;br /&gt;
Once a target is added you can use nmap, fping, ping, netdiscover or some other tool to find it on the network. Now you can start hacking and exploring the machine for weaknesses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Optional: Host-to-VM Connection===&lt;br /&gt;
&lt;br /&gt;
With the current network configuration there is no connection between the physical host machine, that is running the VMs, and the attacker machine. Therefore the attacker also has no internet connection.&lt;br /&gt;
&lt;br /&gt;
This is not necessary for such an environment. But if you want this, you can enable a second adapter in the VM settings and set it to &#039;&#039;NAT&#039;&#039;. This way the VM will have host and internet connectivity. But this goes only in one direction, the host or the internet cannot reach the VM.&lt;br /&gt;
&lt;br /&gt;
If you want the connection to go bidirectional, set the adapter to &#039;&#039;Birdged Adapter&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://ieeexplore.ieee.org/document/10108187&lt;br /&gt;
* https://ia802202.us.archive.org/9/items/1.-the-pentester-blueprint/1.%20The%20Pentester%20Blueprint.pdf&lt;br /&gt;
* https://www.vulnhub.com/&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=VirtualBox:_How_to_set_up_a_Basic_Pentesting_Lab&amp;diff=17381</id>
		<title>VirtualBox: How to set up a Basic Pentesting Lab</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=VirtualBox:_How_to_set_up_a_Basic_Pentesting_Lab&amp;diff=17381"/>
		<updated>2024-12-18T15:32:40Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Training penetration testing typically occurs in a dedicated environment known as a pentesting lab, which is isolated from regular user applications and operating systems for security and convenience reasons. A pentesting lab can vary in complexity, with a minimalist setup involving a single computer running multiple virtual machines (VMs), often referred to as a virtual or basic pentesting lab. This variant uses virtualization software like VMware or VirtualBox to create an attacker VM with a specialized OS, such as Kali, Parrot or Arch, and allows for the addition of target machines. These machines are then consolidated in a virtual network. Users can log into the attacker machine to begin testing. More advanced labs may incorporate real hardware, such as real computers, routers, and firewalls, but this increases costs and electricity usage. However, these sophisticated environments enable more realistic scenarios and complex tasks.&lt;br /&gt;
&lt;br /&gt;
This page explains how a basic pentesting lab that can be set up with VirtualBox. This environment will suffice for most people who want to try out or train pentesting and hacking at home. The system will consist of a base machine at performs the actual operations (the attacker machine) and arbitrary target machines, the user can add and remove at will.&lt;br /&gt;
&lt;br /&gt;
The software used in this tutorial:&lt;br /&gt;
&lt;br /&gt;
* Windows 10 or 11 (as the Host OS)&lt;br /&gt;
* [https://www.virtualbox.org/wiki/Downloads VirtualBox]&lt;br /&gt;
* [https://www.kali.org/get-kali/#kali-virtual-machines Kali Linux]&lt;br /&gt;
&lt;br /&gt;
== Setup Steps ==&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
Download and install VirutalBox on your Windows machine. There is no need to manually configure anything in this installation process, you can just leave everything at default.&lt;br /&gt;
&lt;br /&gt;
On the Kali Linux download-page, make sure you go to &amp;quot;Pre-built Virtual Machines&amp;quot; and select the VirtualBox option. Using a pre-built image will make the OS setup much more easy than with traditional ISO-files. This download might take a while.&lt;br /&gt;
&lt;br /&gt;
===Attacker Setup===&lt;br /&gt;
&lt;br /&gt;
Downloading the Kali pre-build VM will get you a .ZIP-folder. Extract it to a directory of your choice. Inside you should find a .VBOX-file. Double-click it and the VM will be automatically imported to the VirtulBox Manager.&lt;br /&gt;
&lt;br /&gt;
This machine can now be used out-of-the-box. The login credentials are &amp;quot;kali&amp;quot; and &amp;quot;kali&amp;quot;. This is OK because, this is just a training environment, the password does not need to be strong or protected.&lt;br /&gt;
&lt;br /&gt;
If the machine automatically boots up when imported, you can shut it down again. Do this by click &amp;quot;File&amp;quot; in the top bar of the machine windows. Then &amp;quot;Close&amp;quot; and &amp;quot;Power off the machine&amp;quot; -&amp;gt; OK. Alternatively, you can login and shut it down from there normally.&lt;br /&gt;
&lt;br /&gt;
Now you should have the Kali VM in your list, looking something like this:&lt;br /&gt;
&lt;br /&gt;
[[File:VboxKali.png|600px|center|thumb|VirtualBox Kali VM]]&lt;br /&gt;
&lt;br /&gt;
===Network Configuration===&lt;br /&gt;
&lt;br /&gt;
The goal is to create a testing network that is separated from the host OS. The easiest way to do this is by creating a virtual network that only contains the attacker and target machines. This can be achieved by setting up a DHCP-service within VirtualBox, that automatically assigns IP-addresses to the VMs when booted up. &lt;br /&gt;
&lt;br /&gt;
Open the windows command prompt and navigate to the VirtualBox installation directory. By default this is &#039;&#039;C:\Program Files\Oracle\VirtualBox&#039;&#039;. Now use the vboxmanage tool to create the DHCP server:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
vboxmanage dhcpserver add --network=vnet --server-ip=172.16.0.1 --lower-ip=172.16.0.2 --upper-id=172.16.0.100 --netmask=255.255.255.0 --enable&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also choose other settings for you network, but make sure to use private IP addresses. If you don´t know what values to pick, you can just copy this command.&lt;br /&gt;
&lt;br /&gt;
For every machine you want to add to the pentesting network, go into the settings for the VM and go to Network. Enable one adapter and set it as attachted to &#039;&#039;Internal Network&#039;&#039;. Below, enter the same name that was used in the vboxmanage-command (&#039;&#039;vnet&#039;&#039; in this example).&lt;br /&gt;
&lt;br /&gt;
[[File:Vboxnwconf.png|600px|center|thumb|VirtualBox VM network settings]]&lt;br /&gt;
&lt;br /&gt;
At the end, you can start the machine and verify the network configuration. If the machine has an IP from the defined pool, the DHCP service works correctly.&lt;br /&gt;
&lt;br /&gt;
[[File:Kalinwconf.png|400px|center|thumb|VirtualBox VM network settings]]&lt;br /&gt;
&lt;br /&gt;
===Add Target Machines===&lt;br /&gt;
&lt;br /&gt;
Now your virtual pentesting lab is ready. You can add vulnerable target machines that you can hack from your Kali-Base-VM. A great source for such VMs is [https://www.vulnhub.com/ VulnHub.com]. This site offers a vast catalog of virtual machines that are intentionally vulnerably. You can legally hack and break them inside your environment.&lt;br /&gt;
&lt;br /&gt;
However, always make sure to &#039;&#039;&#039;add your machine to the testing network&#039;&#039;&#039;, like we did with that attacker machine.&lt;br /&gt;
&lt;br /&gt;
Once a target is added you can use nmap, fping, ping, netdiscover or some other tool to find it on the network. Now you can start hacking and exploring the machine for weaknesses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Optional: Host-to-VM Connection===&lt;br /&gt;
&lt;br /&gt;
With the current network configuration there is no connection between the physical host machine, that is running the VMs, and the attacker machine. Therefore the attacker also has no internet connection.&lt;br /&gt;
&lt;br /&gt;
This is not necessary for such an environment. But if you want this, you can enable a second adapter in the VM settings and set it to &#039;&#039;NAT&#039;&#039;. This way the VM will have host and internet connectivity. But this goes only in one direction, the host or the internet cannot reach the VM.&lt;br /&gt;
&lt;br /&gt;
If you want the connection to go bidirectional, set the adapter to &#039;&#039;Birdged Adapter&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://ieeexplore.ieee.org/document/10108187&lt;br /&gt;
* https://ia802202.us.archive.org/9/items/1.-the-pentester-blueprint/1.%20The%20Pentester%20Blueprint.pdf&lt;br /&gt;
* https://www.vulnhub.com/&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=VirtualBox:_How_to_set_up_a_Basic_Pentesting_Lab&amp;diff=17380</id>
		<title>VirtualBox: How to set up a Basic Pentesting Lab</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=VirtualBox:_How_to_set_up_a_Basic_Pentesting_Lab&amp;diff=17380"/>
		<updated>2024-12-18T15:20:43Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Training penetration testing typically occurs in a dedicated environment known as a pentesting lab, which is isolated from regular user applications and operating systems for security and convenience. A pentesting lab can vary in complexity, with a minimalist setup involving a single computer running multiple virtual machines (VMs), often referred to as a virtual or basic pentesting lab. This variant uses virtualization software like VMware or VirtualBox to create an attacker VM with a specialized OS, such as Kali, Parrot or Arch, and allows for the addition of target machines. These machines are then consolidated in a virtual network. Users can log into the attacker machine to begin testing. More advanced labs may incorporate real hardware, such as real computers, routers, and firewalls, but this increases costs and electricity usage. However, these sophisticated environments enable more realistic scenarios and complex tasks.&lt;br /&gt;
&lt;br /&gt;
This page explains how a basic pentesting lab that can be set up with VirtualBox. This environment will suffice for most people who want to try out or train pentesting and hacking at home. The system will consist of a base machine at performs the actual operations (the attacker machine) and arbitrary target machines, the user can add and remove at will.&lt;br /&gt;
&lt;br /&gt;
The software used in this tutorial:&lt;br /&gt;
&lt;br /&gt;
* Windows 10 or 11 (as the Host OS)&lt;br /&gt;
* [https://www.virtualbox.org/wiki/Downloads VirtualBox]&lt;br /&gt;
* [https://www.kali.org/get-kali/#kali-virtual-machines Kali Linux]&lt;br /&gt;
&lt;br /&gt;
== Setup Steps ==&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
&lt;br /&gt;
Download and install VirutalBox on your Windows machine. There is no need to manually configure anything in this installation process, you can just leave everything at default.&lt;br /&gt;
&lt;br /&gt;
On the Kali Linux download-page, make sure you go to &amp;quot;Pre-built Virtual Machines&amp;quot; and select the VirtualBox option. Using a pre-built image will make the OS setup much more easy than with traditional ISO-files. This download might take a while.&lt;br /&gt;
&lt;br /&gt;
===Attacker Setup===&lt;br /&gt;
&lt;br /&gt;
Downloading the Kali pre-build VM will get you a .ZIP-folder. Extract it to a directory of your choice. Inside you should find a .VBOX-file. Double-click it and the VM will be automatically imported to the VirtulBox Manager.&lt;br /&gt;
&lt;br /&gt;
This machine can now be used out-of-the-box. The login credentials are &amp;quot;kali&amp;quot; and &amp;quot;kali&amp;quot;. This is OK because, this is just a training environment, the password does not need to be strong or protected.&lt;br /&gt;
&lt;br /&gt;
If the machine automatically boots up when imported, you can shut it down again. Do this by click &amp;quot;File&amp;quot; in the top bar of the machine windows. Then &amp;quot;Close&amp;quot; and &amp;quot;Power off the machine&amp;quot; -&amp;gt; OK. Alternatively, you can login and shut it down from there normally.&lt;br /&gt;
&lt;br /&gt;
Now you should have the Kali VM in your list, looking something like this:&lt;br /&gt;
&lt;br /&gt;
[[File:VboxKali.png|600px|center|thumb|VirtualBox Kali VM]]&lt;br /&gt;
&lt;br /&gt;
===Network Configuration===&lt;br /&gt;
&lt;br /&gt;
The goal is to create a testing network that is separated from the host OS. The easiest way to do this is by creating a virtual network that only contains the attacker and target machines. This can be achieved by setting up a DHCP-service within VirtualBox, that automatically assigns IP-addresses to the VMs when booted up. &lt;br /&gt;
&lt;br /&gt;
Open the windows command prompt and navigate to the VirtualBox installation directory. By default this is &#039;&#039;C:\Program Files\Oracle\VirtualBox&#039;&#039;. Now use the vboxmanage tool to create the DHCP server:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
vboxmanage dhcpserver add --network=vnet --server-ip=172.16.0.1 --lower-ip=172.16.0.2 --upper-id=172.16.0.100 --netmask=255.255.255.0 --enable&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also choose other settings for you network, but make sure to use private IP addresses. If you don´t know what values to pick, you can just copy this command.&lt;br /&gt;
&lt;br /&gt;
For every machine you want to add to the pentesting network, go into the settings for the VM and go to Network. Enable one adapter and set it as attachted to &#039;&#039;Internal Network&#039;&#039;. Below, enter the same name that was used in the vboxmanage-command (&#039;&#039;vnet&#039;&#039; in this example).&lt;br /&gt;
&lt;br /&gt;
[[File:Vboxnwconf.png|600px|center|thumb|VirtualBox VM network settings]]&lt;br /&gt;
&lt;br /&gt;
At the end, you can start the machine and verify the network configuration. If the machine has an IP from the defined pool, the DHCP service works correctly.&lt;br /&gt;
&lt;br /&gt;
[[File:Kalinwconf.png|400px|center|thumb|VirtualBox VM network settings]]&lt;br /&gt;
&lt;br /&gt;
===Add Target Machines===&lt;br /&gt;
&lt;br /&gt;
Now your virtual pentesting lab is ready. You can add vulnerable target machines that you can hack from your Kali-Base-VM. A great source for such VMs is [https://www.vulnhub.com/ VulnHub.com]. This site offers a vast catalog of virtual machines that are intentionally vulnerably. You can legally hack and break them inside your environment.&lt;br /&gt;
&lt;br /&gt;
However, always make sure to &#039;&#039;&#039;add your machine to the testing network&#039;&#039;&#039;, like we did with that attacker machine.&lt;br /&gt;
&lt;br /&gt;
Once a target is added you can use nmap, fping, ping, netdiscover or some other tool to find it on the network. Now you can start hacking and exploring the machine for weaknesses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Optional: Host-to-VM Connection===&lt;br /&gt;
&lt;br /&gt;
With the current network configuration there is no connection between the physical host machine, that is running the VMs, and the attacker machine. Therefore the attacker also has no internet connection.&lt;br /&gt;
&lt;br /&gt;
This is not necessary for such an environment. But if you want this, you can enable a second adapter in the VM settings and set it to &#039;&#039;NAT&#039;&#039;. This way the VM will have host and internet connectivity. But this goes only in one direction, the host or the internet cannot reach the VM.&lt;br /&gt;
&lt;br /&gt;
If you want the connection to go bidirectional, set the adapter to &#039;&#039;Birdged Adapter&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://ieeexplore.ieee.org/document/10108187&lt;br /&gt;
* https://ia802202.us.archive.org/9/items/1.-the-pentester-blueprint/1.%20The%20Pentester%20Blueprint.pdf&lt;br /&gt;
* https://www.vulnhub.com/&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:VboxKali.png&amp;diff=17379</id>
		<title>File:VboxKali.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:VboxKali.png&amp;diff=17379"/>
		<updated>2024-12-18T15:20:20Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=The_Trans2open_Vulnerability&amp;diff=17378</id>
		<title>The Trans2open Vulnerability</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=The_Trans2open_Vulnerability&amp;diff=17378"/>
		<updated>2024-12-18T15:17:14Z</updated>

		<summary type="html">&lt;p&gt;CHoerhan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The trans2open vulnerability, sometimes also referred to as ”trans2 vulnerability”, is a weakness that can be found in Samba versions 2.2.0 to 2.2.8. It was disclosed in 2003, at which time the Samba Port 139 was one of the most attacked ports worldwide. The vulnerability consists in a buffer overflow (BOF) that can be exploited remotely. Basically, this overflow provides an advasery with lots of attacking options. For once, it can be used to execute arbitrary code on the affected system and even open a reverse-shell with root privilidges. Another exploitation include implanting a backdoor. The trans2open vulnerability poses an extreme danger to any system that employs an effected Samba version and should be removed immediately.&lt;br /&gt;
&lt;br /&gt;
Related CVE include [https://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2003-0196 CVE-2003-0196], [https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2003-0201 CVE-2003-0201] and [https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2003-0345 CVE-2003-0345].&lt;br /&gt;
&lt;br /&gt;
== Samba ==&lt;br /&gt;
&lt;br /&gt;
Samba is an open-source, cross-platform software that facilitates file and printer sharing across various operating systems within a network. Primarily, it enables seamless file sharing between Windows and Linux/Unix systems. With Samba, a Linux file server can function within a Windows network, allowing users to access directories and files as if they were on a Windows machine. Initially released in 1992, Samba has grown significantly in popularity over the years. According to its official website, it is recognized as the standard suite of programs for Windows interoperability on Linux and Unix systems.&lt;br /&gt;
&lt;br /&gt;
== SMB ==&lt;br /&gt;
&lt;br /&gt;
Samba implements the Server Message Block (SMB) protocol, which is a network protocol designed for sharing files, printers, and serial ports between nodes on a network. It operates over TCP/IP. Originally developed by IBM in 1983, SMB was later adapted by Microsoft in 1996 into the Common Internet File System (CIFS). While CIFS is sometimes used interchangeably with SMB, it only encompasses the features of SMB 1.0 and is largely outdated today. SMB has evolved over the years, with several versions, including SMB1, SMB2, and SMB3, each introducing improvements in performance, security, and functionality. Modern versions of SMB also support interprocess communication and authentication methods such as Kerberos and NTLM (NT LAN Manager). Both Samba and SMB are widely used for communication and resource sharing across various IT systems.&lt;br /&gt;
&lt;br /&gt;
== Exploitation ==&lt;br /&gt;
&lt;br /&gt;
The vulnerability can be exploited in many different ways. However, they all relie on the remote command execution that is enabled through the buffer overflow.&lt;br /&gt;
&lt;br /&gt;
A client-supplied string is copied into a fixed-size buffer. However, this is done without comparing the size of the buffer to the length of the string beforehand. The buffer is allocated on the stack during a function call. Therefore, the overflow can easily overwrite the copy of the instruction pointer that is saved on the stack.&lt;br /&gt;
&lt;br /&gt;
===Metasploit===&lt;br /&gt;
&lt;br /&gt;
The metasploit framework offers modules that target the vulnerability. One module is specifically desinged to determine the version of Samba running on a specific port. It can be found in scanner/smb/smb_version.&lt;br /&gt;
&lt;br /&gt;
For exploitation metasploit offers the following modules:&lt;br /&gt;
&lt;br /&gt;
* exploit/freebsd/samba/trans2open&lt;br /&gt;
* exploit/linux/samba/trans2open&lt;br /&gt;
* exploit/osx/samba/trans2open&lt;br /&gt;
* exploit/solaris/samba/trans2open&lt;br /&gt;
&lt;br /&gt;
Most of them open a TCP shell back to the attacker.&lt;br /&gt;
&lt;br /&gt;
A lot of other exploits can be found on the internet. Many of them seem to have roots going back trans2root.pl and sambal.c, which where one of the first exploits.&lt;br /&gt;
&lt;br /&gt;
== Prevention ==&lt;br /&gt;
&lt;br /&gt;
The best defensive action is to remove the vulnerability before it can be exploited. The following nmap command be used to scan for servers running Samba:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cmd&amp;quot;&amp;gt;&lt;br /&gt;
nmap -sT -p 137,139,445 -O TARGET_IP&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a vulnerable Samba version is actually running on a server, the following countermeasures can be taken:&lt;br /&gt;
&lt;br /&gt;
* Upgrade the software to higher safe version (2.2.9 or 3.X.X). This is the best solution.&lt;br /&gt;
* Block external access to TCP port 139 (or 445) from any network firewalls.&lt;br /&gt;
* &amp;quot;Misconfigure&amp;quot; Samba so that anonymous access does not work. At lot of exploits rely on feature. Do this by setting the guest account user to a nonexistent name in the smb.conf file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://www.giac.org/paper/gcih/484/exploiting-sambas-smbtrans2-vulnerability/105385&lt;br /&gt;
* https://www.samba.org/samba/history/samba-2.2.9.html&lt;br /&gt;
* https://www.rapid7.com/db/modules/exploit/linux/samba/trans2open/&lt;br /&gt;
* https://www.exploit-db.com/exploits/22468&lt;br /&gt;
* https://nvd.nist.gov/vuln/detail/CVE-2003-0201&lt;br /&gt;
* https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2003-0201&lt;/div&gt;</summary>
		<author><name>CHoerhan</name></author>
	</entry>
</feed>