Detection rules › Sigma

Python Spawning Pretty TTY on Windows

Status
test
Severity
high
Log source
product windows, category process_creation
Author
Nextron Systems
Source
github.com/SigmaHQ/sigma

Detects python spawning a pretty tty

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: Python Spawning Pretty TTY on Windows
id: 480e7e51-e797-47e3-8d72-ebfce65b6d8d
related:
    - id: 899133d5-4d7c-4a7f-94ee-27355c879d90
      type: derived
status: test
description: Detects python spawning a pretty tty
references:
    - https://www.volexity.com/blog/2022/06/02/zero-day-exploitation-of-atlassian-confluence/
author: Nextron Systems
date: 2022-06-03
tags:
    - attack.execution
    - attack.t1059
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        Image|endswith:
            - 'python.exe' # no \ bc of e.g. ipython.exe
            - 'python3.exe'
            - 'python2.exe'
    selection_cli_1:
        CommandLine|contains|all:
            - 'import pty'
            - '.spawn('
    selection_cli_2:
        CommandLine|contains: 'from pty import spawn'
    condition: selection_img and 1 of selection_cli_*
falsepositives:
    - Unknown
level: high

Stages and Predicates

Stage 0: condition

selection_img and 1 of selection_cli_*

Stage 1: selection_img

selection_img:
    Image|endswith:
        - 'python.exe'
        - 'python3.exe'
        - 'python2.exe'

Stage 2: selection_cli_1

selection_cli_1:
    CommandLine|contains|all:
        - 'import pty'
        - '.spawn('

Stage 3: selection_cli_2

selection_cli_2:
    CommandLine|contains: 'from pty import spawn'

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
  • .spawn(
  • from pty import spawn
  • import pty corpus 2 (sigma 2)
Imageends_with
  • python.exe corpus 2 (sigma 2)
  • python2.exe corpus 2 (sigma 2)
  • python3.exe corpus 2 (sigma 2)