Canadian data residency · made, hosted, and operated in Canada

Early access — 90 days →

MITRE ATT&CK Enterprise · TA0003

Persistence: how an attacker stays

PersistenceTA0003

Most cleanups do not work. This is why, what it costs to find out late, and the telemetry that catches it.

Codein Cybersecurity November 22, 2026 10 min read

For the owner

Most cleanups do not work.

When an intruder is removed from a machine, there is often a second reason they come back. They left a way in. An extra account nobody recognises. A service that starts by itself. A small program that runs every time somebody signs in. A change to the way sign-in itself works.

The business meaning is simple and unwelcome. If your incident closed on Tuesday and the same problem is visible on Thursday, you did not have two incidents. You had one incident that survived the cleanup. That is the whole meaning of persistence, and it is the reason it is worth its own conversation with your IT team.

It is also the tactic with the longest reach. Some mechanisms live only on the machine they were installed on, and rebuilding that machine ends them. Others live in your account system, in your identity service, or in the image your computers are built from. Those do not end with a rebuild: every new machine you deploy afterwards arrives already carrying the problem.

From the outside, persistence is invisible. No customer can see it and no colleague can report it. It surfaces weeks later, as a repeat incident, as a question from a regulator about how long the exposure really lasted, or as the awkward discovery that the fix you announced did not hold.

Three questions are worth asking your own team:

  1. If we rebuilt a machine from scratch last month, would it still let the attacker in? Ask about the build image and the software it bundles, not about the machine. The answer is usually "it depends on the image", and that answer is worth chasing.
  2. Who reviews the list of administrator accounts, scheduled jobs and services, and when did they last do it? Every estate has such a list. Very few have a date on it.
  3. When somebody's second factor is replaced or reset, who approves it, and is that written down somewhere you would actually look? This is where an intruder quietly takes over the account your team uses to watch everything else.

None of this is a large project. Most of it is a baseline and a review date. It matters because a cleanup you cannot verify is a claim you are making about your security that you have not checked.

For the analyst

The tactic

MITRE ATT&CK files Persistence under TA0003. It covers the adversary creating or modifying something so that their access survives a reboot, a rebuild, a credential reset or a cleanup. The matrix files 113 techniques under it — the largest tactic in the matrix by a wide margin — and the pinned SigmaHQ corpus carries 547 rules.

The size of that number is the single most useful fact about this tactic. Persistence is not one behaviour; it is a catalogue of the operating system's own auto-start mechanisms, each with its own file, registry key or account class. An adversary picks whichever one their target actually runs, which is why no single detection covers the tactic.

What the corpus detects

TechniqueNameRules in the corpus
T1112Modify Registry81
T1078Valid Accounts51
T1543.003Create or Modify System Process: Windows Service38
T1078.004Valid Accounts: Cloud Accounts37
T1053.005Scheduled Task/Job: Scheduled Task33
T1098Account Manipulation32
T1547.001Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder31
T1505.003Server Software Component: Web Shell23
T1133External Remote Services19
T1136.001Create Account: Local Account16
T1197BITS Jobs15
T1556Modify Authentication Process12
T1546.003Event Triggered Execution: Windows Management Instrumentation Event Subscription11
T1053Scheduled Task/Job9
T1543Create or Modify System Process9
T1053.002Scheduled Task/Job: At8
T1137Office Application Startup8
T1546.015Event Triggered Execution: Component Object Model Hijacking8
T1098.003Account Manipulation: Additional Cloud Roles7
T1546Event Triggered Execution7
T1547Boot or Logon Autostart Execution7
T1053.003Scheduled Task/Job: Cron6
T1546.008Event Triggered Execution: Accessibility Features6
T1546.011Event Triggered Execution: Application Shimming6
T1078.002Valid Accounts: Domain Accounts5
T1078.003Valid Accounts: Local Accounts5
T1136.002Create Account: Domain Account5
T1505.004Server Software Component: IIS Components5
T1546.001Event Triggered Execution: Change Default File Association5
T1554Compromise Host Software Binary5
T1137.006Office Application Startup: Add-ins4
T1546.002Event Triggered Execution: Screensaver4
T1546.007Event Triggered Execution: Netsh Helper DLL4
T1547.009Boot or Logon Autostart Execution: Shortcut Modification4
T1547.010Boot or Logon Autostart Execution: Port Monitors4
T1037.001Boot or Logon Initialization Scripts: Logon Script (Windows)3
T1078.001Valid Accounts: Default Accounts3
T1098.001Account Manipulation: Additional Cloud Credentials3
T1136Create Account3
T1136.003Create Account: Cloud Account3
T1505.002Server Software Component: Transport Agent3
T1546.013Event Triggered Execution: PowerShell Profile3
T1547.004Boot or Logon Autostart Execution: Winlogon Helper DLL3
T1556.002Modify Authentication Process: Password Filter DLL3
T1556.006Modify Authentication Process: Multi-Factor Authentication3
T1137.002Office Application Startup: Office Test2
T1176.001Software Extensions: Browser Extensions2
T1542.001Pre-OS Boot: System Firmware2
T1543.001Create or Modify System Process: Launch Agent2
T1543.002Create or Modify System Process: Systemd Service2
T1543.004Create or Modify System Process: Launch Daemon2
T1546.009Event Triggered Execution: AppCert DLLs2
T1546.012Event Triggered Execution: Image File Execution Options Injection2
T1037.005Boot or Logon Initialization Scripts: Startup Items1
T1098.005Account Manipulation: Device Registration1
T1098.007Account Manipulation: Additional Local or Domain Groups1
T1137.003Office Application Startup: Outlook Forms1
T1505Server Software Component1
T1505.001Server Software Component: SQL Stored Procedures1
T1505.005Server Software Component: Terminal Services DLL1
T1525Implant Internal Image1
T1542.003Pre-OS Boot: Bootkit1
T1546.004Event Triggered Execution: Unix Shell Configuration Modification1
T1546.010Event Triggered Execution: AppInit DLLs1
T1546.014Event Triggered Execution: Emond1
T1547.002Boot or Logon Autostart Execution: Authentication Package1
T1547.003Boot or Logon Autostart Execution: Time Providers1
T1547.005Boot or Logon Autostart Execution: Security Support Provider1
T1547.006Boot or Logon Autostart Execution: Kernel Modules and Extensions1
T1547.008Boot or Logon Autostart Execution: LSASS Driver1
T1547.014Boot or Logon Autostart Execution: Active Setup1
T1547.015Boot or Logon Autostart Execution: Login Items1
T1556.004Modify Authentication Process: Network Device Authentication1
T1653Power Settings1

The families

Boot or Logon Autostart Execution (T1547, eleven sub-techniques). The classic. T1547.001 (Registry Run Keys / Startup Folder) alone carries 31 rules. The rest are the less famous relatives — T1547.002 (Authentication Package), .004 (Winlogon Helper DLL), .008 (LSASS Driver), .014 (Active Setup), .015 (Login Items) among them. This is what "starts itself at boot" means, and it is why a clean reboot changes nothing.

Event Triggered Execution (T1546, thirteen sub-techniques). Code that runs when something happens rather than at start-up. T1546.003 (Windows Management Instrumentation Event Subscription) carries 11 rules and is the one to watch on servers; T1546.015 (Component Object Model Hijacking) carries 8; .001, .008 and .011 carry 5 to 6 each.

Create or Modify System Process (T1543, .001 Launch Agent, .002 Systemd Service, .003 Windows Service, .004 Launch Daemon) and Scheduled Task/Job (T1053, .002 At, .003 Cron, .005 Scheduled Task) are the same idea in two places: a service starts at boot and runs as SYSTEM, a task runs on a schedule. T1543.003 carries 38 rules and T1053.005 33. Neither is visible to somebody who only looks at applications.

Server Software Component (T1505, .001 SQL Stored Procedures, .002 Transport Agent, .003 Web Shell, .004 IIS Components, .005 Terminal Services DLL). Persistence inside a running application instead of the operating system. T1505.003 (Web Shell) carries 23 rules: a script in the web root that the application does not ship.

Accounts. T1136 (Create Account) with .001 Local Account (16 rules), .002 Domain Account and .003 Cloud Account; T1098 (Account Manipulation) with .001 Additional Cloud Credentials, .003 Additional Cloud Roles (7 rules), .005 Device Registration and .007 Additional Local or Domain Groups. And T1078 (Valid Accounts) is not a creation at all but a reuse: persistence often means an existing account, adjusted.

Modify Registry (T1112). 81 rules, the largest single row in the table, and the substrate under many of the families above.

Modify Authentication Process (T1556, .002 Password Filter DLL, .004 Network Device Authentication, .006 Multi-Factor Authentication). The adversary changes what a successful sign-in means — the family with the longest reach, because it lives in your identity service rather than on a disk you can wipe.

External Remote Services (T1133). 19 rules, and the mechanism by which persistence survives a rebuild: the way back in is a VPN account, a remote access server, or an appliance nobody has decommissioned.

And the rest: T1137 (Office Application Startup, with .002, .003 and .006 Add-ins), T1197 (BITS Jobs, 15 rules), T1176.001 (Browser Extensions), T1554 (Compromise Host Software Binary), T1525 (Implant Internal Image), T1542.001 (System Firmware) and T1542.003 (Bootkit), T1037.001 (Windows Logon Script) and T1037.005 (Startup Items), and T1653 (Power Settings).

Where the telemetry comes from

Source typeSignalColumns that carry it
windows_sysmonRegistry writes, file creation, service and task creationfile_path, command_line, process_name
linux_auditdService units, cron files, shell profile writesfile_path, command_line, user_name
keycloakIdentity administration eventsuser_name, event_type
m365_auditRole grants, app consents, mailbox rules, credential resetsuser_name, event_type
gworkspaceThe Google workspace equivalentsuser_name, event_type
firewall_syslogThe external remote service actually being usedsrc_ip, dst_port, event_type
cloudObject access and egress from a compromised tenantservice_name, event_type

The normalised row for one scheduled task creation looks like this:

event_type:     process_create
source_type:    windows_sysmon
host_id:        srv-dc-02
user_name:      CORP\svc_backup
process_name:   schtasks.exe
parent_process: cmd.exe
command_line:   schtasks.exe /create /tn OneDriveSync /tr "C:\ProgramData\svc.exe" /sc onlogon /ru SYSTEM
file_path:      C:\Windows\System32\schtasks.exe
severity:       medium

Nothing in that row is a smoking gun on its own. It is the comparison against what srv-dc-02 should have that carries the signal.

What makes an event rare, and what makes it wrong

Persistence is a state, not an event. The event is "a scheduled task was created"; the state is "this host has fourteen scheduled tasks and last Tuesday it had three". That distinction drives everything below.

Rare, and worth an alert:

  • A new local administrator account with no corresponding person.
  • A service whose binary path sits in a user-writable directory.
  • A Run key pointing at a file under the user's own profile directory.
  • A task or service created by an account that has never created one.
  • A second authentication factor enrolled on an account that never had one.
  • A file in a web root that the application's own release does not contain.

Wrong, and the reason this tactic is where alert fatigue is born:

  • Software installers that create a service and a scheduled task as part of installation. Every agent deployment, printer driver and backup agent does this.
  • Automatic updaters, which frequently use a scheduled task.
  • Office add-ins and browser extensions installed by staff.

Detection engineering notes

  • Baseline, do not match. The single most effective pattern for this tactic is to record what a host should contain and alert on the delta. Per host: services, scheduled tasks, autostart entries, local administrators, listening ports. You cannot decide what is wrong until you know what is right — and "right" is per host role, because a domain controller, a file server and a developer laptop legitimately differ.
  • Compare running hosts to the image they were built from. The build image is the baseline for a rebuilt machine, and comparing it to what is running is how you find the mechanism that survived the rebuild.
  • Give the identity plane its own baseline. Count of roles, count of enrolled factors, count of registered applications, count of forwarding rules. T1098.003 and T1556.006 live there, and no endpoint rule will ever see them.
  • Suppress by deployment window, not by a permanent allowlist. A task created at 3 a.m. during a change window is expected; the same task created at 3 a.m. on a Sunday is not.
  • Use the application's own manifest for web roots. T1505.003 is easy to detect when the deployment pipeline knows which files it shipped.
  • Keep the history. The write that installed the mechanism is often days before the alert that finally fires, and without history you cannot diff anything.

Where analysts get this wrong

The first mistake is treating persistence as an event rather than a state. If you only alert on the moment of creation, you catch the inattentive adversary and miss the one who installs the mechanism during your change window, or dormant, and activates it later.

The second is looking only at endpoints. A large part of this tactic lives in the identity plane — an additional cloud role, an enrolled factor, a reused account (T1078.004, T1098.003, T1556.006) — and none of it shows up on a workstation.

The third is assuming a rebuild fixed it. If the mechanism is in the software you distribute (T1554), in your update channel (T1197), or in a management agent's configuration, then every machine you rebuild comes back already carrying it, and the second incident is not a second attack.

That false negative has a recognisable shape: an intrusion is fully removed, the estate is clean, and a month later the same adversary is back. Nothing was missed in the detection, because there was never an event to miss — the foothold was in the build, visible only in the artifact every machine receives.

Where DetectMonkey fits

Persistence is found late by definition, and the alert that finally fires about it — an outbound connection, a strange sign-in — happens days after the write that installed the mechanism. The evidence that shows when the foothold was established is in the history, not in the alert.

DetectMonkey keeps that history close. The pinned corpus of 3164 rules is evaluated as events arrive rather than after indexing, and the last 72 hours of telemetry stay queryable, so an analyst can walk backwards from the moment a mechanism was installed to the account and process that installed it. It does not isolate, quarantine or block anything on your systems, and it changes no configuration on them. Telemetry is processed and stored on private servers operated by Codein in New Brunswick, Canada, and the analysts work in English and French.

Early access is 90 days at no charge for up to 100 seats, with founder-led onboarding and no card required.

See it on your own telemetry

Early access is 90 days at no charge, for up to 100 seats, founder-led onboarding, no card required.