Detecting Wmi Persistence
Detect WMI event subscription persistence by analyzing Sysmon Event IDs 19, 20, and 21 for malicious EventFilter, EventConsumer, and FilterToConsumerBinding creation.
MCP get_skill({ skillId: "detecting-wmi-persistence-e2237ba9" })Use this skill with your agent
Create a free account and connect via MCP
# Detecting WMI Persistence ## When to Use - When hunting for WMI event subscription persistence (MITRE ATT&CK T1546.003) - After detecting suspicious WMI activity in endpoint telemetry - During incident response to identify attacker persistence mechanisms - When Sysmon alerts trigger on Event IDs 19, 20, or 21 - During purple team exercises testing WMI-based persistence ## Prerequisites - Sysmon v6.1+ deployed with WMI event logging enabled (Event IDs 19, 20, 21) - Windows Security Event Log forwarding configured - SIEM with Sysmon data ingested (Splunk, Elastic, Sentinel) - PowerShell access for WMI enumeration on endpoints - Sysinternals Autoruns for manual WMI subscription review ## Workflow 1. **Collect Telemetry**: Parse Sysmon Event IDs 19 (WmiEventFilter), 20 (WmiEventConsumer), 21 (WmiEventConsumerToFilter). 2. **Identify Suspicious Consumers**: Flag CommandLineEventConsumer and ActiveScriptEventConsumer types executing code. 3. **Analyze Event Filters**: Examine WQL queries in EventFilters for process start triggers or timer-based execution. 4. **Correlate Bindings**: Match FilterToConsumerBindings linking suspicious filters to consumers. 5. **Check Persistence Locations**: Query WMI namespaces root\subscription and root\default for active subscriptions. 6. **Validate Findings**: Cross-reference with known-good WMI subscriptions (SCCM, AV products). 7. **Document and Remediate**: Remove malicious subscriptions and update detection rules. ## Key Concepts | Concept | Description | |---------|-------------| | Sysmon Event 19 | WmiEventFilter creation detected | | Sysmon Event 20 | WmiEventConsumer creation detected | | Sysmon Event 21 | WmiEventConsumerToFilter binding detected | | T1546.003 | Event Triggered Execution: WMI Event Subscription | | CommandLineEventConsumer | Executes system commands when filter triggers | | ActiveScriptEventConsumer | Runs VBScript/JScript when filter triggers | ## Tools & Systems | Tool | Purpose | |------|---------| | Sysmon | Windows event monitoring for WMI activity | | WMI Explorer | GUI tool for browsing WMI namespaces | | Autoruns | Sysinternals tool listing persistence mechanisms | | PowerShell Get-WMIObject | Enumerate WMI event subscriptions | | Splunk | SIEM analysis of Sysmon WMI events | | Velociraptor | Endpoint WMI artifact collection | ## Output Format ``` Hunt ID: TH-WMI-[DATE]-[SEQ] Technique: T1546.003 Host: [Hostname] Event Type: [EventFilter|EventConsumer|Binding] Consumer Type: [CommandLine|ActiveScript] WQL Query: [Filter query text] Command: [Executed command or script] Risk Level: [Critical/High/Medium/Low] Recommended Action: [Remove subscription, investigate lateral movement] ```
Related Skills
More skills in Security & Compliance
1password
Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in, and reading/injecting secrets for commands.
1password
Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.
Accessibility Lead
Accessibility team lead and orchestrator. Use proactively on EVERY task that involves web UI code, HTML, JSX, CSS, React components, web pages, server-side templates (.leaf, .ejs, .erb, .hbs), or any user-facing web content. This agent coordinates the accessibility specialist team and ensures no accessibility requirement is missed. Runs the final review before any UI code is considered complete. Applies to any web framework, server-side templating framework (Vapor/Leaf, Rails/ERB, Django/Jinja, Express/EJS), or vanilla HTML/CSS/JS. Works alongside other team leads (e.g., swift-lead) in multi-language projects.
Accessibility Regression Detector
Detects accessibility regressions by comparing audit results across commits/branches. Tracks score trends, identifies new issues, and validates previous fixes remain in place.
Accessibility Statement
Generates conformance/accessibility statements following W3C or EU model templates. Takes audit results as input, maps to conformance claims, identifies known limitations, and outputs a deployable HTML page or markdown document.
Accessibility Tool Builder
Expert in building accessibility scanning tools, rule engines, document parsers, report generators, and audit automation. WCAG criterion mapping, severity scoring, CLI/GUI scanner architecture, CI/CD integration.
Explore Other Categories
Skills from other categories with shared topics
Analyzing Malicious PDF With Peepdf
Perform static analysis of malicious PDF documents using peepdf, pdfid, and pdf-parser to extract embedded JavaScript, shellcode, and suspicious objects.
Analyzing PDF Malware With Pdfid
Analyzes malicious PDF files using PDFiD, pdf-parser, and peepdf to identify embedded JavaScript, shellcode, exploits, and suspicious objects without opening the document. Determines the attack vector and extracts embedded payloads for further analysis. Activates for requests involving PDF malware analysis, malicious document analysis, PDF exploit investigation, or suspicious attachment triage.
Building Devsecops Pipeline With GitLab CI
Design and implement a comprehensive DevSecOps pipeline in GitLab CI/CD integrating SAST, DAST, container scanning, dependency scanning, and secret detection.