Connect with us

Hi, what are you looking for?


Malware & Threats

Malware Increasingly Abusing WMI for Evasion

Malware is increasingly using Windows Management Instrumentation (WMI) queries to evade detection and to determine the environment it is running in, FireEye researchers warn.

Malware is increasingly using Windows Management Instrumentation (WMI) queries to evade detection and to determine the environment it is running in, FireEye researchers warn.

Leveraging WMI to evade detection has been seen before, and Mandiant revealed last year that advanced persistent threat (APT) groups were using WMI and PowerShell to move laterally, harvest credentials, and search for useful information within Windows environments. Now, FireEye is offering more specific examples of how WMI queries can be leveraged for nefarious purposes.

Because WMI provides high-level interaction with Windows objects using C/C++, VBScript, JScript, and C#, the WMI services are being abused by malware authors to avoid virtualized environments and evade detection. In fact, FireEye explains that a WMI query can detect anti-virus programs because they are registered in AntiVirusProduct class under rootSecurityCenter2 namespace.

Some malware would first check the operating system and would look for an anti-virus program only if Windows Vista or later was detected. As soon as the malware was able to detect the OS and anti-virus, it would send the information, along with other user data, to the server to receive the right payload or to evade detection.

According to FireEye, some malware monitors the system for multiple security products, using different techniques, with the most popular virtualization programs detected with the help of WMI queries. The malware checks for BIOS information from Win32_BIOS class under rootcimv2 namespace. “Specific fields/columns can also be retrieved similar to an SQL query,” FireEye says.

The security researchers also found samples that used Win32_ComputerSystem class for virtual machine detection, which returned a ‘Model’ in the results, offering information about the virtual machine in case of VMware, VirtualBox and Virtual Machine. If matching strings were found in said filed, virtualization was detected.

Another piece of malware used Win32_VideoController and Win32_DiskDrive classes for detection, along with process names of VMware, Wireshark, Fiddler and other security products that were checked before execution of WMI queries. When executed in PowerShell, the WMI query would reveal plenty of information through which VMware was detected.

The same malware family was seen using Win32_DiskDrive to detect VirtualBox, Virtual Hard disk, and VMware. “When any of the virtual machines are detected, the process terminates itself, evading the behavioral analysis,” the security researchers note.

Advertisement. Scroll to continue reading.

Malware was also observed not only checking for a specific process from Win32_Process class, but also killing it. One application targeted by malicious programs is the well-known debugger called Immunity debugger, which is “terminated and its folder is deleted after changing permissions using Windows Script Host shell,” FireEye says.

What’s more, some malware would look for and kill the processes from anti-virus vendor Kingsoft Corporation. To find a process, malware usually employs CreateToolHelp32Snapshot, Process32First and Process32Next APIs, but the malware authors opted in for a WMI query instead, which allowed them to replace tens of lines of code.

An MS Office key generator was observed checking Windows Office Software Protection Service (which enables software vendors to enforce secure licensing on the client machines) through WMI queries. The malware would start the service if it wasn’t running, after which it would retrieve Office Software Protection Service object and then install MS Office product key using it.

“Malware writers are always in search of new ways to evade analysis frameworks and sandboxes to make the payload execution successful in their targeted environments and platforms. WMI provides a simple way of environment detection that can be used to evade sandboxes and dynamic analysis tools, which seem to be underestimated by reverse engineers and others in the security community. Mitigation steps should be taken to monitor WMI queries that could lead to possible evasion,” FireEye says.

Written By

Ionut Arghire is an international correspondent for SecurityWeek.

Click to comment

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest threats, trends, and technology, along with insightful columns from industry experts.

Join us as we delve into the transformative potential of AI, predictive ChatGPT-like tools and automation to detect and defend against cyberattacks.


As cybersecurity breaches and incidents escalate, the cyber insurance ecosystem is undergoing rapid and transformational change.


Expert Insights

Related Content


The changing nature of what we still generally call ransomware will continue through 2023, driven by three primary conditions.


A recently disclosed vBulletin vulnerability, which had a zero-day status for roughly two days last week, was exploited in a hacker attack targeting the...

Malware & Threats

The NSA and FBI warn that a Chinese state-sponsored APT called BlackTech is hacking into network edge devices and using firmware implants to silently...


No one combatting cybercrime knows everything, but everyone in the battle has some intelligence to contribute to the larger knowledge base.

Application Security

Virtualization technology giant VMware on Tuesday shipped urgent updates to fix a trio of security problems in multiple software products, including a virtual machine...

Malware & Threats

Unpatched and unprotected VMware ESXi servers worldwide have been targeted in a ransomware attack exploiting a vulnerability patched in 2021.


The recent ransomware attack targeting Rackspace was conducted by a cybercrime group named Play using a new exploitation method, the cloud company revealed this...

Malware & Threats

Threat actors are increasingly abusing Microsoft OneNote documents to deliver malware in both targeted and spray-and-pray campaigns.