[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71G5YB3Y6FK6QWTRHAP0TNM":3,"skill-same:01M71G5YB3Y6FK6QWTRHAP0TNM":100},{"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":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":73,"commitSha":74,"skillDirectory":75,"forksCount":14,"repositoryHtmlUrl":76,"repositoryHomepageUrl":6,"ownerHtmlUrl":77,"ownerBlogUrl":6,"ownerDescription":78,"updatedAt":79,"install":80,"resources":93},"01M71G5YB3Y6FK6QWTRHAP0TNM","hunting-persistence-persist",null,"Hunt for adversary persistence through Windows Management Instrumentation event subscriptions by monitoring WMI consumer, filter, and binding creation events that execute malicious code triggered by system events.","DCx7C5\u002Fai-marketplace","DCx7C5","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F42419559?v=4","01M71C01G2AZV3NTNGWAWSHJPP","DC","01M71C01GQW6G50S2BYMS7PP3E",0,"MIT","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fsoc\u002Fhunting\u002Fpersistence\u002Fpersist\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"persist","hunting persistence persist","persistence","hunting","subscription","threat-hunting","read","command","de","server","malicious","filter","monitoring","code","analysis","Bash","cybersecurity","traffic","cm","creation","2026-11-10 10:12:30",false,"---\nname: hunting-persistence-persist\ndescription: Hunt for adversary persistence through Windows Management Instrumentation event subscriptions by monitoring WMI consumer, filter, and binding creation events that execute malicious code triggered by system events.\ndomain: cybersecurity\nsubdomain: threat-hunting\ntags:\n- threat-hunting\n- wmi-persistence\n- mitre-t1546-003\n- event-subscription\n- windows\n- endpoint-detection\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\nmodel: sonnet\nmaxTurns: 20\ntools: [Read, Bash, Glob, Grep]\nmitre_attack:\n- T1027\n- T1047\n- T1059\n- T1547\ncapec: []\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":44,"capec":50,"model":51,"tools":52,"domain":35,"maxTurns":56,"nist_csf":57,"subdomain":24,"description":7,"mitre_attack":62,"d3fend_techniques":67},[24,45,46,47,48,49],"wmi-persistence","mitre-t1546-003","event-subscription","windows","endpoint-detection",[],"sonnet",[53,34,54,55],"Read","Glob","Grep",20,[58,59,60,61],"DE.CM-01","DE.AE-02","DE.AE-07","ID.RA-05",[63,64,65,66],"T1027","T1047","T1059","T1547",[68,69,70,71,72],"Application Protocol Command Analysis","Network Isolation","Network Traffic Analysis","Client-server Payload Profiling","Platform Monitoring","main","a91f1293287ffa9f4f1b8f486cd6e835a1568c84","skills\u002Fsoc\u002Fhunting\u002Fpersistence\u002Fpersist","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace","https:\u002F\u002Fgithub.com\u002FDCx7C5","#Python","2026-09-01 11:21:00",{"source":8,"skillName":5,"commands":81,"prompt":91,"zipAvailable":92},[82,85,88],{"tool":83,"command":84},"npx","npx skills add DCx7C5\u002Fai-marketplace --skill hunting-persistence-persist",{"tool":86,"command":87},"bunx","bunx skills add DCx7C5\u002Fai-marketplace --skill hunting-persistence-persist",{"tool":89,"command":90},"pnpm","pnpm dlx skills add DCx7C5\u002Fai-marketplace --skill hunting-persistence-persist","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fsoc\u002Fhunting\u002Fpersistence\u002Fpersist\u002FSKILL.md",true,[94],{"path":95,"resourceType":96,"resourceTypeDesc":97,"sizeBytes":98,"sourceHtmlUrl":99},"index.json","REFERENCE","参考文档",688,"https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fsoc\u002Fhunting\u002Fpersistence\u002Fpersist\u002Findex.json",[101,111,131,149,170,191],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":105,"licenseFileUrl":106,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":110},"01M73MDK3NT5XHNYTQ5P5172V9","devel-jb-algorithmic-art","- Embed algorithms inline in the HTML artifact (don't create separate .","Apache-2.0","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fdevel-jb-algorithmic-art\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fdevel-jb-algorithmic-art\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":39},"01M71HAPZ01KQ30RKTB0FFSQ05","services-wmi-persistence-detect","Detect WMI event subscription persistence by enumerating ActiveScriptEventConsumer, CommandLineEventConsumer, and permanent subscriptions in the WMI repository.","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fwindows\u002Fservices\u002Fwmi\u002Fpersistence\u002Fdetect\u002FSKILL.md",[],[118,119,120,121,21,122,123,35,124,125,47,23,126,127,128,129,130,37,27],"services","detect","services wmi persistence detect","wmi","process-forensics","process","forensics","t1546.003","repository","commandline-consumer","subscriptions","event","activescript",{"skillNo":132,"name":133,"nameZh":6,"description":134,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":137,"publishedAt":39},"01M71HAK6JTTTS229T17WJMMCG","services-wmi-exec-exploit","Perform lateral movement across Windows networks using WMI-based remote execution techniques including Impacket wmiexec.py, CrackMapExec, and native WMI commands for stealthy post-exploitation during red team engagements.","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fwindows\u002Fservices\u002Fwmi\u002Fexec\u002Fexploit\u002FSKILL.md",[],[138,121,139,118,140,141,34,33,142,35,36,143,144,145,146,25,147,26,27,148],"exec","services wmi exec exploit","exploit","across","team","remote","crackmapexec","Impacket","lateral-movement","lateral movement","native",{"skillNo":150,"name":151,"nameZh":6,"description":152,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":155,"publishedAt":39},"01M71HAG6MHKNQV8KDZKMT4886","registry-artifact-extract","Extract and analyze Windows Registry hives to uncover user activity, installed software, autostart entries, and evidence of system compromise.","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fwindows\u002Fregistry\u002Fartifact\u002Fextract\u002FSKILL.md",[],[156,157,158,159,160,51,161,162,163,164,25,27,165,166,33,167,34,35,168,169],"extract","registry artifact extract","registry","artifact","digital-forensics","regripper","windows-registry","evidence-collection","software","uncover","analyze","collection","artifact-analysis","activity",{"skillNo":171,"name":172,"nameZh":6,"description":173,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":174,"categories":175,"keywords":176,"publishedAt":39},"01M71HACR4A8XTWTTSXK4124AA","processes-token-impersonate-detect","Detect Windows token impersonation and privilege abuse including SeImpersonatePrivilege exploitation via Potato attacks and token stealing techniques.","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fwindows\u002Fprocesses\u002Ftoken\u002Fimpersonate\u002Fdetect\u002FSKILL.md",[],[177,178,179,119,35,180,37,181,48,182,122,27,183,184,185,186,187,188,189,190],"processes","token","processes token impersonate detect","techniques","escalation","attacks","via","impersonation","potato","exploitation","printspoofer","token-impersonation","seimpersonate","privilege-escalation",{"skillNo":192,"name":193,"nameZh":6,"description":194,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":195,"categories":196,"keywords":197,"publishedAt":39},"01M71HAABSB4Z6QFSXEG00R4RK","processes-thread-injection-detect","Detect Windows thread injection techniques including CreateRemoteThread, QueueUserAPC, NtCreateThreadEx, and thread hijacking via process memory analysis.","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fwindows\u002Fprocesses\u002Fthread\u002Finjection\u002Fdetect\u002FSKILL.md",[],[198,177,199,119,200,201,123,27,183,202,203,204,33,122,35,180,205,37,206,48],"thread","injection","processes thread injection detect","thread-injection","nt-api","apc-injection","api","process-injection","memory"]