CmdID

CmdID / Rules / Windows

Change PowerShell Policies to an Insecure Level

A Sigma rule for process creation on Windows, by frack113.

medium 1 ATT&CK technique 4 programs it names

What it looks for

its detection, as SigmaHQ writes it
detection:
  filter_main_powershell_core:
    CommandLine|contains:
      - '-NoProfile -ExecutionPolicy Bypass -File "C:\Program Files\PowerShell\7\'
      - '-NoProfile -ExecutionPolicy Bypass -File "C:\Program Files (x86)\PowerShell\7\'
    ParentImage:
      - 'C:\Windows\SysWOW64\msiexec.exe'
      - 'C:\Windows\System32\msiexec.exe'
  filter_optional_avast:
    CommandLine|contains:
      - '-ExecutionPolicy ByPass -File "C:\Program Files\Avast Software\Avast'
      - '-ExecutionPolicy ByPass -File "C:\Program Files (x86)\Avast Software\Avast\'
    ParentImage|contains:
      - 'C:\Program Files\Avast Software\Avast\'
      - 'C:\Program Files (x86)\Avast Software\Avast\'
      - '\instup.exe'
  selection_img:
    - OriginalFileName:
        - 'powershell_ise.exe'
        - 'PowerShell.EXE'
        - 'pwsh.dll'
    - Image|endswith:
        - '\powershell_ise.exe'
        - '\powershell.exe'
        - '\pwsh.exe'
  selection_level:
    CommandLine|contains:
      - 'Bypass'
      - 'Unrestricted'
  selection_option:
    CommandLine|contains:
      - '-executionpolicy '
      - ' -ep '
      - ' -exec '
  condition: all of selection_* and not 1 of filter_main_* and not 1 of filter_optional_*

The rule’s detection, its selections and fields in order of name. The whole rule, with its references and false positives, is on SigmaHQ, by frack113, under the Detection Rule License 1.1. CmdID evaluates it on a command line alone: a test on what a command line cannot show, such as the parent process or the user, is not met.

Command lines that trip it

documented abuse, read by CmdID

The commands documented for cl_loadassembly.ps1, utilityfunctions.ps1 trip it: each is on its program’s page, read by CmdID.

Programs and files it names

their pages here

ATT&CK

the techniques it is tagged with
T1059.001Command and Scripting Interpreter: PowerShell