Event Triggered Execution: PowerShell Profile T1546.013

Tactics: Privilege Escalation, Persistence

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.

Events covered

2 catalog events are tagged with this technique by at least one rule.

Authoring guide

Patterns shared across the 4 rules above: which fields they filter on, what specific values they look for, and what they exclude. The catalog normalizes field names across vendors so Sigma's Image, Elastic's process.name, and Splunk's process_name collapse into one row. Each rule contributes at most once per row.

Fields filtered most (4 distinct)

The fields most rules look at when detecting this technique. The How column shows the operators authors use (eq, wildcard, regex_match, match) and how often each appears. Sample values are concrete examples to start from, not an exhaustive list.

FieldRulesHowSample values
TargetFilename3ends_with 2, wildcard 1?:\users\*\documents\powershell\*.ps1, ?:\users\*\documents\windowspowershell\*.ps1, ?:\windows\system32\windowspowershell\*.ps1, \microsoft.powershell_profile.ps1, \microsoft.vscode_profile.ps1
ScriptBlockText1contains 1-value "iex , -value "invoke-expression, -value "invoke-webrequest
event.type1ne 1deletion
file.name1eq 1Microsoft.Powershell_profile.ps1, profile.ps1

Top indicator values (25 distinct)

Specific (field, operator, value) combinations the rules check for, ranked by how many rules under this technique use each one. The Corpus reach column counts how many rules across the entire catalog (any technique) check the same combination. High numbers point to widely-used indicators that are likely noisy on their own; combine them with another condition for useful signal. Blank means the combination is specific to rules under this technique. Click a value to expand the rules under this technique that use it.

FieldKindValueRules (here)Corpus reach
ScriptBlockTextcontains
-value "iex
1
ScriptBlockTextcontains
-value "invoke-expression
1
ScriptBlockTextcontains
-value "invoke-webrequest
1
ScriptBlockTextcontains
-value "start-process
1
ScriptBlockTextcontains
-value 'iex
1
ScriptBlockTextcontains
-value 'invoke-expression
1
ScriptBlockTextcontains
-value 'invoke-webrequest
1
ScriptBlockTextcontains
-value 'start-process
1
ScriptBlockTextcontains
add-content $profile
1
TargetFilenameends_with
\microsoft.powershell_profile.ps1
1
TargetFilenameends_with
\microsoft.vscode_profile.ps1
1
TargetFilenameends_with
\powershell\profile.ps1
1
TargetFilenameends_with
\program files\powershell\7-preview\profile.ps1
1
TargetFilenameends_with
\program files\powershell\7\profile.ps1
1
TargetFilenameends_with
\windows\system32\windowspowershell\v1.0\profile.ps1
1
TargetFilenameends_with
\windowspowershell\profile.ps1
1
TargetFilenamewildcard
?:\users\*\documents\powershell\*.ps1
1
TargetFilenamewildcard
?:\users\*\documents\windowspowershell\*.ps1
1
TargetFilenamewildcard
?:\windows\system32\windowspowershell\*.ps1
1
TargetFilenamewildcard
\device\harddiskvolume*\users\*\documents\powershell\*.ps1
1
TargetFilenamewildcard
\device\harddiskvolume*\users\*\documents\windowspowershell\*.ps1
1
TargetFilenamewildcard
\device\harddiskvolume*\windows\system32\windowspowershell\*.ps1
1
event.typene
deletion
128
file.nameeq
Microsoft.Powershell_profile.ps1
1
file.nameeq
profile.ps1
1

Rules under this technique

Every rule in the catalog tagged with this technique, grouped by vendor. Click a rule title for its full predicates, exclusions, and indicators.

Platform (all)
Domain (all)

Sigma 3 rules

Elastic 1 rule