Generic OS Queries H FileSystem Registry Generic OS Queries Global OS object UI artifacts OS Features Processes Network CPU Hardware Firmware tables Hooks Timing WMI Human-like behavior macOS
Signature recommendations are general for each technique: hook the function used and track if it is called. It’s pretty hard to tell why application wants to get user name, for example. It doesn’t necessarily mean applying evasion technique. So the best what can be done in this situation is intercepting target functions and tracking their calls.
Usual hosts have meaningful and non-standard usernames/computer names. Particular virtual environments assign some predefined names to default users as well as computer names. Other differences between host OS and VMs include RAM size, HDD size, quantity of monitors - and so on. While these may be not the most reliable ways to detect virtual environments, they are still commonly used in malware samples.
Please note that checks are not case-sensitive.
Function used:
Code sample
Code sample is taken from InviZzzible tool
Countermeasures
Change user name to non-suspicious one.
Detections table
Check if username is one of the following: | |
Detect | String |
---|---|
[general] | admin |
andy | |
honey | |
john | |
john doe | |
malnetvm | |
maltest | |
malware | |
roo | |
sandbox | |
snort | |
tequilaboomboom | |
test | |
virus | |
virusclone | |
wilbert | |
Nepenthes | nepenthes |
Norman | currentuser |
ThreatExpert | username |
Sandboxie | user |
VMware | vmware |
Please note that checks are not case-sensitive.
Function used:
Code sample
Code sample is taken from InviZzzible tool
Countermeasures
Change computer name to non-suspicious one.
Detections table
Check if computer name is one of the following: | |
Detect | String |
---|---|
[generic] | klone_x64-pc |
tequilaboomboom | |
Anubis | TU-4NH09SMCG1HC |
InsideTm |
Please note that checks are not case-sensitive.
Function used:
Code sample
Code sample is taken from InviZzzible tool
Countermeasures
Change host name to non-suspicious one.
Detections table
Check if host name is one of the following: | |
Detect | String |
---|---|
[generic] | SystemIT |
Functions used to get executable path:
Code sample
Credits for this code sample: al-khaser project
Countermeasures
Patch/hook NtQuerySystemInformation to return new number of PhysicalPages in SystemBasicInformation.
Tip: in this case its 1st argument is equal to 2 - SystemPerformanceInformation enum value.
Alternatively, patch NumberOfPhysicalPages in KUSER_SHARED_DATA.
The following set of functions is used:
Alternatively:
Code sample
Take a look at this StackOverflow thread.
Countermeasures
Change screen resolution for it to match the resolution of usual host (1600x900, for example).
Function used:
Besides this function numbers of processors can be obtained from PEB, via either asm inline or intrinsic function, see code samples below.
Code sample (variant 1, al-khaser project)
Credits for this code sample: al-khaser project
Code sample (variant 2, al-khaser project, asm inline)
Credits for this code sample: al-khaser project
Code sample (variant 3, pafish project)
Credits for this code sample: pafish project
Countermeasures
Assign two or more cores for Virtual Machine.
As an alternative solution, patch/hook NtCreateThread to assign specific core for each new thread.
Functions used:
Code sample
Credits for this code sample: StackOverflow forum
Countermeasures
Add at least one monitor to virtual environment.
Functions used:
Code sample (checking drive total size)
Credits for this code sample: al-khaser project
Code sample (checking drive free space)
Credits for this code sample: al-khaser project
Countermeasures
Against checking disk size: filter IRP device control requests to \\Device\\HarddiskN with specific CTL-codes:
Against checking free space: patch/hook NtQueryVolumeInformationFile to process these classes:
in case if handle points to \\Device\\HarddiskVolumeN.
Function used:
Code sample
Code sample is taken from InviZzzible tool
Countermeasures
Add some value to number of ticks returned from GetTickCount function.
Function used:
Code sample (excerpt from malware)
Take a look at the excerpt from malware here.
Code sample (pafish project)
Credits for this code sample: pafish project
Countermeasures
Hook IsNativeVhdBoot and change its result to the one required.
Countermeasures are present in appropriate sub-sections, see above.
Credits go to open-source projects from where code samples were taken:
Though Check Point tool InviZzzible has them all implemented, due to modular structure of the code it would require more space to show a code sample from this tool for the same purposes. That’s why we’ve decided to use other great open-source projects for examples throughout the encyclopedia.