Anti VM
Anti VM
Anti VM
Aviad Yifrah
Supervisor: Igor Smolyar
3/4/17
Malware analysis - basic
Manually configuration.
Cuckoo sandbox – https://cuckoosandbox.org/
malware analysis system which one of its components is a driver which
hook syscalls – but its really hard to configure and had a lot of
dependencies. Not plug&play.
https://github.com/wbenny/avmext -
Anti-Anti-VM solution via Windows Driver
https://github.com/nsmfoo/antivmdetection -
Script to create templates to use with VirtualBox to make vm detection
harder
My goal – Unique advantages
https://www.codeproject.com/Articles/44326/MinHook-The-Minimalistic-x-
x-API-Hooking-Libra
The Minimalistic x86/x64 API Hooking Library
Using inline hooking.
replaces the prologue of the target function with x86's JMP (unconditional
jump) instruction to the detour function.
Updated open source and recommended by win32api developers.
VM common hardware configuration
Vmware
Vmtoolsd.exe
Vmwaretrat.exe
Vmwareuser.exe
Vmacthlp.exe
VirtualBox
vboxservice.exe
vboxtray.exe
Typical files
VMware
C:\windows\System32\Drivers\Vmmouse.sys
C:\windows\System32\Drivers\vm3dgl.dll
C:\windows\System32\Drivers\vmdum.dll
Etc…
VirtualBox
C:\windows\System32\vboxoglpassthroughspu.dll
C:\windows\System32\vboxservice.exe
C:\windows\System32\vboxtray.exe
Etc…
Typical services
VMTools
Vmhgfs
VMMEMCTL
Vmmouse
Vmrawdsk
Vmusbmouse
Vmvss
Vmscsi
Vmxnet
vmx_svga
Vmware Tools
Vmware Physical Disk Helper Service
Project description
I focused on hooking win32 API calls to prevent detection by files, reg keys and
processes.
Project files:
HidingDLL.dll – main DLL which injected into processes and implement hooking.
files_blackList.txt + process_blackList.txt + registry_blackList.txt |
– black list configuration files.
editReg.exe – edit appInit_Dlls and LoadAppInit_DLLs registry value to point to our dll.
hooked functions:
MessageBox (test case - training)
RegOpenKeyExA
GetFileAttributesA
CreateFileW
Hooking failure: Process32First, Process32Next.
Project flow
1. Change
registry value
appinit_dlls
RegOpenKeyExA
Hooking:
https://www.codeproject.com/Articles/44326/MinHook-The-Minimalistic-x-x-API-Hooking-Libra
http://vxheaven.org/lib/vhf01.html
AppInit_DLLs: https://support.microsoft.com/he-il/kb/197571
Anti VM methods:
https://www.sans.org/reading-room/whitepapers/forensics/detecting-malware-sandbox-
evasion-techniques-36667
https://www.zscaler.com/blogs/research/malicious-documents-leveraging-new-anti-vm-anti-
sandbox-techniques
https://www.cyberbit.net/endpoint-security/anti-vm-and-anti-sandbox-explained/
http://resources.infosecinstitute.com/anti-debugging-and-anti-vm-techniques-and-anti-
emulation/#gref
anti vm\sandbox malware samples\PoC :
Sems tool:https://github.com/AlicanAkyol/sems