windows-wmi-com
In-process WMI queries via COM for Rust — CoInitializeEx + IWbemLocator::ConnectServer +
IWbemServices::ExecQuery + IEnumWbemClassObject drained one row at a time. Aimed at
red-team tooling, endpoint agents, and OPSEC self-checks that need Win32 telemetry
without shelling out to wmic or Get-CimInstance.
Status
0.1.0-dev — pre-alpha, expect breaking changes before 0.1.0. Part of the
icedracon Rust offensive AD ecosystem.
What it does
Talks WMI directly through the local COM apartment rather than through the
DCOM-over-RPC path that any cross-process WMI client (including wmic.exe and
Get-CimInstance from PowerShell) uses. That skips the RPC marshaling round-trip
per row and lands roughly an order of magnitude faster for common local queries.
See MSDN's WMI reference (IWbemLocator, IWbemServices, IWbemClassObject) for
the underlying surface — this crate is a thin, opinionated Rust facade over it.
Usage
use Wmi;
let wmi = connect_local?;
for row in wmi.query_raw?
For typed rows, implement the FromWbem trait yourself — the derive macro is
still on the roadmap.
use ;
What works / what does not (this version)
- Working: MTA apartment init, locator/services connect against a local namespace,
ExecQuery, enumerator drain, andVARIANT→WmiValuefor the common scalar cases plus 1-DBSTRarrays. - Stubbed: only a subset of
VARIANTtypes is mapped — anything else lands asWmiValue::Null. NoFromWbemderive macro yet. - Not yet: authenticated remote namespaces, method invocation (
IWbemServices::ExecMethod), event subscriptions (__InstanceOperationEvent),IWbemContexttuning, async enumeration.
Everything above the "working" line is fair game to fail on non-toy queries.
Related icedracon crates
windows-eventlog-native— liveEvtQuery/EvtSubscribewrapper for Security/System/Application channels.winrm-pentest— async WinRM 2.0 client (NTLM/Kerberos/CredSSP) for cross-platform remote PowerShell.
Cluster: Windows-native higher-level telemetry + admin surfaces. windows-wmi-com
covers the local COM WMI path; the other two cover event logs and remote WSMan.
License
MIT (c) 2026 zevs