Lesson 19 of 19 · 24m
Every Way Back In: Enumerating Persistence Before You Evict
The autostart-extensibility-point survey — registry ASEPs, IFEO and COM hijacks, scheduled-task caches, WMI subscriptions, LSASS-tier providers — that determines whether your eviction actually holds.
The containment call goes badly in a specific way: you pull the box, reimage it, rotate the credentials — and three days later the attacker is back through a WMI subscription nobody enumerated. Partial evictions announce themselves. Every persistence mechanism you missed is a foothold that watched you clean the others. Enumeration belongs in the scoping phase, and eviction happens once, in one window, after the list is complete.
The registry ASEPs
Windows' autostart extensibility points — the places the OS auto-loads code — cluster in the registry:
Run,RunOnce,RunOnceEx,Policies\Explorer\RunacrossHKLMandHKCU, plus theWow6432Nodeshadows andHKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows\LoadandRun.- Winlogon
Userinit,Shell, andAppInit_DLLs— AppInit is dead on SecureBoot machines, which is itself worth knowing before you burn time checking it. - Per-user and all-users startup folders, shell
Folderhijacks, file-association hijacks onexefile.
The hijack tier: code loaded by other programs' mechanics
- IFEO:
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\<name>\Debuggerlaunches the debugger instead of the named binary — persistence and a kill switch for security tools in one.GlobalFlag+VerifierDllsandSilentProcessExitmonitors are the quieter siblings. - COM hijacking: a CLSID registered under
HKCU\Software\Classes\CLSIDshadows the machine-wide one for that user — persistence with no admin rights and noRunkey. - DLL search-order: a phantom DLL placed where an application searches for a missing import loads on every launch — the classic side-load the implant vendors ship by default.
- AppCertDlls under
Session Managerinjects a DLL into every process that callsCreateProcess.COR_PROFILERenvironment persistence loads into every .NET process started in that context.
Scheduled tasks and services
schtasks /query /v shows the visible surface; the TaskCache registry tree (HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache) is the durable copy and survives desyncs — tasks deleted from files can linger there. Event-triggered tasks fire on specific EventIDs and look empty to a casual query. On the service side, check ServiceDll parameters for svchost-hosted DLL services, registry residue from services removed from the SCM database, and kernel-driver entries — 4697/7045 log the installs if the events still exist.
WMI subscriptions and the LSASS tier
WMI permanent event subscriptions live in root\subscription as three bound objects — __EventFilter, a CommandLineEventConsumer or ActiveScriptEventConsumer, and __FilterToConsumerBinding — no file on disk, self-rearming, invisible to older Autoruns versions. Enumerate with Get-WmiObject -Namespace root\subscription -Class __EventFilter (and the two sibling classes). The LSASS tier — Security Packages, Authentication Packages, Notification Packages under HKLM\SYSTEM\CurrentControlSet\Control\Lsa, osconfig LSA extensions, W32Time time providers, print monitors, netsh add helper DLLs — loads attacker code into or beside the credential subsystem itself, which is the scariest persistence placement that exists. User-tier persistence rounds it out: Office WLL/XLL addins, VbaProject.OTM, PowerShell profile files, browser extensions.
Enumerate at scale, then evict once
autorunsc -a * -ct (the Autoruns CLI) dumps every ASEP to TSV; sigcheck -u filters to unsigned entries. At fleet scale the pattern is a per-build golden baseline plus diff-on-incident — every persistence mechanism is an addition, and additions diff cleanly. KAPE's triage targets pull the same registry hives for offline parsing when the box is already imaged.
Tag each finding with its MITRE technique (T1543 services, T1546 event hijacks and IFEO, T1547 registry ASEPs, T1137 Office addins, T1176 extensions) so the postmortem carries the complete foothold inventory rather than "malware persisted." Then — and only then — the eradication window removes all of them at once: credentials rotated, mechanisms pulled, box reimaged if the footholds reached LSASS depth. A foothold in Lsa\Security Packages survives a Run-key cleanup and a password reset alike, which is why the depth of what you found determines how far the eviction has to go. Anything less and you're scheduling the re-entry for them.
Was this lesson helpful?
Keep reading
Related articles from the SudoSecurity blog.
CVE-2025-62718: Critical Axios SSRF Vulnerability Explained
A critical SSRF flaw in Axios was used in a North Korean supply chain attack. Here's what it does and how to patch it today.
Attacks of UPS Devices are on the Rise warns CISA
Hackers have now begun to attack internet-connected universal power supply devices. They are targeting their control interfaces via multiple remote code execution vulnerabilities. In some of the cases, they changed the default usernames and passwords, according to an important advisory from the…
Immich Had Fourteen Advisories and One Bug It Fixed Three Times
Immich's 2026 security record runs to fourteen advisories, and they cluster hard: the sharing features, the OAuth plumbing, and one login redirect parameter that took three separate fixes across eighty-three days. Plus the 3.0 migration traps still waiting for anyone who hasn't jumped yet.
Jellyfin's Threat Model Is Your Brother-in-Law
Four Jellyfin CVEs landed in 2026 and not one of them needs an admin account. One needs only the ability to name a file. Meanwhile Jellyfin 12 shipped in September, the version numbers stopped starting with 10, and every "am I patched" check you wrote is now wrong.