Change PowerShell Policies to an Insecure Level
Detects changing the PowerShell script execution policy to a potentially insecure level using the "-ExecutionPolicy" flag.
Convert In Phoenix Studio
Open this Sigma rule in the converter with the YAML preloaded and ready for backend selection.
Events generated when a new process is spawned on the system. Covers command-line arguments, parent/child relationships, and process metadata.
detection:
selection_img:
- OriginalFileName:
- 'powershell_ise.exe'
- 'PowerShell.EXE'
- 'pwsh.dll'
- Image|endswith:
- '\powershell_ise.exe'
- '\powershell.exe'
- '\pwsh.exe'
selection_option:
CommandLine|contains:
- '-executionpolicy '
- ' -ep '
- ' -exec '
selection_level:
CommandLine|contains:
- 'Bypass'
- 'Unrestricted'
filter_main_powershell_core:
ParentImage:
- 'C:\Windows\SysWOW64\msiexec.exe'
- 'C:\Windows\System32\msiexec.exe'
CommandLine|contains:
- '-NoProfile -ExecutionPolicy Bypass -File "C:\Program Files\PowerShell\7\'
- '-NoProfile -ExecutionPolicy Bypass -File "C:\Program Files (x86)\PowerShell\7\'
filter_optional_avast:
ParentImage|contains:
- 'C:\Program Files\Avast Software\Avast\'
- 'C:\Program Files (x86)\Avast Software\Avast\'
- '\instup.exe'
CommandLine|contains:
- '-ExecutionPolicy ByPass -File "C:\Program Files\Avast Software\Avast'
- '-ExecutionPolicy ByPass -File "C:\Program Files (x86)\Avast Software\Avast\'
condition: all of selection_* and not 1 of filter_main_* and not 1 of filter_optional_*Administrator scripts
Tactics
Sub-techniques
Potential PowerShell Execution Policy Tampering - ProcCreation
Detects changes to the PowerShell execution policy registry key in order to bypass signing requirements for script execution from the CommandLine
Detects similar activity. Both rules may fire on overlapping events.
Change PowerShell Policies to an Insecure Level - PowerShell
Detects changing the PowerShell script execution policy to a potentially insecure level using the "Set-ExecutionPolicy" cmdlet.
Detects similar activity. Both rules may fire on overlapping events.
Potential PowerShell Execution Policy Tampering
Detects changes to the PowerShell execution policy in order to bypass signing requirements for script execution
Detects similar activity. Both rules may fire on overlapping events.