How the attack works
Microsoft Intune runs code on managed Windows devices through the Intune management extension. A platform script (a PowerShell script uploaded under Devices > Scripts and remediations) runs in the system context when Run this script using the logged on credentials is set to No. Remediations are script packages that run on a schedule, and Win32 apps install with the install behavior System. No user has to be signed in; the device only has to check in.
Whoever can create and assign these objects therefore has code execution on every device in the assignment: an Intune Administrator, a holder of an Intune role with the Device configurations or Mobile apps permissions, or an application with a device-management Microsoft Graph permission. Attackers who take over such an identity use the organization's own deployment channel instead of bringing a tool. The rules read the Intune audit log, which reaches a SIEM only after an Intune diagnostic setting (category AuditLogs) sends it to a Log Analytics workspace or an event hub.
What an attacker needs
- Control of an identity that can create or assign scripts, remediations or apps in Intune: the Intune Administrator role, an Intune role such as Policy and Profile Manager or Application Manager, or an application holding
DeviceManagementScripts.ReadWrite.All,DeviceManagementConfiguration.ReadWrite.AllorDeviceManagementApps.ReadWrite.All. - Target devices that are enrolled in Intune and inside the scope groups of that identity's role assignment.
- No Multi Admin Approval access policy for scripts and apps, or a second compromised approver.
Impact
Code execution as SYSTEM on every targeted device, which is enough to read the credentials and tokens of the people who use it, turn off protections and stay on the device. When the assignment includes administrators' workstations, the attacker reaches the privileged sessions on them. Because the channel is the management platform itself, one assignment can reach the whole fleet within one check-in cycle.
Detection rules
Intune App Assigned to All Devices or All Users
Detects a successful app assignment in the Intune audit log whose target is the built-in All devices or All users group. The assignment target type (allDevicesAssignmentTarget or allLicensedUsersAssignmentTarget in Microsoft Graph) is matched as text in the modified properties under Properties.Targets. Microsoft does not publish the operation names or the layout of the modified properties. Confirmed: Splunk Threat Research searches app events by the text MobileApp in the operation name, and its sample events show modified properties (Name, Old, New) under Targets. Inferred from the Microsoft Graph resource type names: that assignments are named MobileAppAssignment and that the target type appears as text in the modified properties. Confirm both with a test assignment in your tenant.
title: Intune App Assigned to All Devices or All Users
id: f79d0d06-1bd9-43df-902d-d16fee074113
status: experimental
description: >-
Detects a successful app assignment in the Intune audit log whose target is
the built-in All devices or All users group. The assignment target type
(allDevicesAssignmentTarget or allLicensedUsersAssignmentTarget in Microsoft
Graph) is matched as text in the modified properties under Properties.Targets.
Microsoft does not publish the operation names or the layout of the modified
properties. Confirmed: Splunk Threat Research searches app events by the text
MobileApp in the operation name, and its sample events show modified
properties (Name, Old, New) under Targets. Inferred from the Microsoft Graph
resource type names: that assignments are named MobileAppAssignment and that
the target type appears as text in the modified properties. Confirm both
with a test assignment in your tenant.
references:
- https://attack.mitre.org/techniques/T1072/
- https://learn.microsoft.com/en-us/intune/app-management/deployment/add-win32
- https://learn.microsoft.com/en-us/graph/api/resources/intune-shared-alldevicesassignmenttarget
- https://learn.microsoft.com/en-us/intune/governance/integrate-azure-monitor
- https://research.splunk.com/cloud/98e6b389-2806-4426-a580-8a92cb0d9710/
author: Forestall
date: 2026-11-11
tags:
- attack.execution
- attack.lateral-movement
- attack.t1072
logsource:
product: intune
service: audit
detection:
selection:
OperationName|contains: MobileAppAssignment
ResultType: Success
Properties.Targets|contains:
- AllDevicesAssignmentTarget
- AllLicensedUsersAssignmentTarget
condition: selection
falsepositives:
- Tenant-wide deployment of standard software such as the Company Portal or Microsoft 365 Apps; filter the approved application IDs in Properties.TargetObjectIds.
level: medium
False positives
- Tenant-wide deployment of standard software such as the Company Portal or Microsoft 365 Apps; filter the approved application IDs in Properties.TargetObjectIds.
Intune Platform Script or Remediation Created, Changed or Assigned
Detects a successful operation on a Windows platform script (deviceManagementScript) or a remediation script package (deviceHealthScript) in the Intune audit log: create, update, assign or delete. Microsoft does not publish the list of OperationName values, so the rule matches the Microsoft Graph resource type inside the name. Confirmed: the name createDeviceHealthScript DeviceHealthScript is in the sample events of Splunk Threat Research, which searches remediations by the text DeviceHealthScript. Inferred from the Graph resource type name: that platform script events contain DeviceManagementScript; no Microsoft or Splunk sample shows one, so confirm it in your tenant. The event names the object, not the script body.
title: Intune Platform Script or Remediation Created, Changed or Assigned
id: 0ca20455-227a-4ceb-a4a1-086bb35bca75
status: experimental
description: >-
Detects a successful operation on a Windows platform script
(deviceManagementScript) or a remediation script package (deviceHealthScript)
in the Intune audit log: create, update, assign or delete. Microsoft does not
publish the list of OperationName values, so the rule matches the Microsoft
Graph resource type inside the name. Confirmed: the name
createDeviceHealthScript DeviceHealthScript is in the sample events of Splunk
Threat Research, which searches remediations by the text DeviceHealthScript.
Inferred from the Graph resource type name: that platform script events
contain DeviceManagementScript; no Microsoft or Splunk sample shows one, so
confirm it in your tenant. The event names the object, not the script body.
references:
- https://attack.mitre.org/techniques/T1072/
- https://learn.microsoft.com/en-us/intune/device-management/tools/run-powershell-scripts-windows
- https://learn.microsoft.com/en-us/intune/device-management/tools/deploy-remediations
- https://learn.microsoft.com/en-us/intune/governance/integrate-azure-monitor
- https://research.splunk.com/cloud/6fe42e07-15b1-4caa-b547-7885666cb1bd/
author: Forestall
date: 2026-11-11
tags:
- attack.execution
- attack.lateral-movement
- attack.t1072
logsource:
product: intune
service: audit
detection:
selection:
OperationName|contains:
- DeviceManagementScript
- DeviceHealthScript
ResultType: Success
condition: selection
falsepositives:
- Planned script and remediation changes by the endpoint team; require a change record and filter the accounts that deploy through an approved pipeline by Identity.
- Assignment of the remediation packages that Microsoft ships with Intune.
level: medium
False positives
- Planned script and remediation changes by the endpoint team; require a change record and filter the accounts that deploy through an approved pipeline by Identity.
- Assignment of the remediation packages that Microsoft ships with Intune.
Triage
- Identify the actor (Identity, and Actor in Properties) and the object (TargetDisplayNames and TargetObjectIds in Properties); an application or a delegated partner admin as actor needs extra scrutiny.
- Read the script or app itself in the Intune admin center, including its run context, and compare it with a change record; the audit event does not contain the script body.
- Check the assignment (which groups, all devices or all users) and which devices have already run it in the device status report of the script or app.
- If unauthorized, remove the assignment first, then the object, revoke the actor's sessions and treat every device that ran it as compromised.
Response
Once the attack is confirmed:
- Save a copy of the script or app package and its assignment before you remove them. The audit event does not contain the script body, so the copy is the evidence of what ran.
- For a remediation, remove the assignment quickly. Remediations run on a schedule, so the code runs again on each device until the assignment is gone.
- Take the actor's Intune role, or the application's device-management permission, away in addition to revoking sessions.
- Isolate the devices that ran the script or app and rebuild them, starting with administrators' workstations.
- Reset the credentials and revoke the sessions of the people who used those devices since the deployment. Code that ran as SYSTEM could read their credentials and tokens.
- Review the other scripts, remediations and apps created or changed by the same actor, and their assignments.
Mitigation
- Create Multi Admin Approval access policies for Scripts and Apps, so a second administrator must approve every new or changed script and app deployment.
- Give script and app permissions to few people through Intune roles with narrow scope groups and scope tags, not through the Intune Administrator role.
- Keep privileged access workstations outside the scope groups of general Intune role assignments.
- Turn on Enforce script signature check where a signing process exists, and review who can sign.
- Send the Intune audit log to your SIEM and alert on new scripts, remediations and assignments to all devices or all users.
Frequently asked questions
Does the audit event contain the script that was deployed?
No. The event names the object and the actor, not the script body. Read the script or app in the Intune admin center, including its run context, and compare it with a change record. Save a copy before you remove a malicious object.
Does a user have to be signed in for the script to run?
No. The Intune management extension runs platform scripts, remediations and Win32 apps on the device, and the device only has to check in. A platform script runs in the system context when the option to run it with the logged on credentials is set to No.
Does the app rule see an assignment to an ordinary group?
No. It matches app assignments whose target is the built-in All devices or All users group. An assignment to a specific group, including one that contains administrators' workstations, is not matched. Review app assignments by unusual actors in the Intune audit log as well.
How quickly can a malicious assignment spread?
The channel is the management platform itself, so one assignment can reach every targeted device within one check-in cycle. That is why the first step is to remove the assignment, before the object is deleted and before the investigation is complete.
References
- MITRE ATT&CK T1072: Software Deployment Tools
- Microsoft Learn: Use PowerShell scripts on Windows devices in Intune
- Microsoft Learn: Remediations
- Microsoft Learn: Add, assign and monitor a Win32 app in Microsoft Intune
- Microsoft Learn: Use access policies to require multi admin approval
- Microsoft Learn: Use audit logs to track and monitor events in Microsoft Intune