Shell Invocation Via Ssh - Linux

 Original Source: [Sigma source]
Title: Shell Invocation Via Ssh - Linux
Status: test
Description: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.
References:
  -https://gtfobins.github.io/gtfobins/ssh/
  -https://github.com/elastic/detection-rules/blob/0aacc5e19292f764a002ea2093b2a076db35b589/rules/_deprecated/execution_shell_evasion_linux_binary.toml
Author: Li Ling, Andy Parkidomo, Robert Rakowski, Blake Hartstein (Bloomberg L.P.)
Date: 2024-08-29
modified:None
Tags:
  • -'attack.execution'
  • -'attack.t1059'
Logsource:
  • category: process_creation
  • product: linux
Detection:
  selection_img:
    Image|endswith: '/ssh'
    CommandLine|contains:
      -'ProxyCommand=;'
      -'permitlocalcommand=yes'
      -'localhost'

  selection_cli:
    CommandLine|contains:
      -'/bin/bash'
      -'/bin/dash'
      -'/bin/fish'
      -'/bin/sh'
      -'/bin/zsh'
      -'sh 0<&2 1>&2'
      -'sh 1>&2 0<&2'

  condition:all of selection_*
Falsepositives:
  -Unknown
Level: high