Python Spawning Pretty TTY Via PTY Module
Detects a python process calling to the PTY module in order to spawn a pretty tty which could be indicative of potential reverse shell activity.
Detection logic
selection_img
- Image|endswith:
- /python
- /python2
- /python3
- Image|contains:
- /python2.
- /python3.selection_cli_import
CommandLine|contains:
- import pty
- "from pty "selection_cli_spawn
CommandLine|contains: spawnCondition
all of selection_*Raw YAML
title: Python Spawning Pretty TTY Via PTY Module
id: c4042d54-110d-45dd-a0e1-05c47822c937
related:
- id: 32e62bc7-3de0-4bb1-90af-532978fe42c0
type: similar
status: test
description: |
Detects a python process calling to the PTY module in order to spawn a pretty tty which could be indicative of potential reverse shell activity.
references:
- https://www.volexity.com/blog/2022/06/02/zero-day-exploitation-of-atlassian-confluence/
author: Nextron Systems
date: 2022-06-03
modified: 2024-11-04
tags:
- attack.execution
- attack.t1059
logsource:
category: process_creation
product: linux
detection:
selection_img:
- Image|endswith:
- '/python'
- '/python2'
- '/python3'
- Image|contains:
- '/python2.' # python image is always of the form ../python3.10; ../python is just a symlink
- '/python3.'
selection_cli_import:
CommandLine|contains:
- 'import pty'
- 'from pty '
selection_cli_spawn:
CommandLine|contains: 'spawn'
condition: all of selection_*
falsepositives:
- Unknown
level: mediumFalse positives
- Unknown
References
Related rules
Similar rules
Atlassian Confluence CVE-2022-26134
highlinux · Shares T1059
Capsh Shell Invocation - Linux
highlinux · Shares T1059
CVE-2023-22518 Exploitation Attempt - Suspicious Confluence Child Process (Linux)
highlinux · Shares T1059
Inline Python Execution - Spawn Shell Via OS System Library
highlinux · Shares T1059