{"id":"05b3e303-faf0-4f4a-9b30-46cc13e69152","title":"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","author":"frack113, Nasreddine Bencherchali (Nextron Systems)","status":"test","level":"medium","date":"2021-08-18","modified":"2023-05-04","tags":["attack.persistence","attack.privilege-escalation","attack.t1546.013"],"technique_ids":["T1546.013"],"logsource":{"product":"windows","category":"ps_script","definition":"Requirements: Script Block Logging must be enabled"},"falsepositives":["Legitimate administration and tuning scripts that aim to add functionality to a user PowerShell session"],"references":["https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1546.013/T1546.013.md"],"source_path":"rules/windows/powershell/powershell_script/posh_ps_user_profile_tampering.yml","source_sha256":"d6834f8e36c8cdfa2aaddbdec0a3ec097e91bebbb2ef7cfd1f50364c47f82e58","source_url":"https://github.com/anpa1200/sigma/blob/b249e9683190cffdcaf188ccbfb90bf4759844e1/rules/windows/powershell/powershell_script/posh_ps_user_profile_tampering.yml","license":"Detection Rule License 1.1","license_url":"https://github.com/SigmaHQ/Detection-Rule-License/blob/main/LICENSE.Detection.Rules.md","yaml":"title: Potential Persistence Via PowerShell User Profile Using Add-Content\nid: 05b3e303-faf0-4f4a-9b30-46cc13e69152\nstatus: test\ndescription: Detects calls to \"Add-Content\" cmdlet in order to modify the content of the user profile and potentially adding suspicious commands for persistence\nreferences:\n    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1546.013/T1546.013.md\nauthor: frack113, Nasreddine Bencherchali (Nextron Systems)\ndate: 2021-08-18\nmodified: 2023-05-04\ntags:\n    - attack.persistence\n    - attack.privilege-escalation\n    - attack.t1546.013\nlogsource:\n    product: windows\n    category: ps_script\n    definition: 'Requirements: Script Block Logging must be enabled'\ndetection:\n    selection_add:\n        ScriptBlockText|contains: 'Add-Content $profile'\n    selection_options:\n        ScriptBlockText|contains:\n            # Note: You can add more suspicious values\n            - '-Value \"IEX '\n            - '-Value \"Invoke-Expression'\n            - '-Value \"Invoke-WebRequest'\n            - '-Value \"Start-Process'\n            - \"-Value 'IEX \"\n            - \"-Value 'Invoke-Expression\"\n            - \"-Value 'Invoke-WebRequest\"\n            - \"-Value 'Start-Process\"\n    condition: all of selection_*\nfalsepositives:\n    - Legitimate administration and tuning scripts that aim to add functionality to a user PowerShell session\nlevel: medium\n","validation":"yaml_parsed_not_backend_compiled_or_live_validated","techniques":[{"key":"enterprise/T1546.013","id":"T1546.013","name":"PowerShell Profile","page":"techniques/enterprise/T1546.013/"}],"data_path":"data/detection-rules/05b3e303-faf0-4f4a-9b30-46cc13e69152.json","kind":"sigma"}
