Detection rules › Sigma

Suspicious PsExec Execution

Status
test
Severity
high
Log source
product windows, service security
Author
Samir Bousseaden
Source
github.com/SigmaHQ/sigma

detects execution of psexec or paexec with renamed service name, this rule helps to filter out the noise if psexec is used for legit purposes or if attacker uses a different psexec client other than sysinternal one

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: Suspicious PsExec Execution
id: c462f537-a1e3-41a6-b5fc-b2c2cef9bf82
status: test
description: detects execution of psexec or paexec with renamed service name, this rule helps to filter out the noise if psexec is used for legit purposes or if attacker uses a different psexec client other than sysinternal one
references:
    - https://web.archive.org/web/20230329171218/https://blog.menasec.net/2019/02/threat-hunting-3-detecting-psexec.html
author: Samir Bousseaden
date: 2019-04-03
modified: 2022-08-11
tags:
    - attack.lateral-movement
    - attack.t1021.002
logsource:
    product: windows
    service: security
    definition: 'The advanced audit policy setting "Object Access > Audit Detailed File Share" must be configured for Success/Failure'
detection:
    selection1:
        EventID: 5145
        ShareName: '\\\\\*\\IPC$' # looking for the string \\*\IPC$
        RelativeTargetName|endswith:
            - '-stdin'
            - '-stdout'
            - '-stderr'
    filter:
        RelativeTargetName|startswith: 'PSEXESVC'
    condition: selection1 and not filter
falsepositives:
    - Unknown
level: high

Stages and Predicates

Stage 0: condition

selection1 and not filter

Stage 1: selection1

selection1:
    EventID: 5145
    ShareName: '\\\\\*\\IPC$'
    RelativeTargetName|endswith:
        - '-stdin'
        - '-stdout'
        - '-stderr'

Stage 2: not filter

filter:
    RelativeTargetName|startswith: 'PSEXESVC'

Exclusions

Top-level NOT(...) conjuncts: predicates this rule actively suppresses.

FieldKindExcluded values
RelativeTargetNamestarts_withPSEXESVC

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
RelativeTargetNameends_with
  • -stderr
  • -stdin
  • -stdout
ShareNameeq
  • \\\\\*\\IPC$ corpus 7 (sigma 7)