CmdID

CmdID / Rules / Windows

Csc.EXE Execution Form Potentially Suspicious Parent

A Sigma rule for process creation on Windows, by Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems), X__Junior (Nextron Systems).

high 4 ATT&CK techniques 5 programs it names

What it looks for

its detection, as SigmaHQ writes it
detection:
  filter_main_programfiles:
    ParentImage|startswith:
      - 'C:\Program Files (x86)\'
      - 'C:\Program Files\'
  filter_main_sdiagnhost:
    ParentImage: 'C:\Windows\System32\sdiagnhost.exe'
  filter_main_w3p:
    ParentImage: 'C:\Windows\System32\inetsrv\w3wp.exe'
  filter_optional_ansible:
    ParentCommandLine|contains:
      - 'JwB7ACIAZgBhAGkAbABlAGQAIgA6AHQAcgB1AGUALAAiAG0AcwBnACIAOgAiAEEAbgBzAGkAYgBsAGUAIAByAGUAcQB1AGkAcgBlAHMAIABQAG8AdwBlAHIAUwBoAGUAbABsACAAdgAzAC4AMAAgAG8AcgAgAG4AZQB3AGUAcgAiAH0AJw'
      - 'cAewAiAGYAYQBpAGwAZQBkACIAOgB0AHIAdQBlACwAIgBtAHMAZwAiADoAIgBBAG4AcwBpAGIAbABlACAAcgBlAHEAdQBpAHIAZQBzACAAUABvAHcAZQByAFMAaABlAGwAbAAgAHYAMwAuADAAIABvAHIAIABuAGUAdwBlAHIAIgB9ACcA'
      - 'nAHsAIgBmAGEAaQBsAGUAZAAiADoAdAByAHUAZQAsACIAbQBzAGcAIgA6ACIAQQBuAHMAaQBiAGwAZQAgAHIAZQBxAHUAaQByAGUAcwAgAFAAbwB3AGUAcgBTAGgAZQBsAGwAIAB2ADMALgAwACAAbwByACAAbgBlAHcAZQByACIAfQAnA'
  filter_optional_chocolatey:
    ParentImage: 'C:\ProgramData\chocolatey\choco.exe'
  filter_optional_defender:
    ParentCommandLine|contains: '\ProgramData\Microsoft\Windows Defender Advanced Threat Protection'
  selection_img:
    - Image|endswith: '\csc.exe'
    - OriginalFileName: 'csc.exe'
  selection_parent_generic:
    ParentImage|endswith:
      - '\cscript.exe'
      - '\excel.exe'
      - '\mshta.exe'
      - '\onenote.exe'
      - '\outlook.exe'
      - '\powerpnt.exe'
      - '\winword.exe'
      - '\wscript.exe'
  selection_parent_powershell:
    ParentCommandLine|contains:
      - '-Encoded '
      - 'FromBase64String'
    ParentImage|endswith:
      - '\powershell.exe'
      - '\pwsh.exe'
  selection_parent_susp_location:
    - ParentCommandLine|re: '(?:[Pp]rogram[Dd]ata|%(?:[Ll]ocal)?[Aa]pp[Dd]ata%|\\[Aa]pp[Dd]ata\\(?:[Ll]ocal(?:[Ll]ow)?|[Rr]oaming))\\[^\\]{1,256}$'
    - ParentCommandLine|contains:
        - ':\PerfLogs\'
        - ':\Users\Public\'
        - ':\Windows\Temp\'
        - '\Temporary Internet'
    - ParentCommandLine|contains|all:
        - ':\Users\'
        - '\Favorites\'
    - ParentCommandLine|contains|all:
        - ':\Users\'
        - '\Favourites\'
    - ParentCommandLine|contains|all:
        - ':\Users\'
        - '\Contacts\'
    - ParentCommandLine|contains|all:
        - ':\Users\'
        - '\Pictures\'
  condition: selection_img and 1 of selection_parent_* 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 Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems), X__Junior (Nextron Systems), 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.

None of the everyday examples and documented commands on CmdID’s program pages trips it. To see whether a command line does, paste it into CmdID.

Programs and files it names

their pages here

ATT&CK

the techniques it is tagged with
T1027.004Obfuscated Files or Information: Compile After Delivery
T1059.005Command and Scripting Interpreter: Visual Basic
T1059.007Command and Scripting Interpreter: JavaScript
T1218.005System Binary Proxy Execution: Mshta