Chuyển đến nội dung
Skillpedia
Phân tích và bảng tính35k · #7966

hunting-for-persistence-via-wmi-subscriptions

Skill này làm gì

Công cụ này tìm các cách lén lút để chương trình độc hại tiếp tục chạy trên máy tính của bạn, kể cả sau khi khởi động lại. Nó làm việc này bằng cách theo dõi hệ thống WMI.

Khi nào nên dùng

  • ✓Khi bạn nghi ngờ có chương trình độc hại đang ẩn và chạy ngầm.
  • ✓Khi bạn đã cố gỡ virus nhưng nó quay lại sau khi khởi động lại máy.
  • ✓Khi bạn muốn chắc chắn không có chương trình độc hại nào dùng WMI để duy trì hoạt động.

Liên kết skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/hunting-for-persistence-via-wmi-subscriptions/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/hunting-for-persistence-via-wmi-subscriptions/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tìm các hoạt động WMI đáng ngờ có thể cho thấy việc duy trì quyền truy cập.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ kiểm tra các cấu hình WMI bất thường có thể dùng để chạy mã độc khi xảy ra một số sự kiện hệ thống, như khi máy khởi động hoặc khi người dùng đăng nhập.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Hunting for Persistence via WMI Subscriptions

When to Use

  • When proactively searching for fileless persistence mechanisms in Windows environments
  • After threat intelligence reports indicate WMI-based persistence by APT groups (APT29, APT32, FIN8)
  • When investigating systems where malware persists across reboots despite cleanup attempts
  • During incident response when standard persistence locations (Run keys, scheduled tasks) are clean
  • When WmiPrvSe.exe is observed spawning unexpected child processes

Prerequisites

  • Sysmon Event ID 19, 20, 21 (WMI Event Filter/Consumer/Binding) enabled
  • Windows Event ID 5861 (WMI activity logging) from Microsoft-Windows-WMI-Activity
  • PowerShell logging enabled (Script Block Logging, Module Logging)
  • WMI repository access for enumeration
  • SIEM platform for event correlation

Workflow

  1. Enumerate Existing WMI Subscriptions: Query all permanent WMI event subscriptions on target systems. A clean system typically has very few or zero permanent subscriptions, making anomalies easy to spot.
  2. Monitor WMI Event Creation (Sysmon 19/20/21): Sysmon Event 19 captures WmiEventFilter activity, Event 20 captures WmiEventConsumer activity, and Event 21 captures WmiEventConsumerToFilter binding.
  3. Analyze Consumer Types: Focus on ActiveScriptEventConsumer (runs VBScript/JScript) and CommandLineEventConsumer (executes commands) -- these are the dangerous types used for persistence.
  4. Check Event Filter Triggers: Examine what triggers the subscription. Common malicious triggers include system startup (Win32_ProcessStartTrace), user logon, or timer-based execution intervals.
  5. Investigate WmiPrvSe.exe Child Processes: When a WMI subscription fires, the action is executed by WmiPrvSe.exe. Hunt for unusual child processes of WmiPrvSe.exe.
  6. Correlate with MOF Compilation: Detect mofcomp.exe usage which compiles MOF files to create WMI subscriptions programmatically.
  7. Validate and Respond: Confirm malicious subscriptions, remove them, and trace back to the initial infection vector.

Key Concepts

Concept Description
T1546.003 Event Triggered Execution: WMI Event Subscription
__EventFilter WMI class defining the trigger condition
__EventConsumer WMI class defining the action to perform
__FilterToConsumerBinding Links a filter to a consumer
ActiveScriptEventConsumer Consumer that runs VBScript or JScript
CommandLineEventConsumer Consumer that executes command lines
WmiPrvSe.exe WMI Provider Host that executes subscription actions
MOF File Managed Object Format used to define WMI objects

Detection Queries

Splunk -- WMI Subscription Creation via Sysmon

index=sysmon (EventCode=19 OR EventCode=20 OR EventCode=21)
| eval event_type=case(EventCode=19, "EventFilter", EventCode=20, "EventConsumer", EventCode=21, "FilterToConsumerBinding")
| table _time Computer User event_type EventNamespace Name Query Destination Operation

Splunk -- WMI Subscription via Windows Event 5861

index=wineventlog source="Microsoft-Windows-WMI-Activity/Operational" EventCode=5861
| table _time Computer NamespaceName Operation PossibleCause

PowerShell -- Enumerate WMI Subscriptions

Get-WmiObject -Namespace root\subscription -Class __EventFilter
Get-WmiObject -Namespace root\subscription -Class __EventConsumer
Get-WmiObject -Namespace root\subscription -Class __FilterToConsumerBinding

KQL -- WmiPrvSe.exe Spawning Suspicious Children

DeviceProcessEvents
| where Timestamp > ago(7d)
| where InitiatingProcessFileName =~ "wmiprvse.exe"
| where FileName in~ ("cmd.exe", "powershell.exe", "wscript.exe", "cscript.exe", "mshta.exe", "rundll32.exe")
| project Timestamp, DeviceName, FileName, ProcessCommandLine

Sigma Rule

title: WMI Event Subscription Persistence
status: stable
logsource:
    product: windows
    category: wmi_event
detection:
    selection_consumer:
        EventID: 20
        Destination|contains:
            - 'ActiveScriptEventConsumer'
            - 'CommandLineEventConsumer'
    condition: selection_consumer
level: high
tags:
    - attack.persistence
    - attack.t1546.003

Common Scenarios

  1. APT29 WMI Persistence: Creates an ActiveScriptEventConsumer that executes a VBScript backdoor on system startup, surviving reboots and credential resets.

…

Câu hỏi thường gặp

WMI là gì?

WMI là công cụ của Windows cho phép quản lý và lấy thông tin về hệ thống. Chương trình độc hại có thể lạm dụng nó.

“WMI event subscriptions” là gì?

Đó giống như các “cảnh báo” được thiết lập trong WMI. Khi một sự kiện cụ thể xảy ra (như máy bật lên), WMI có thể được yêu cầu thực hiện một hành động, và hành động đó có thể là độc hại.

Vì sao “ActiveScriptEventConsumer” và “CommandLineEventConsumer” nguy hiểm?

Vì chúng cho phép WMI trực tiếp chạy script (như VBScript) hoặc lệnh, đây là cách phổ biến để mã độc duy trì hoạt động.

Chi tiết

Mô tả gốc của tác giả

Hunts for adversary persistence via WMI event subscriptions (MITRE T1546.003) by monitoring the creation of WMI event filters, consumers, and filter-to-consumer bindings that trigger malicious code execution on system events. Use when investigating fileless, trigger-based persistence on Windows hosts or auditing WMI repository contents for malicious event subscriptions.

repo: mukul975/Anthropic-Cybersecurity-Skills

Độ phổ biến

Sao GitHub
35k
Vị trí xếp hạng
#7966
Giấy phép
Apache-2.0
Cập nhật
31/8/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự