Has used PowerShell profiles to maintain persistence on an infected machine.1
PowerShell Profile T1546.013
- Tactics
- Persistence, Privilege Escalation
- Platform
- Windows
- Version
- 1.2
- Created
- 24 January 2020
- Last modified
- 24 October 2025
- Contributors
- Allen DeRyke, ICE; Matt Green, @mgreen27
Adversaries may gain persistence and elevate privileges by executing malicious content triggered by PowerShell profiles. A PowerShell profile (profile.ps1) is a script that runs when PowerShell starts and can be used as a logon script to customize user environments.
PowerShell Profile MITRE reference T1546.013
1 group has been recorded using this technique. Newest first; each entry carries MITRE’s procedure text and a link to the group’s full record. Click a name to filter the rules below.
All 1 groups for this technique
Offense vs defense T1546.013
Is defensive coverage keeping up with adversary use? Eight counts, each ranked against all 697 ATT&CK techniques. Attack sits left, defense right, so a shape leaning left means adversaries are better documented here than defenders are equipped. Hover any spoke for its percentile and the share of techniques that have more. The timeline below shows when each side arrived.
How it got here
Adversary activity (campaign spans) over cumulative rule output. Each source is plotted independently from zero, so neither line includes the other. Campaign dates are year-granularity.
PowerShell Profile detection strategy DET0451
MITRE names one behaviour worth catching for this technique and breaks it into 1 analytic, one per platform. Each carries the log sources it needs and the fields you tune per environment.
Detection Strategy for PowerShell Profile Persistence via profile.ps1 Modification
AN1245 · Windows
Defenders can identify PowerShell profile-based persistence by correlating file creation or modification in known profile locations with subsequent PowerShell process launches that do not use the -NoProfile flag. Profile scripts loading unusual modules or launching external programs, particularly under elevated contexts, are suspicious and may represent adversary persistence or privilege escalation.
Log sources
The data this analytic draws on. You do not need every component — each one you already collect covers part of it. Each links to its ATT&CK record.
| Data component | Name | Channel |
|---|---|---|
| Process CreationDC0032 | WinEventLog:Sysmon | EventCode=1 |
| File CreationDC0039 | WinEventLog:Sysmon | EventCode=11 |
| File ModificationDC0061 | WinEventLog:Sysmon | EventCode=2 |
| Command ExecutionDC0064 | WinEventLog:PowerShell | Execution of PowerShell without -NoProfile flag |
Tunable fields
MITRE calls these the analytic’s mutable elements: the thresholds and filters you set for your own environment.
| Field | What you tune |
|---|---|
| ProfilePathList | Custom PowerShell host profiles or redirection to alternate profile paths |
| ExecutionContext | Whether profile execution occurs under elevated user (e.g., Administrator, SYSTEM) |
| ModuleOrScriptName | Specific modules or external programs loaded within profile |
| TimeWindow | Correlation time between profile modification and PowerShell process start |
Enforce execution of only signed PowerShell scripts. Sign profiles to avoid them from being modified.
Making PowerShell profiles immutable and only changeable by certain administrators will limit the ability for adversaries to easily create user level persistence.
Avoid PowerShell profiles if not needed. Use the -No Profile flag with when executing PowerShell scripts remotely to prevent local profiles and scripts from being executed.
Tests from Atomic Red Team (MIT licence) · technique definition