Cross-source coverage
T1546.013 / ATT&CK
Event Triggered Execution: PowerShell Profile
5 rules across 3 sources.
From MITRE ATT&CK 19.2
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 supports several profiles depending on the user or host program. For example, there can be different profiles for PowerShell host programs such as the PowerShell console, PowerShell ISE or Visual Studio Code. An administrator can also configure a profile that applies to all users and host programs on the local computer.
Adversaries may modify these profiles to include arbitrary commands, functions, modules, and/or PowerShell drives to gain persistence. Every time a user opens a PowerShell session the modified script will be executed unless the -NoProfile flag is used when it is launched.
An adversary may also be able to escalate privileges if a script in a PowerShell profile is loaded and executed by an account with higher privileges, such as a domain administrator.
- Tactics
- Privilege Escalation · Persistence
- Platforms
- Windows
- Telemetry
-
WinEventLog:SysmonWinEventLog:PowerShell
How MITRE says to detect it DET0451
Detection Strategy for PowerShell Profile Persistence via profile.ps1 Modification
Windows Analytic 1245
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.
WinEventLog:SysmonEventCode=11WinEventLog:SysmonEventCode=2WinEventLog:SysmonEventCode=1WinEventLog:PowerShellExecution of PowerShell without -NoProfile flag
SigmaHQ/sigma
3 rules| Detection | Severity | Format |
|---|---|---|
| Potential Persistence Via PowerShell User Profile Using Add-Content | Medium | Sigma |
| PowerShell Profile Modification | Medium | Sigma |
| VsCode Powershell Profile Modification | Medium | Sigma |
elastic/detection-rules
1 rule| Detection | Severity | Format |
|---|---|---|
| Persistence via PowerShell profile | Medium | Elastic TOML |
socfortress/Wazuh-Rules
1 rule| Detection | Severity | Format |
|---|---|---|
| T1546.013 - PowerShell Profile modified: Potential persistence mechanism detected (Event Triggered Execution) | High | Wazuh XML |