[Osquery_manager] WMI artifacts saved query #16227
Open
+98
−10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WMI Persistence Event Subscriptions
Windows Management Instrumentation (WMI) event subscriptions provide a powerful persistence mechanism that allows attackers to execute arbitrary commands or scripts when specific system events occur. This query provides comprehensive visibility into WMI-based persistence by detecting both active subscriptions and orphaned components that may indicate residual or partially removed malware.
Core Forensic Artifacts Coverage
Queries by Platform
🪟 Windows - WMI Persistence Detection (T1546.003)
Description
Detects WMI event subscriptions used for persistence (MITRE ATT&CK T1546.003). Includes bound subscriptions (active persistence) AND orphaned components (filters/consumers without bindings) which may indicate residual or partially removed malware. WMI eventing allows attackers to execute arbitrary commands or scripts when specific system events occur. Enriched with file hashes and code signatures for referenced executables and scripts.
Detection Focus:
Result
Query results show WMI event subscription components with their relationships:
boundorphaned_consumerorphaned_filterTrusted system components (e.g.,
SCM Event Log Filter) appear alongside potentially malicious entries for complete visibility.Platform
windowsInterval
3600seconds (1 hour)Query ID
wmi_persistence_event_subscriptions_windows_elasticECS Field Mappings
event.category→["configuration"](static)event.type→["info"](static)process.command_line→command_line_templateprocess.executable→executable_pathprocess.hash.md5→md5process.hash.sha256→sha256process.code_signature.subject_name→subject_nameprocess.code_signature.status→signature_statusfile.path→script_file_namethreat.indicator.description→filter_querytags→["persistence", "wmi", "event_subscription", "mitre_t1546_003"](static)SQL Query
This PR was AI assisted with Claude Code