Detection rules › Sigma

PsExec/PAExec Escalation to LOCAL SYSTEM

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

Detects suspicious commandline flags used by PsExec and PAExec to escalate a command line to LOCAL_SYSTEM rights

MITRE ATT&CK coverage

TacticTechniques
Resource DevelopmentT1587.001 Develop Capabilities: Malware

Event coverage

Rule body yaml

title: PsExec/PAExec Escalation to LOCAL SYSTEM
id: 8834e2f7-6b4b-4f09-8906-d2276470ee23
related:
    - id: 207b0396-3689-42d9-8399-4222658efc99 # Generic rule based on similar cli flags
      type: similar
status: test
description: Detects suspicious commandline flags used by PsExec and PAExec to escalate a command line to LOCAL_SYSTEM rights
references:
    - https://learn.microsoft.com/en-us/sysinternals/downloads/psexec
    - https://www.poweradmin.com/paexec/
    - https://www.fireeye.com/blog/threat-research/2020/10/kegtap-and-singlemalt-with-a-ransomware-chaser.html
author: Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems)
date: 2021-11-23
modified: 2024-03-05
tags:
    - attack.resource-development
    - attack.t1587.001
logsource:
    category: process_creation
    product: windows
detection:
    selection_sys: # Escalation to LOCAL_SYSTEM
        CommandLine|contains|windash:
            # Note that you don't need to add the ".exe" part when using psexec/paexec
            # The "-" can also be replaced with "/"
            # The order of args isn't important
            # "cmd" can be replaced by "powershell", "pwsh" or any other console like software
            - ' -s cmd'
            - ' -s -i cmd'
            - ' -i -s cmd'
            # Pwsh (For PowerShell 7)
            - ' -s pwsh'
            - ' -s -i pwsh'
            - ' -i -s pwsh'
            # PowerShell (For PowerShell 5)
            - ' -s powershell'
            - ' -s -i powershell'
            - ' -i -s powershell'
    selection_other:
        CommandLine|contains:
            - 'psexec'
            - 'paexec'
            - 'accepteula'
    condition: all of selection_*
falsepositives:
    - Admins that use PsExec or PAExec to escalate to the SYSTEM account for maintenance purposes (rare)
    - Users that debug Microsoft Intune issues using the commands mentioned in the official documentation; see https://learn.microsoft.com/en-us/mem/intune/apps/intune-management-extension
level: high

Stages and Predicates

Stage 0: condition

all of selection_*

Stage 1: selection_sys

selection_sys:
    CommandLine|contains|windash:
        - ' -s cmd'
        - ' -s -i cmd'
        - ' -i -s cmd'
        - ' -s pwsh'
        - ' -s -i pwsh'
        - ' -i -s pwsh'
        - ' -s powershell'
        - ' -s -i powershell'
        - ' -i -s powershell'

Stage 2: selection_other

selection_other:
    CommandLine|contains:
        - 'psexec'
        - 'paexec'
        - 'accepteula'

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
  • -i -s cmd transforms: windash corpus 2 (sigma 2)
  • -i -s powershell transforms: windash corpus 2 (sigma 2)
  • -i -s pwsh transforms: windash corpus 2 (sigma 2)
  • -s -i cmd transforms: windash corpus 2 (sigma 2)
  • -s -i powershell transforms: windash corpus 2 (sigma 2)
  • -s -i pwsh transforms: windash corpus 2 (sigma 2)
  • -s cmd transforms: windash corpus 2 (sigma 2)
  • -s powershell transforms: windash corpus 2 (sigma 2)
  • -s pwsh transforms: windash corpus 2 (sigma 2)
  • accepteula corpus 7 (sigma 3, kusto 3, splunk 1)
  • paexec
  • psexec