Join our Newsletter — 33% off our NHI Course
Home› Guides› M1040 Behavior Prevention on Endpoint: Endpoint Behaviour Prevention…
Guide SOC & Detection Engineering

M1040 Behavior Prevention on Endpoint: Endpoint Behaviour Prevention Mapped to ATT&CK

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 12 November 2026 14 min read
On this page

Signature scanning stops known files, but most intrusions now run through scripts, Office child processes, injected code and signed drivers that no signature list will catch in time. MITRE ATT&CK mitigation M1040, Behavior Prevention on Endpoint, is the control that blocks those actions on the host by watching process, file, memory and API behaviour and stopping the sequence before it completes. This guide reads M1040 from the ATT&CK v20 data: which techniques MITRE says it mitigates, how each one maps to concrete prevention settings, where the control runs out and what covers the gap, and how to measure coverage. It is written for detection engineers, endpoint owners and SOC leads who already run an EDR and want to turn prevention on deliberately rather than leave it in detect-only mode.

Key takeaways

  • M1040 is a prevention control, not a detection one. ATT&CK defines it as blocking suspicious process behaviour, unauthorised file access, abnormal API calls and exploit activity on the endpoint, not alerting on them after the fact.
  • ATT&CK v20 maps it to 51 techniques and sub-techniques. The heaviest clusters are Process Injection (T1055, 14 entries), Office Application Startup (T1137, 7 entries), Obfuscated Files or Information (T1027, 6 entries) and Command and Scripting Interpreter (T1059).
  • Most of ATT&CK's usage text names Windows attack surface reduction (ASR) rules. That makes the Windows estate the easiest place to start, with three ASR rules Microsoft calls standard protection that can usually go straight to Block.
  • Audit first, then block in rings. Behaviour rules break line-of-business software; the safe path is audit mode, exclusions reviewed and justified, then Block or Warn by deployment ring.
  • It does not stop valid credentials used through legitimate tools. An attacker with a working service account or API key often never trips a behaviour rule, so M1040 must sit beside identity controls and other mitigations.

What ATT&CK means by Behavior Prevention on Endpoint

The ATT&CK v20 description of M1040 covers the use of technologies that detect and block potentially malicious activity by analysing the behaviour of processes, files, API calls and other endpoint events, using heuristics, machine learning and real-time monitoring rather than signatures alone. It lists four implementation areas:

  • Suspicious process behaviour: EDR tooling blocks processes that behave unusually, such as a user-level application spawning a privileged process through an abnormal parent-child relationship.
  • Unauthorised file access: endpoint or DLP tooling blocks a process reading or modifying sensitive files, ATT&CK's examples being /etc/shadow on Linux and the SAM registry hive on Windows.
  • Abnormal API calls: runtime analysis blocks API sequences associated with injection, ATT&CK naming OpenProcess and WriteProcessMemory.
  • Exploit prevention: behavioural exploit protection halts a process when it sees anomalous memory writes such as a buffer overflow.

The distinction from neighbouring mitigations matters when you assign owners. App Control for Business (WDAC) decides which code may run at all (ATT&CK M1038 Execution Prevention). M1040 assumes the code is running and judges what it does. A mature endpoint uses both: allow-listing shrinks the population of code, behaviour prevention catches abuse of the code that remains, including signed system binaries. For the EDR platform itself, see the EDR Guide.

Techniques M1040 mitigates, by tactic

The table groups all 51 non-revoked technique and sub-technique relationships in the ATT&CK v20 Enterprise data by tactic, with the gist of ATT&CK's own usage text for each. Where ATT&CK lists a parent and its sub-techniques with the same text, they share a row.

TacticTechnique (ATT&CK v20)How M1040 helps, per ATT&CK
Credential AccessT1003 OS Credential Dumping, T1003.001 LSASS MemoryASR rules secure LSASS and prevent credential stealing.
ExecutionT1047 Windows Management InstrumentationASR blocks processes created by WMI commands; ATT&CK notes many legitimate tools use WMI.
ExecutionT1059, T1059.005 Visual Basic, T1059.007 JavaScriptASR stops VB and JavaScript from executing potentially malicious downloaded content.
ExecutionT1106 Native APIASR stops Office VBA macros calling Win32 APIs.
ExecutionT1204, T1204.002 Malicious FileASR blocks executables that fail prevalence, age or trusted-list criteria, and Office writing executable content.
ExecutionT1559, T1559.002 Dynamic Data ExchangeASR prevents DDE attacks and Office child processes.
ExecutionT1569, T1569.002 Service ExecutionASR blocks processes created by PsExec.
PersistenceT1137 and sub-techniques .001 to .006ASR stops Office creating child processes and writing executable content to disk.
Persistence, Privilege EscalationT1543, T1543.003 Windows ServiceASR prevents writing a signed vulnerable driver; the Microsoft Vulnerable Driver Blocklist hardens against vulnerable third-party drivers.
Persistence, Privilege EscalationT1546.003 WMI Event SubscriptionASR prevents malware abusing WMI for persistence.
Lateral Movement, Initial AccessT1091 Replication Through Removable MediaASR blocks unsigned or untrusted executables running from USB drives.
Stealth, Privilege EscalationT1055 and 13 sub-techniques (DLL, PE, thread hijacking, APC, TLS, ptrace, proc memory, extra window memory, hollowing, doppelganging, VDSO, ListPlanting)Endpoint tools block common injection behaviour sequences; ASR can stop Office injecting code.
Stealth, ExecutionT1574, T1574.013 KernelCallbackTableEndpoint tools block injection and memory tampering based on API call sequences.
StealthT1027, .009, .010, .012, .013, .014ASR blocks execution of potentially obfuscated scripts and payloads; tools should analyse encoding anomalies.
StealthT1036, T1036.008 Masquerade File TypeHIPS-style controls prevent execution of files with mismatched signatures.
StealthT1006 Direct Volume AccessEndpoint tools can block command execution or API calls related to backup services.
StealthT1216.001 PubPrn, T1564.014 Extended AttributesBlock vulnerable PubPrn versions through App Control rules; scan extended attributes during review and deployment.
ImpactT1486 Data Encrypted for ImpactCloud-delivered protection and ASR block ransomware-like files; in AWS, restrict SSE-C use on S3 through IAM policy.

Two rows sit outside the classic endpoint. T1564.014 is about scanning artefacts in packaging and deployment pipelines, and the T1486 text reaches into AWS policy. The Codefinger campaign shows why: attackers used stolen long-lived AWS keys to re-encrypt S3 objects with SSE-C keys only they held. See the Codefinger S3 ransomware breach. No endpoint agent saw that attack; the preventive control was a policy condition denying SSE-C and the removal of long-lived keys.

From ATT&CK rows to concrete prevention settings

Because ATT&CK cites Windows ASR rules for most rows, the fastest practical mapping is rule by rule. The rule names and GUIDs below are from Microsoft's ASR rules reference (checked November 2026). Equivalent behaviour policies exist in other EDR platforms under different names; use the techniques column to map your own product's policies.

ASR rule (GUID)Techniques it servesRollout note
Block credential stealing from the Windows local security authority subsystem (9e6c4e1f-7d60-472f-ba1a-a39ef669e4b2)T1003, T1003.001Standard protection rule; Microsoft states it does not support Warn mode.
Block persistence through WMI event subscription (e6db77e5-3df2-4cf1-b95a-636979351e5b)T1546.003Standard protection rule.
Block abuse of exploited vulnerable signed drivers (56a863a9-875e-4185-98a7-b882c64b5ce5)T1543, T1543.003Standard protection rule; pair with the Vulnerable Driver Blocklist.
Block all Office applications from creating child processes (d4f940ab-401b-4efc-aadc-ad5f3c50688a)T1137.x, T1559.002Audit first; add-ins and macros used in finance often trip it.
Block Office applications from creating executable content (3b576869-a4ec-4529-8536-b80a7769e899)T1137.x, T1204.002Usually low noise.
Block Office applications from injecting code into other processes (75668c1f-73b5-4cf0-bb93-3ecf5cb7cc84)T1055No Warn mode per Microsoft.
Block Win32 API calls from Office macros (92e97fa1-2edf-4476-bdd6-9dd0b4dddc7b)T1106Depends on AMSI.
Block JavaScript or VBScript from launching downloaded executable content (d3e037e1-3eb8-44c8-a917-57927947596d)T1059.005, T1059.007Depends on AMSI.
Block execution of potentially obfuscated scripts (5beb7efe-fd9a-4556-801d-275e5ffc04cc)T1027 and sub-techniquesNeeds cloud-delivered protection; admin scripts can trip it.
Block process creations originating from PSExec and WMI commands (d1e49aac-8f56-4280-b9ba-993a6d77406c)T1047, T1569.002Conflicts with Configuration Manager clients that rely on WMI; Microsoft warns against mixing deployment methods there.
Block executable files from running unless they meet a prevalence, age, or trusted list criterion (01443614-cd74-433a-b99e-2ecdc07bfc25)T1204, T1204.002Needs cloud-delivered protection; noisy on developer workstations.
Block untrusted and unsigned processes that run from USB (b2b3f03d-6a65-4f7b-a9c7-1c7ef74a9ba4)T1091Low noise in most estates.
Use advanced protection against ransomware (c1db55ab-c21a-4637-bb3f-a12568109d35)T1486Needs cloud-delivered protection.

Rule modes, per Microsoft: 0 Off, 1 Block, 2 Audit, 5 Not configured, 6 Warn. They are set through Intune endpoint security (profile Attack Surface Reduction Rules), Group Policy (Microsoft Defender Exploit Guard > Attack Surface Reduction > Configure Attack Surface Reduction rules) or Add-MpPreference -AttackSurfaceReductionRules_Ids ... -AttackSurfaceReductionRules_Actions .... Note that Set-MpPreference overwrites the existing rule list while Add-MpPreference appends. For the wider product configuration, see the Microsoft Defender for Endpoint Guide.

On Linux, the ATT&CK injection rows include T1055.008 Ptrace System Calls and T1055.009 Proc Memory. Beyond the EDR's own behaviour policy, the kernel's Yama module limits ptrace through /proc/sys/kernel/yama/ptrace_scope: 1 restricts attach to descendants, 2 requires CAP_SYS_PTRACE, and 3 disables attach entirely and cannot be changed back until reboot. That is an NHI Mgmt Group recommendation that complements, rather than appears in, the ATT&CK text.

Where identity fits

Several M1040 rows are credential theft in disguise. LSASS protection (T1003.001) is what keeps cached service account and admin credentials from being lifted on a jump host. PsExec and WMI blocking (T1047, T1569.002) collides with deployment tools that run under service accounts, so exclusions tend to be requested for exactly the most privileged non-human identities in the estate. Treat each exclusion as an access decision: name the owning service account, scope the path, set an expiry and review it. On build agents and CI runners, where secrets and tokens live in process memory and environment variables, injection and credential-theft rules are worth enforcing even when developer laptops stay in audit. See the Credential Dumping Guide for the wider credential picture.

How to implement M1040, step by step

  1. Baseline coverage: export your EDR's current prevention policy per device group and mark each ATT&CK row above as Block, Audit or Off. Many estates run the agent in detect-only mode without knowing it.
  2. Turn on the standard protection rules: Microsoft states the three standard protection rules (LSASS, WMI persistence, vulnerable signed drivers) can typically go to Block or Warn without testing. Do these first; they cover T1003.001, T1546.003 and T1543.
  3. Run everything else in audit: set the remaining rules to Audit across a representative pilot, then read event ID 1122 (audit hits) in the Windows Defender Operational log or the equivalent advanced hunting table for long enough to cover month-end and patch cycles.
  4. Write justified exclusions: per-rule exclusions where the product supports them, path plus file rather than whole folders, each with an owner and review date. Global exclusions weaken every rule at once.
  5. Enforce in rings: move rules to Block (or Warn where users need an override) ring by ring, IT first, then a pilot business unit, then broad. Track event ID 1121 (block) and 1129 (user overrode Warn).
  6. Protect the configuration: alert on event ID 5007 (settings changed) and on any attempt to stop or modify the agent, which ATT&CK v20 tracks under T1685 Disable or Modify Tools.
  7. Roll back cleanly: keep the previous policy version; a rule breaking a critical app is reverted to Audit for that ring, not switched off everywhere, and the exclusion is fixed before re-enforcing.

Choosing where to enforce first

  • Small organisations: enable the standard protection rules plus the Office and script rules in Block; most small estates have few macros and little custom scripting, so audit periods can be short.
  • Large estates: enforce first on servers that hold credentials (jump hosts, deployment servers, CI runners) and on high-exposure user groups (finance, executive assistants), where T1137 and T1204 lures land.
  • Block or Warn: Warn suits user-facing rules where a legitimate rare action exists; Block suits rules with no business use, such as Office injecting code. Rules without Warn support must go straight from Audit to Block.
  • Developer and admin workstations: the prevalence and obfuscation rules generate the most noise here; consider them later, with App Control doing more of the work.

What M1040 does not stop

  • Valid accounts used normally: an attacker logging in with stolen credentials through RDP or a cloud console runs nothing anomalous. That is T1078 Valid Accounts territory, handled by MFA, credential hygiene and identity threat detection.
  • Agentless and unmanaged assets: hypervisors, appliances, OT and SaaS have no endpoint agent; the Codefinger case above happened entirely in cloud APIs.
  • Agent tampering: attackers increasingly use vulnerable drivers to disable security tools; the driver rules help but tamper protection and alerting on agent health are separate controls.
  • Living-off-the-land with blessed tools: behaviour rules tuned to avoid breaking administrators also miss attackers acting like administrators. See the Living off the Land Guide.
  • Exclusion abuse: a broad folder exclusion becomes a safe drop zone for payloads.

D3FEND's own mapping is a reminder of this boundary. In the D3FEND ontology, M1040 is related to user-behaviour analytics techniques such as D3-RAPA Resource Access Pattern Analysis, D3-SDA Session Duration Analysis, D3-UDTA User Data Transfer Analysis, D3-UGLPA User Geolocation Logon Pattern Analysis, D3-WSAA Web Session Activity Analysis, D3-ANET Authentication Event Thresholding, D3-AZET Authorization Event Thresholding and D3-JFAPA Job Function Access Pattern Analysis. Those are identity and session analytics, which is where the valid-account gap gets covered.

Common failure patterns

  • Audit forever: rules enabled in audit during a pilot and never enforced, so dashboards show coverage that does not exist.
  • Global exclusions for deployment tooling: excluding a whole tools folder or a deployment service account from every rule to fix one PsExec conflict.
  • Mixed management planes: Group Policy and Intune both setting ASR, with Set-MpPreference scripts silently overwriting the rule list.
  • Office installed outside Program Files: Microsoft notes that the Office child-process, Office injection and Outlook child-process rules are enforced only when Office is in %ProgramFiles% or %ProgramFiles(x86)%.
  • Cloud protection off: the prevalence, obfuscation and ransomware rules depend on cloud-delivered protection, and quietly do less without it.
  • Treating M1040 as the ransomware answer: as Codefinger showed, cloud-side encryption attacks never touch an endpoint.

Detection and measurement

MetricHow to measureTarget
Rule enforcement coverageShare of managed endpoints with each M1040-mapped rule in Block or Warn100% for standard protection rules; agreed target per ring for others
ATT&CK row coverageOf the 51 M1040 relationships, how many have an enforced prevention control on each platformTracked quarterly, gaps owned
Exclusion count and ageExclusions per rule, share with owner and expiryAll owned, none older than review period
Audit-to-block ratioEvent 1122 versus 1121 volume per ruleFalling audit share over time
Warn override rateEvent 1129 per user per ruleInvestigate repeat overriders
Configuration driftEvent 5007 and agent health alertsEvery unplanned change investigated

Validate with authorised adversary emulation: run benign test cases for the mapped techniques in a lab ring and confirm each produces a block, not just an alert. The MITRE ATT&CK Coverage Mapping Guide covers how to record the results.

Framework mapping

FrameworkReferenceRelevance to M1040
NIST SP 800-53 Rev 5SI-3 Malicious Code Protection; SI-4 System Monitoring; SI-16 Memory ProtectionBehavioural blocking, monitoring and exploit mitigation
NIST CSF 2.0PR.PS-05; DE.CM-09Unauthorised execution prevented; runtime environments monitored
CIS Controls v8.1Control 10 Malware Defenses (including 10.5 anti-exploitation features)Endpoint anti-malware and exploit protection
ISO/IEC 27001:2022Annex A 8.7 Protection against malwareMalware and behaviour protection
MITRE D3FENDD3-RAPA, D3-SDA, D3-UDTA, D3-UGLPA, D3-WSAA, D3-ANET, D3-AZET, D3-JFAPARelated techniques in the D3FEND ontology

Related ATT&CK mitigations: M1038 Execution Prevention (allow-listing), M1050 Exploit Protection, M1042 Disable or Remove Feature or Program (see M1042 Disable or Remove Feature or Program) and M1043 Credential Access Protection.

Practitioner checklist

  • Export current EDR prevention settings and score each of the 51 M1040 relationships as Block, Audit or Off.
  • Enforce the three standard protection rules (LSASS, WMI persistence, vulnerable signed drivers) on all Windows devices.
  • Confirm the Vulnerable Driver Blocklist is on, and that cloud-delivered protection is enabled where rules depend on it.
  • Run remaining rules in audit, review event 1122, and write per-rule exclusions with an owner and expiry.
  • Enforce in rings, credential-holding servers and CI runners first.
  • Use one management plane for ASR policy and alert on event 5007.
  • Set Yama ptrace_scope to at least 1 on Linux servers that hold secrets.
  • Deny SSE-C in S3 bucket or IAM policy where it is not used, per ATT&CK's T1486 guidance.
  • Test with authorised emulation each quarter and record coverage against the ATT&CK rows.

Standards and references

Related NHI Mgmt Group resources: EDR Guide · Endpoint Hardening Checklist · T1055 Process Injection Defensive Guide · Credential Dumping Guide · M1041 Encrypt Sensitive Information

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 12 November 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org