1---2name: hunting-for-persistence-mechanisms-in-windows3description: Systematically hunt for adversary persistence mechanisms across Windows endpoints including registry, services, startup folders, and WMI subscriptions.4domain: cybersecurity5subdomain: threat-hunting6tags: [threat-hunting, mitre-attack, persistence, windows, registry, siem, proactive-detection]7version: "1.0"8author: mahipal9license: MIT10metadata:11 source: https://skillmd.com/skills/njones17/hunting-for-persistence-mechanisms-in-windows12---1314# Hunting for Persistence Mechanisms in Windows1516## When to Use1718- During periodic proactive threat hunts for dormant backdoors19- After an incident to identify all persistence mechanisms an attacker planted20- When investigating unusual services, scheduled tasks, or startup entries21- When threat intel reports describe new persistence techniques in the wild22- During security posture assessments to identify unauthorized persistent software2324## Prerequisites2526- Sysmon deployed with Event IDs 12/13/14 (Registry), 19/20/21 (WMI), 1 (Process Creation)27- Windows Security Event forwarding for 4697 (Service Install), 4698 (Scheduled Task)28- EDR with registry and file monitoring capabilities29- PowerShell script block logging enabled (Event ID 4104)30- Autoruns or equivalent baseline of legitimate persistent entries3132## Workflow33341. **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).352. **Collect Endpoint Data**: Use EDR, Sysmon, or Velociraptor to collect current persistence artifacts from endpoints across the environment.363. **Baseline Legitimate Persistence**: Compare collected data against known-good baselines (Autoruns snapshots, GPO-deployed entries, SCCM configurations).374. **Identify Anomalies**: Flag new, unsigned, or unknown entries in persistence locations that deviate from the baseline.385. **Investigate Suspicious Entries**: For each anomaly, examine the binary it points to, its digital signature, file hash, and creation timestamp.396. **Correlate with Process Activity**: Link persistence entries to process execution, network activity, and user login events.407. **Document and Remediate**: Record findings, remove malicious persistence, and update detection rules.4142## Key Concepts4344| Concept | Description |45|---------|-------------|46| T1547.001 | Registry Run Keys / Startup Folder |47| T1543.003 | Windows Service (Create or Modify) |48| T1053.005 | Scheduled Task |49| T1546.003 | WMI Event Subscription |50| T1546.015 | Component Object Model (COM) Hijacking |51| T1546.012 | Image File Execution Options Injection |52| T1546.010 | AppInit DLLs |53| T1547.004 | Winlogon Helper DLL |54| T1547.005 | Security Support Provider |55| T1574.001 | DLL Search Order Hijacking |56| TA0003 | Persistence Tactic |57| Autoruns | Sysinternals tool showing persistent entries |5859## Tools & Systems6061| Tool | Purpose |62|------|---------|63| Sysinternals Autoruns | Comprehensive persistence enumeration |64| Velociraptor | Endpoint-wide persistence artifact collection |65| CrowdStrike Falcon | Real-time persistence monitoring |66| Sysmon | Registry and WMI event monitoring |67| OSQuery | SQL-based persistence queries |68| RECmd | Registry Explorer for forensic analysis |69| Splunk | SIEM correlation of persistence events |7071## Common Scenarios72731. **Registry Run Key Backdoor**: Malware adds `HKCU\Software\Microsoft\Windows\CurrentVersion\Run` entry pointing to payload in `%APPDATA%`.742. **WMI Event Subscription**: Adversary creates WMI consumer/filter pair that executes PowerShell on system boot.753. **Malicious Service**: Attacker creates Windows service with `sc create` pointing to a backdoor binary.764. **COM Object Hijack**: Legitimate COM CLSID InprocServer32 path replaced with malicious DLL.775. **IFEO Debugger Injection**: Image File Execution Options key set with debugger pointing to implant for common utilities.7879## Output Format8081```82Hunt ID: TH-PERSIST-[DATE]-[SEQ]83Persistence Type: [Registry/Service/Task/WMI/COM/Other]84MITRE Technique: T1547.xxx / T1543.xxx / T1053.xxx85Location: [Full registry key / service name / task path]86Value: [Binary path / command line]87Host(s): [Affected endpoints]88Signed: [Yes/No]89Hash: [SHA256]90Creation Time: [Timestamp]91Risk Level: [Critical/High/Medium/Low]92Verdict: [Malicious/Suspicious/Benign]93```