본문으로 건너뛰기
Skillpedia
분석 및 스프레드시트35k · #7966

hunting-for-persistence-via-wmi-subscriptions

하는 일

이 도구는 재시작 후에도 컴퓨터에서 악성 프로그램이 계속 실행되는 은밀한 방법을 찾습니다. 이를 위해 WMI라는 시스템을 모니터링합니다.

사용하는 경우

  • ✓악성 프로그램이 배경에서 숨어 실행 중이라고 의심될 때.
  • ✓바이러스를 제거했지만 컴퓨터를 재시작한 후 다시 나타날 때.
  • ✓악성 프로그램이 WMI를 사용해 활성 상태를 유지하지 않는지 확인하고 싶은 경우.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/hunting-for-persistence-via-wmi-subscriptions/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“지속성을 나타낼 수 있는 의심스러운 WMI 활동을 찾아 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 도구는 컴퓨터가 시작되거나 사용자가 로그인하는 것 같은 특정 시스템 이벤트가 발생할 때 악성 코드를 실행하는 데 쓰일 수 있는 비정상적인 WMI 설정을 확인합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

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.

…

자주 묻는 질문

WMI란 무엇인가요?

시스템을 관리하고 시스템 정보를 얻을 수 있게 해 주는 Windows 도구입니다. 악성 프로그램이 이를 악용할 수 있습니다.

‘WMI 이벤트 구독’이란 무엇인가요?

WMI에 설정된 ‘알림’과 같습니다. 특정 이벤트(예: 컴퓨터 시작)가 발생하면 WMI가 어떤 작업을 수행하도록 지시할 수 있으며, 이 작업은 악의적일 수 있습니다.

‘ActiveScriptEventConsumer’와 ‘CommandLineEventConsumer’가 위험한 이유는 무엇인가요?

이것들은 WMI가 VBScript 같은 스크립트나 명령을 직접 실행하도록 허용하기 때문입니다. 이는 악성코드가 지속적으로 활성 상태를 유지하는 흔한 방법입니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
35k
순위
#7966
라이선스
Apache-2.0
업데이트
2026. 8. 31.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬