CmdID

CmdID / Rules / Windows

Powershell Token Obfuscation - Process Creation

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

high 1 ATT&CK technique 1 everyday example trips it

What it looks for

its detection, as SigmaHQ writes it
detection:
  filter_main_envpath:
    CommandLine|contains: '${env:path}'
  selection:
    - CommandLine|re: '\w+`(?:\w+|-|.)`[\w+|\s]'
    - CommandLine|re: '"(?:\{\d\})+"\s*-f'
    - CommandLine|re: '(?i)\$\{`?e`?n`?v`?:`?p`?a`?t`?h`?\}'
  condition: selection and not 1 of filter_main_*

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

everyday examples from tldr-pages, CC BY 4.0, each read by CmdID

Get the scriptblock that defines a property for a specified object on the page for Get-TypeData

(Get-TypeData -TypeName System.DateTime).Members["DateTime"].GetScriptBlock if ((& { Set-StrictMode -Version 1; $this.DisplayHint }) -ieq "Date") { "{0}" -f $this.ToLongDateString() } elseif ((& { Set-StrictMode -Version 1; $this.DisplayHint }) -ieq "Time") { "{0}" -f $this.ToLongTimeString() } else { "{0} {1}" -f $this.ToLongDateString(), $this.ToLongTimeString() }Identify

ATT&CK

the techniques it is tagged with
T1027.009Obfuscated Files or Information: Embedded Payloads