Sigma rule: Potential Persistence Via PowerShell User Profile Using Add-Content

A detection rule from the SigmaHQ repository, shown as its author published it. Dataset version ref-ae3ec0b7c100, updated 2023-05-04T00:00:00.000Z.

Rule

Title
Potential Persistence Via PowerShell User Profile Using Add-Content
Status
test
Level
medium
Author
frack113, Nasreddine Bencherchali (Nextron Systems)
Date
2021-08-18
Modified
2023-05-04
File
rules/windows/powershell/powershell_script/posh_ps_user_profile_tampering.yml
Commit
ccbb0369507f796db0b0ae6854c8a2be471b9d84

Detects calls to "Add-Content" cmdlet in order to modify the content of the user profile and potentially adding suspicious commands for persistence

Log source

product
windows
category
ps_script
definition
Requirements: Script Block Logging must be enabled

Detection

selection_add:
    ScriptBlockText|contains: 'Add-Content $profile'
selection_options:
    ScriptBlockText|contains:
        # Note: You can add more suspicious values
        - '-Value "IEX '
        - '-Value "Invoke-Expression'
        - '-Value "Invoke-WebRequest'
        - '-Value "Start-Process'
        - "-Value 'IEX "
        - "-Value 'Invoke-Expression"
        - "-Value 'Invoke-WebRequest"
        - "-Value 'Start-Process"
condition: all of selection_*

False positives (as the rule lists them)

  • Legitimate administration and tuning scripts that aim to add functionality to a user PowerShell session

Tags

  • attack.persistence
  • attack.privilege-escalation
  • attack.t1546.013

MITRE ATT&CK ids this rule names

References

Read on 2026-11-03T00:58:21.399Z under licence sigma-drl-1.1@d5f4c36a from https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/windows/powershell/powershell_script/posh_ps_user_profile_tampering.yml

Sources and licences

  • SigmaHQ

    "Potential Persistence Via PowerShell User Profile Using Add-Content" by frack113, Nasreddine Bencherchali (Nextron Systems) (SigmaHQ). Rule: https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/windows/powershell/powershell_script/posh_ps_user_profile_tampering.yml.
    Licensed under the Detection Rule License (DRL) 1.1: https://github.com/SigmaHQ/Detection-Rule-License

    Detection Rule License (DRL) 1.1

Cite this page

Dragons Eye Ransomware Tracker, "Sigma rule: Potential Persistence Via PowerShell User Profile Using Add-Content",
entity page, dataset version ref-ae3ec0b7c100, updated 2023-05-04T00:00:00.000Z,
https://ransomware-tracker.com/detections/sigma/05b3e303-faf0-4f4a-9b30-46cc13e69152 (accessed 2026-11-03).
Underlying source: SigmaHQ rule 05b3e303-faf0-4f4a-9b30-46cc13e69152, commit ccbb0369507f796db0b0ae6854c8a2be471b9d84.

Pages change. The dataset version identifies the data, but no archive of old versions is kept, so this citation cannot be replayed later.