[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EKXZSND5MDX5H7MMZXTXKD":3,"skill-same:01M7EKXZSND5MDX5H7MMZXTXKD":87},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":51,"commitSha":52,"skillDirectory":53,"forksCount":54,"repositoryHtmlUrl":55,"repositoryHomepageUrl":6,"ownerHtmlUrl":56,"ownerBlogUrl":6,"ownerDescription":57,"updatedAt":58,"install":59,"resources":72},"01M7EKXZSND5MDX5H7MMZXTXKD","hunting-for-persistence-via-wmi-subscriptions",null,"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.","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fhunting-for-persistence-via-wmi-subscriptions\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: hunting-for-persistence-via-wmi-subscriptions\ndescription: Hunts for adversary persistence via WMI event subscriptions (MITRE T1546.003)\n  by monitoring the creation of WMI event filters, consumers, and filter-to-consumer\n  bindings that trigger malicious code execution on system events. Use when investigating\n  fileless, trigger-based persistence on Windows hosts or auditing WMI repository\n  contents for malicious event subscriptions.\ndomain: cybersecurity\nsubdomain: threat-hunting\ntags:\n- threat-hunting\n- wmi-persistence\n- mitre-t1546-003\n- event-subscription\n- windows\n- endpoint-detection\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nd3fend_techniques:\n- Application Protocol Command Analysis\n- Network Isolation\n- Network Traffic Analysis\n- Client-server Payload Profiling\n- Platform Monitoring\nnist_csf:\n- DE.CM-01\n- DE.AE-02\n- DE.AE-07\n- ID.RA-05\nmitre_attack:\n- T1046\n- T1057\n- T1082\n- T1083\n- T1547\n---\n\n# Hunting for Persistence via WMI Subscriptions\n\n## When to Use\n\n- When proactively searching for fileless persistence mechanisms in Windows environments\n- After threat intelligence reports indicate WMI-based persistence by APT groups (APT29, APT32, FIN8)\n- When investigating systems where malware persists across reboots despite cleanup attempts\n- During incident response when standard persistence locations (Run keys, scheduled tasks) are clean\n- When WmiPrvSe.exe is observed spawning unexpected child processes\n\n## Prerequisites\n\n- Sysmon Event ID 19, 20, 21 (WMI Event Filter\u002FConsumer\u002FBinding) enabled\n- Windows Event ID 5861 (WMI activity logging) from Microsoft-Windows-WMI-Activity\n- PowerShell logging enabled (Script Block Logging, Module Logging)\n- WMI repository access for enumeration\n- SIEM platform for event correlation\n\n## Workflow\n\n1. **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.\n2. **Monitor WMI Event Creation (Sysmon 19\u002F20\u002F21)**: Sysmon Event 19 captures WmiEventFilter activity, Event 20 captures WmiEventConsumer activity, and Event 21 captures WmiEventConsumerToFilter binding.\n3. **Analyze Consumer Types**: Focus on ActiveScriptEventConsumer (runs VBScript\u002FJScript) and CommandLineEventConsumer (executes commands) -- these are the dangerous types used for persistence.\n4. **Check Event Filter Triggers**: Examine what triggers the subscription. Common malicious triggers include system startup (Win32_ProcessStartTrace), user logon, or timer-based execution intervals.\n5. **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.\n6. **Correlate with MOF Compilation**: Detect `mofcomp.exe` usage which compiles MOF files to create WMI subscriptions programmatically.\n7. **Validate and Respond**: Confirm malicious subscriptions, remove them, and trace back to the initial infection vector.\n\n## Key Concepts\n\n| Concept | Description |\n|---------|-------------|\n| T1546.003 | Event Triggered Execution: WMI Event Subscription |\n| __EventFilter | WMI class defining the trigger condition |\n| __EventConsumer | WMI class defining the action to perform |\n| __FilterToConsumerBinding | Links a filter to a consumer |\n| ActiveScriptEventConsumer | Consumer that runs VBScript or JScript |\n| CommandLineEventConsumer | Consumer that executes command lines |\n| WmiPrvSe.exe | WMI Provider Host that executes subscription actions |\n| MOF File | Managed Object Format used to define WMI objects |\n\n## Detection Queries\n\n### Splunk -- WMI Subscription Creation via Sysmon\n```spl\nindex=sysmon (EventCode=19 OR EventCode=20 OR EventCode=21)\n| eval event_type=case(EventCode=19, \"EventFilter\", EventCode=20, \"EventConsumer\", EventCode=21, \"FilterToConsumerBinding\")\n| table _time Computer User event_type EventNamespace Name Query Destination Operation\n```\n\n### Splunk -- WMI Subscription via Windows Event 5861\n```spl\nindex=wineventlog source=\"Microsoft-Windows-WMI-Activity\u002FOperational\" EventCode=5861\n| table _time Computer NamespaceName Operation PossibleCause\n```\n\n### PowerShell -- Enumerate WMI Subscriptions\n```powershell\nGet-WmiObject -Namespace root\\subscription -Class __EventFilter\nGet-WmiObject -Namespace root\\subscription -Class __EventConsumer\nGet-WmiObject -Namespace root\\subscription -Class __FilterToConsumerBinding\n```\n\n### KQL -- WmiPrvSe.exe Spawning Suspicious Children\n```kql\nDeviceProcessEvents\n| where Timestamp > ago(7d)\n| where InitiatingProcessFileName =~ \"wmiprvse.exe\"\n| where FileName in~ (\"cmd.exe\", \"powershell.exe\", \"wscript.exe\", \"cscript.exe\", \"mshta.exe\", \"rundll32.exe\")\n| project Timestamp, DeviceName, FileName, ProcessCommandLine\n```\n\n### Sigma Rule\n```yaml\ntitle: WMI Event Subscription Persistence\nstatus: stable\nlogsource:\n    product: windows\n    category: wmi_event\ndetection:\n    selection_consumer:\n        EventID: 20\n        Destination|contains:\n            - 'ActiveScriptEventConsumer'\n            - 'CommandLineEventConsumer'\n    condition: selection_consumer\nlevel: high\ntags:\n    - attack.persistence\n    - attack.t1546.003\n```\n\n## Common Scenarios\n\n1. **APT29 WMI Persistence**: Creates an ActiveScriptEventConsumer that executes a VBScript backdoor on system startup, surviving reboots and credential resets.\n2. **Turla WMI Backdoor**: Uses Win32_ProcessStartTrace filter combined with CommandLineEventConsumer for covert command execution.\n3. **FIN8 WMI Timer**: Interval-based __IntervalTimerEvent triggering encoded PowerShell downloads every 30 minutes.\n4. **MOF-Based Installation**: Adversary drops a .mof file and compiles it with `mofcomp.exe` to silently create persistent subscriptions.\n\n## Output Format\n\n```\nHunt ID: TH-WMI-[DATE]-[SEQ]\nHost: [Hostname]\nSubscription Name: [Filter\u002FConsumer name]\nFilter Query: [WQL trigger condition]\nConsumer Type: [ActiveScript\u002FCommandLine]\nConsumer Action: [Script content or command]\nBinding: [Filter-to-Consumer link]\nCreated: [Timestamp]\nUser Context: [SYSTEM\u002FUser]\nRisk Level: [Critical\u002FHigh\u002FMedium\u002FLow]\n```\n","# Hunting for Persistence via WMI Subscriptions\n\n## When to Use\n\n- When proactively searching for fileless persistence mechanisms in Windows environments\n- After threat intelligence reports indicate WMI-based persistence by APT groups (APT29, APT32, FIN8)\n- When investigating systems where malware persists across reboots despite cleanup attempts\n- During incident response when standard persistence locations (Run keys, scheduled tasks) are clean\n- When WmiPrvSe.exe is observed spawning unexpected child processes\n\n## Prerequisites\n\n- Sysmon Event ID 19, 20, 21 (WMI Event Filter\u002FConsumer\u002FBinding) enabled\n- Windows Event ID 5861 (WMI activity logging) from Microsoft-Windows-WMI-Activity\n- PowerShell logging enabled (Script Block Logging, Module Logging)\n- WMI repository access for enumeration\n- SIEM platform for event correlation\n\n## Workflow\n\n1. **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.\n2. **Monitor WMI Event Creation (Sysmon 19\u002F20\u002F21)**: Sysmon Event 19 captures WmiEventFilter activity, Event 20 captures WmiEventConsumer activity, and Event 21 captures WmiEventConsumerToFilter binding.\n3. **Analyze Consumer Types**: Focus on ActiveScriptEventConsumer (runs VBScript\u002FJScript) and CommandLineEventConsumer (executes commands) -- these are the dangerous types used for persistence.\n4. **Check Event Filter Triggers**: Examine what triggers the subscription. Common malicious triggers include system startup (Win32_ProcessStartTrace), user logon, or timer-based execution intervals.\n5. **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.\n6. **Correlate with MOF Compilation**: Detect `mofcomp.exe` usage which compiles MOF files to create WMI subscriptions programmatically.\n7. **Validate and Respond**: Confirm malicious subscriptions, remove them, and trace back to the initial infection vector.\n\n## Key Concepts\n\n| Concept | Description |\n|---------|-------------|\n| T1546.003 | Event Triggered Execution: WMI Event Subscription |\n| __EventFilter | WMI class defining the trigger condition |\n| __EventConsumer | WMI class defining the action to perform |\n| __FilterToConsumerBinding | Links a filter to a consumer |\n| ActiveScriptEventConsumer | Consumer that runs VBScript or JScript |\n| CommandLineEventConsumer | Consumer that executes command lines |\n| WmiPrvSe.exe | WMI Provider Host that executes subscription actions |\n| MOF File | Managed Object Format used to define WMI objects |\n\n## Detection Queries\n\n### Splunk -- WMI Subscription Creation via Sysmon\n```spl\nindex=sysmon (EventCode=19 OR EventCode=20 OR EventCode=21)\n| eval event_type=case(EventCode=19, \"EventFilter\", EventCode=20, \"EventConsumer\", EventCode=21, \"FilterToConsumerBinding\")\n| table _time Computer User event_type EventNamespace Name Query Destination Operation\n```\n\n### Splunk -- WMI Subscription via Windows Event 5861\n```spl\nindex=wineventlog source=\"Microsoft-Windows-WMI-Activity\u002FOperational\" EventCode=5861\n| table _time Computer NamespaceName Operation PossibleCause\n```\n\n### PowerShell -- Enumerate WMI Subscriptions\n```powershell\nGet-WmiObject -Namespace root\\subscription -Class __EventFilter\nGet-WmiObject -Namespace root\\subscription -Class __EventConsumer\nGet-WmiObject -Namespace root\\subscription -Class __FilterToConsumerBinding\n```\n\n### KQL -- WmiPrvSe.exe Spawning Suspicious Children\n```kql\nDeviceProcessEvents\n| where Timestamp > ago(7d)\n| where InitiatingProcessFileName =~ \"wmiprvse.exe\"\n| where FileName in~ (\"cmd.exe\", \"powershell.exe\", \"wscript.exe\", \"cscript.exe\", \"mshta.exe\", \"rundll32.exe\")\n| project Timestamp, DeviceName, FileName, ProcessCommandLine\n```\n\n### Sigma Rule\n```yaml\ntitle: WMI Event Subscription Persistence\nstatus: stable\nlogsource:\n    product: windows\n    category: wmi_event\ndetection:\n    selection_consumer:\n        EventID: 20\n        Destination|contains:\n            - 'ActiveScriptEventConsumer'\n            - 'CommandLineEventConsumer'\n    condition: selection_consumer\nlevel: high\ntags:\n    - attack.persistence\n    - attack.t1546.003\n```\n\n## Common Scenarios\n\n1. **APT29 WMI Persistence**: Creates an ActiveScriptEventConsumer that executes a VBScript backdoor on system startup, surviving reboots and credential resets.\n2. **Turla WMI Backdoor**: Uses Win32_ProcessStartTrace filter combined with CommandLineEventConsumer for covert command execution.\n3. **FIN8 WMI Timer**: Interval-based __IntervalTimerEvent triggering encoded PowerShell downloads every 30 minutes.\n4. **MOF-Based Installation**: Adversary drops a .mof file and compiles it with `mofcomp.exe` to silently create persistent subscriptions.\n\n## Output Format\n\n```\nHunt ID: TH-WMI-[DATE]-[SEQ]\nHost: [Hostname]\nSubscription Name: [Filter\u002FConsumer name]\nFilter Query: [WQL trigger condition]\nConsumer Type: [ActiveScript\u002FCommandLine]\nConsumer Action: [Script content or command]\nBinding: [Filter-to-Consumer link]\nCreated: [Timestamp]\nUser Context: [SYSTEM\u002FUser]\nRisk Level: [Critical\u002FHigh\u002FMedium\u002FLow]\n```\n",{"name":5,"tags":24,"author":31,"domain":32,"license":15,"version":33,"nist_csf":34,"subdomain":25,"description":7,"mitre_attack":39,"d3fend_techniques":45},[25,26,27,28,29,30],"threat-hunting","wmi-persistence","mitre-t1546-003","event-subscription","windows","endpoint-detection","mahipal","cybersecurity","1.0",[35,36,37,38],"DE.CM-01","DE.AE-02","DE.AE-07","ID.RA-05",[40,41,42,43,44],"T1046","T1057","T1082","T1083","T1547",[46,47,48,49,50],"Application Protocol Command Analysis","Network Isolation","Network Traffic Analysis","Client-server Payload Profiling","Platform Monitoring","main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","04-安全渗透\u002Fhunting-for-persistence-via-wmi-subscriptions",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":60,"prompt":70,"zipAvailable":71},[61,64,67],{"tool":62,"command":63},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill hunting-for-persistence-via-wmi-subscriptions",{"tool":65,"command":66},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill hunting-for-persistence-via-wmi-subscriptions",{"tool":68,"command":69},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill hunting-for-persistence-via-wmi-subscriptions","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fhunting-for-persistence-via-wmi-subscriptions\u002FSKILL.md",true,[73,79,83],{"path":74,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":77,"sourceHtmlUrl":78},"references\u002Fapi-reference.md","REFERENCE","参考文档",1928,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fhunting-for-persistence-via-wmi-subscriptions\u002Freferences\u002Fapi-reference.md",{"path":80,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Fstandards.md",2619,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fhunting-for-persistence-via-wmi-subscriptions\u002Freferences\u002Fstandards.md",{"path":84,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":85,"sourceHtmlUrl":86},"references\u002Fworkflows.md",3145,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fhunting-for-persistence-via-wmi-subscriptions\u002Freferences\u002Fworkflows.md",[88,97,102,109,116,123],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":92,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":96},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":98,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":92,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":96},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":92,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":96},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":92,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":96},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":117,"name":118,"nameZh":6,"description":119,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":92,"licenseFileUrl":6,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":96},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":124,"name":125,"nameZh":6,"description":126,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":92,"licenseFileUrl":6,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":96},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]