Potential Persistence Via PowerShell User Profile Using Add-Content
Description
Detects calls to "Add-Content" cmdlet in order to modify the content of the user profile and potentially adding suspicious commands for persistence
Query · sigma
selection_add: ScriptBlockText|contains: Add-Content $profile selection_options: ScriptBlockText|contains: - '-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_*
Known false positives
- Legitimate administration and tuning scripts that aim to add functionality to a user PowerShell session