Shell Invocation Via Ssh - Linux

Detects the use of the "ssh" utility to execute a shell. Such behavior may be associated with privilege escalation, unauthorized command execution, or to break out from restricted environments.

Sigma rule (View on GitHub)

 1title: Shell Invocation Via Ssh - Linux
 2id: 8737b7f6-8df3-4bb7-b1da-06019b99b687
 3status: test
 4description: |
 5        Detects the use of the "ssh" utility to execute a shell. Such behavior may be associated with privilege escalation, unauthorized command execution, or to break out from restricted environments.
 6references:
 7    - https://gtfobins.github.io/gtfobins/ssh/
 8    - https://github.com/elastic/detection-rules/blob/0aacc5e19292f764a002ea2093b2a076db35b589/rules/_deprecated/execution_shell_evasion_linux_binary.toml
 9author: Li Ling, Andy Parkidomo, Robert Rakowski, Blake Hartstein (Bloomberg L.P.)
10date: 2024-08-29
11tags:
12    - attack.execution
13    - attack.t1059
14logsource:
15    category: process_creation
16    product: linux
17detection:
18    selection_img:
19        Image|endswith: '/ssh'
20        CommandLine|contains:
21            - 'ProxyCommand=;'
22            - 'permitlocalcommand=yes'
23            - 'localhost'
24    selection_cli:
25        CommandLine|contains:
26            - '/bin/bash'
27            - '/bin/dash'
28            - '/bin/fish'
29            - '/bin/sh'
30            - '/bin/zsh'
31            - 'sh 0<&2 1>&2'
32            - 'sh 1>&2 0<&2'
33    condition: all of selection_*
34falsepositives:
35    - Unknown
36level: high

References

Related rules

to-top