1---
2name: hunting-for-persistence-mechanisms-in-windows
3description: "Systematically hunt for adversary persistence mechanisms across Windows endpoints including registry, services, startup folders, and WMI subscriptions."
4category: mobile-and-platform
5source_repo: mukul975/Anthropic-Cybersecurity-Skills
6source_path: "skills/hunting-for-persistence-mechanisms-in-windows/SKILL.md"
7source_url: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/HEAD/skills/hunting-for-persistence-mechanisms-in-windows/SKILL.md
8metadata:
9 source: https://skillmd.com/skills/thedixitjain/hunting-for-persistence-mechanisms-in-windows
10---
11
12
13# Hunting for Persistence Mechanisms in Windows
14
15## When to Use
16
17- During periodic proactive threat hunts for dormant backdoors
18- After an incident to identify all persistence mechanisms an attacker planted
19- When investigating unusual services, scheduled tasks, or startup entries
20- When threat intel reports describe new persistence techniques in the wild
21- During security posture assessments to identify unauthorized persistent software
22
23## Prerequisites
24
25- Sysmon deployed with Event IDs 12/13/14 (Registry), 19/20/21 (WMI), 1 (Process Creation)
26- Windows Security Event forwarding for 4697 (Service Install), 4698 (Scheduled Task)
27- EDR with registry and file monitoring capabilities
28- PowerShell script block logging enabled (Event ID 4104)
29- Autoruns or equivalent baseline of legitimate persistent entries
30
31## Workflow
32
331. **Enumerate Known Persistence Locations**: Build a comprehensive list of Windows persistence points (Run keys, services, scheduled tasks, WMI, startup folder, DLL search order, COM hijacks, AppInit DLLs, Image File Execution Options).
342. **Collect Endpoint Data**: Use EDR, Sysmon, or Velociraptor to collect current persistence artifacts from endpoints across the environment.
353. **Baseline Legitimate Persistence**: Compare collected data against known-good baselines (Autoruns snapshots, GPO-deployed entries, SCCM configurations).
364. **Identify Anomalies**: Flag new, unsigned, or unknown entries in persistence locations that deviate from the baseline.
375. **Investigate Suspicious Entries**: For each anomaly, examine the binary it points to, its digital signature, file hash, and creation timestamp.
386. **Correlate with Process Activity**: Link persistence entries to process execution, network activity, and user login events.
397. **Document and Remediate**: Record findings, remove malicious persistence, and update detection rules.
40
41## Key Concepts
42
43| Concept | Description |
44|---------|-------------|
45| T1547.001 | Registry Run Keys / Startup Folder |
46| T1543.003 | Windows Service (Create or Modify) |
47| T1053.005 | Scheduled Task |
48| T1546.003 | WMI Event Subscription |
49| T1546.015 | Component Object Model (COM) Hijacking |
50| T1546.012 | Image File Execution Options Injection |
51| T1546.010 | AppInit DLLs |
52| T1547.004 | Winlogon Helper DLL |
53| T1547.005 | Security Support Provider |
54| T1574.001 | DLL Search Order Hijacking |
55| TA0003 | Persistence Tactic |
56| Autoruns | Sysinternals tool showing persistent entries |
57
58## Tools & Systems
59
60| Tool | Purpose |
61|------|---------|
62| Sysinternals Autoruns | Comprehensive persistence enumeration |
63| Velociraptor | Endpoint-wide persistence artifact collection |
64| CrowdStrike Falcon | Real-time persistence monitoring |
65| Sysmon | Registry and WMI event monitoring |
66| OSQuery | SQL-based persistence queries |
67| RECmd | Registry Explorer for forensic analysis |
68| Splunk | SIEM correlation of persistence events |
69
70## Common Scenarios
71
721. **Registry Run Key Backdoor**: Malware adds `HKCU\Software\Microsoft\Windows\CurrentVersion\Run` entry pointing to payload in `%APPDATA%`.
732. **WMI Event Subscription**: Adversary creates WMI consumer/filter pair that executes PowerShell on system boot.
743. **Malicious Service**: Attacker creates Windows service with `sc create` pointing to a backdoor binary.
754. **COM Object Hijack**: Legitimate COM CLSID InprocServer32 path replaced with malicious DLL.
765. **IFEO Debugger Injection**: Image File Execution Options key set with debugger pointing to implant for common utilities.
77
78## Output Format
79
80```
81Hunt ID: TH-PERSIST-[DATE]-[SEQ]
82Persistence Type: [Registry/Service/Task/WMI/COM/Other]
83MITRE Technique: T1547.xxx / T1543.xxx / T1053.xxx
84Location: [Full registry key / service name / task path]
85Value: [Binary path / command line]
86Host(s): [Affected endpoints]
87Signed: [Yes/No]
88Hash: [SHA256]
89Creation Time: [Timestamp]
90Risk Level: [Critical/High/Medium/Low]
91Verdict: [Malicious/Suspicious/Benign]
92```
93
94---
95
96**Source:** [`mukul975/Anthropic-Cybersecurity-Skills`](https://github.com/mukul975/Anthropic-Cybersecurity-Skills) → `skills/hunting-for-persistence-mechanisms-in-windows/SKILL.md`