Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
WMI persistence uses permanent event subscriptions to run attacker code as SYSTEM whenever a chosen condition occurs, leaving nothing in the registry, the file system, or the startup folder.

What Is WMI Persistence?
Windows Management Instrumentation is the administrative plumbing of Windows. It can report hardware details, enumerate processes, start services, and, most usefully for an attacker, run a command whenever a condition it is watching becomes true. That last capability, the permanent event subscription, is the basis of WMI persistence.
Matt Graeber brought the technique to wide attention at Black Hat USA in 2015, describing WMI as “the sharpest tool in the shed” for offensive work on Windows. Nine years on it remains a favourite of both state-sponsored operators and commodity malware, catalogued by MITRE ATT&CK as T1546.003.
A permanent subscription has three parts, all stored in the root\subscription namespace:
__EventFilter), which holds a WQL query describing the trigger. A common one polls Win32_PerfFormattedData_PerfOS_System and fires a few minutes after boot; others watch for a specific process starting, a user logging on, or a USB device appearing.CommandLineEventConsumer runs an executable or command line; ActiveScriptEventConsumer runs VBScript or JScript inline; others write to a log file or send an email.__FilterToConsumerBinding), which joins the two together and makes the subscription live.Registering all three takes a few lines of PowerShell and local administrator rights. Once bound, the consumer runs as SYSTEM under the WMI provider host, WmiPrvSE.exe, and survives reboots.
Persistence mechanisms are usually easy to enumerate because they live in well-known places: Run keys, services, scheduled tasks, startup folders. WMI subscriptions live in none of them. They are stored in the WMI repository, a binary file at C:\Windows\System32\wbem\Repository\OBJECTS.DATA, which no ordinary inventory tool reads.
Several other properties help the attacker. An ActiveScriptEventConsumer holds its payload inside the subscription itself, so there is no file on disk to detect. Execution happens under a signed Microsoft binary, which defeats naive allowlisting. WMI is used constantly by legitimate management software, so its activity blends in. And subscriptions can be created on a remote machine over WMI, giving an attacker both lateral movement and persistence in a single action.
Real-world use spans the spectrum. Stuxnet used WMI for propagation; APT29 and Turla have used subscriptions for persistence; and the technique appears in cryptomining and ransomware loaders because tooling made it easy.
Enumeration is straightforward once you know to look. On a single host:
Get-WmiObject -Namespace root\subscription -Class __EventFilter
Get-WmiObject -Namespace root\subscription -Class __EventConsumer
Get-WmiObject -Namespace root\subscription -Class __FilterToConsumerBinding
Most workstations have a small, consistent set of entries created by Windows itself and by management agents such as SCCM. Anything outside that baseline deserves attention, particularly a consumer whose command line contains an encoded PowerShell string, a reference to mshta or rundll32, or a path under a user profile or ProgramData.
For continuous detection:
WmiPrvSE.exe spawning cmd.exe, powershell.exe, wscript.exe, or mshta.exe is unusual outside a handful of management tools and makes a reliable alert.OBJECTS.DATA with a tool such as python-cim recovers subscriptions from a forensic image, including some that were deleted.Removing a subscription means deleting all three objects, not just the binding, because a filter and consumer left behind can be rebound later. Use Remove-WmiObject or Remove-CimInstance against each, then verify. Subscriptions are frequently paired with a second mechanism such as a scheduled task, so treat finding one as the start of an investigation rather than the end of it.
To reduce the opportunity: restrict local administrator rights, since creating a permanent subscription requires them; block or restrict remote WMI (DCOM on TCP 135 and the dynamic port range) between workstations, where it is almost never legitimate; apply application control so that the scripting engines a consumer calls are constrained; and enable PowerShell script block logging, which captures the content of subscription-creating scripts even when they are obfuscated.
Baselining the subscriptions on your standard build, then alerting on deviation, is the most practical long-term control. Our SOC Maturation Services include building exactly this kind of hunting content so that quiet persistence does not wait for the next incident to be noticed.
Yes. Creating a permanent event subscription in the root\subscription namespace requires local administrator privileges, so it is a post-compromise technique rather than an initial access one. That is also a useful control point: removing standing local administrator rights from ordinary user accounts prevents most malware from establishing this form of persistence in the first place.
In the WMI repository, a binary database at C:\Windows\System32\wbem\Repository\OBJECTS.DATA. They do not appear in the registry, the startup folder, or the task scheduler, which is why conventional autorun inventories miss them. Forensic tools can parse the repository file directly from a disk image and sometimes recover subscriptions that were deleted.
Delete all three objects: the __EventFilter, the __EventConsumer, and the __FilterToConsumerBinding that joins them. Removing only the binding leaves the components in place to be rebound later. Use Remove-CimInstance against each, then re-enumerate to confirm. Investigate the host fully afterwards, since attackers rarely rely on a single persistence mechanism.
Sysmon events 19, 20, and 21 cover WMI filter, consumer, and binding creation and are low volume, so enable them everywhere. Add the Microsoft-Windows-WMI-Activity/Operational log, where events 5859 to 5861 record subscription registration. Complement both with process creation events showing WmiPrvSE.exe launching a command interpreter or scripting engine.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.