Remote Service Session Hijacking: SSH Hijacking T1563.001

Tactic: Lateral Movement

Adversaries may hijack a legitimate user's SSH session to move laterally within an environment. Secure Shell (SSH) is a standard means of remote access on Linux and macOS systems. It allows a user to connect to another system via an encrypted tunnel, commonly authenticating through a password, certificate or the use of an asymmetric encryption key pair.

Authoring guide

Patterns shared across the 8 rules above: which fields they filter on, what specific values they look for, and what they exclude. The catalog normalizes field names across vendors so Sigma's Image, Elastic's process.name, and Splunk's process_name collapse into one row. Each rule contributes at most once per row.

Fields filtered most (18 distinct)

The fields most rules look at when detecting this technique. The How column shows the operators authors use (eq, wildcard, regex_match, match) and how often each appears. Sample values are concrete examples to start from, not an exhaustive list.

FieldRulesHowSample values
event.type7eq 5, in 2start, change, creation
host.os.type7eq 7
EventType5in 3, eq 2exec, ProcessRollup2, connection_attempted, creation, end
process_name4in 2, eq 1, is_not_null 1, wildcard 1*.elf, *.lua*, *.php*, bash, csh
event.category3eq 3file, process
file.name3in 2, eq 1authorized_keys, authorized_keys2, libkeyutils.so
Image2eq 1, starts_with 1./, /boot/, /dev/shm/, /usr/bin/ssh-keygen
TargetFilename2in 1, wildcard 1/etc/ssh/*, /home/*/.ssh/*, /root/.ssh/*, /usr/bin/scp, /usr/bin/sftp
parent_process_name2eq 2sshd
process.args2eq 1, starts_with 1-c, http://nossl.segfault.net/, https://github.com/hackerschoice/, https://gsocket.io/
CommandLine1eq 1/usr/sbin/sshd -D -R
ParentCommandLine1eq 1/usr/sbin/sshd -D -R, sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
ParentImage1eq 1/usr/sbin/sshd
container.id1wildcard 1*
process.args_count1eq 12

Top indicator values (89 distinct)

Specific (field, operator, value) combinations the rules check for, ranked by how many rules under this technique use each one. The Corpus reach column counts how many rules across the entire catalog (any technique) check the same combination. High numbers point to widely-used indicators that are likely noisy on their own; combine them with another condition for useful signal. Blank means the combination is specific to rules under this technique. Click a value to expand the rules under this technique that use it.

FieldKindValueRules (here)Corpus reach
event.typeeq
start
4606
EventTypeeq
exec
2171
EventTypeeq
connection_attempted
125
EventTypeeq
end
1
EventTypein
ProcessRollup2
2117
EventTypein
exec
2171
EventTypein
creation
123
EventTypein
exec_event
1139
EventTypein
executed
188
EventTypein
file_create_event
19
EventTypein
process_started
174
EventTypein
start
1134
event.categoryeq
file
231
event.typein
change
216
event.typein
creation
215
file.namein
authorized_keys
23
file.namein
authorized_keys2
23
parent_process_nameeq
sshd
22
CommandLineeq
/usr/sbin/sshd -D -R
1
Imageeq
/usr/bin/ssh-keygen
1
Imagestarts_with
./
110
Imagestarts_with
/boot/
110
Imagestarts_with
/dev/shm/
123
Imagestarts_with
/home/
15
Imagestarts_with
/lost+found/
13
Imagestarts_with
/proc/
15
Imagestarts_with
/root/
12
Imagestarts_with
/run/
18
Imagestarts_with
/sys/
15
Imagestarts_with
/tmp/
125

Exclusions (121 distinct)

Field/operator/value combinations excluded by rules under this technique (top-level not() clauses), sorted by how many rules exclude each. These are the false-positive paths the community has learned to filter out. A new rule that ignores the high-count entries here will likely fire on the same noisy paths. Click a value to expand the rules under this technique that exclude it.

FieldKindValueRules excluding
CommandLinecontains
ansible
1
CommandLinecontains
become-success
1
CommandLinein
-bash
1
CommandLinein
-sh
1
CommandLinein
-zsh
1
CommandLinewildcard
*BECOME-SUCCESS*
1
CommandLinewildcard
*ansible*
1
CommandLinewildcard
sh -c -- /usr/bin/env -i PATH=*
1
CommandLinewildcard
sh -c /usr/bin/env -i PATH=*
1
Imageeq
/home/sa-ansible
1
Imageeq
/library/developer/commandlinetools/usr/bin/git
1
Imageeq
/opt/jc/bin/jumpcloud-agent
1
Imageeq
/opt/puppetlabs/puppet/bin/puppet
1
Imageeq
/usr/bin/bsdtar
1
Imageeq
/usr/bin/chef-client
1

Rules under this technique

Every rule in the catalog tagged with this technique, grouped by vendor. Click a rule title for its full predicates, exclusions, and indicators.

Platform (all)
Domain (all)

Elastic 8 rules