Detection rules › Sigma

Suspicious RunAs-Like Flag Combination

Status
test
Severity
medium
Log source
product windows, category process_creation
Author
Florian Roth (Nextron Systems)
Source
github.com/SigmaHQ/sigma

Detects suspicious command line flags that let the user set a target user and command as e.g. seen in PsExec-like tools

MITRE ATT&CK coverage

TacticTechniques
Privilege EscalationNo specific technique

Event coverage

Rule body yaml

title: Suspicious RunAs-Like Flag Combination
id: 50d66fb0-03f8-4da0-8add-84e77d12a020
status: test
description: Detects suspicious command line flags that let the user set a target user and command as e.g. seen in PsExec-like tools
references:
    - https://www.trendmicro.com/en_us/research/22/k/hack-the-real-box-apt41-new-subgroup-earth-longzhi.html
author: Florian Roth (Nextron Systems)
date: 2022-11-11
tags:
    - attack.privilege-escalation
logsource:
    category: process_creation
    product: windows
detection:
    selection_user:
        CommandLine|contains:
            - ' -u system '
            - ' --user system '
            - ' -u NT'
            - ' -u "NT'
            - " -u 'NT"
            - ' --system '
            - ' -u administrator '
    selection_command:
        CommandLine|contains:
            - ' -c cmd'
            - ' -c "cmd'
            - ' -c powershell'
            - ' -c "powershell'
            - ' --command cmd'
            - ' --command powershell'
            - ' -c whoami'
            - ' -c wscript'
            - ' -c cscript'
    condition: all of selection*
falsepositives:
    - Unknown
level: medium

Stages and Predicates

Stage 0: condition

all of selection*

Stage 1: selection_user

selection_user:
    CommandLine|contains:
        - ' -u system '
        - ' --user system '
        - ' -u NT'
        - ' -u "NT'
        - " -u 'NT"
        - ' --system '
        - ' -u administrator '

Stage 2: selection_command

selection_command:
    CommandLine|contains:
        - ' -c cmd'
        - ' -c "cmd'
        - ' -c powershell'
        - ' -c "powershell'
        - ' --command cmd'
        - ' --command powershell'
        - ' -c whoami'
        - ' -c wscript'
        - ' -c cscript'

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
CommandLinematch
  • --command cmd
  • --command powershell
  • --system
  • --user system
  • -c "cmd
  • -c "powershell
  • -c cmd
  • -c cscript
  • -c powershell
  • -c whoami
  • -c wscript
  • -u "NT
  • -u 'NT
  • -u NT
  • -u administrator
  • -u system