Abuse Elevation Control Mechanism: Setuid and Setgid T1548.001

Tactic: Privilege Escalation

An adversary may abuse configurations where an application has the setuid or setgid bits set in order to get code running in a different (and possibly more privileged) user’s context. On Linux or macOS, when the setuid or setgid bits are set for an application binary, the application will run with the privileges of the owning user or group respectively. Normally an application is run in the current user’s context, regardless of which user or group owns the application. However, there are instances where programs need to be executed in an elevated context to function properly, but the user running them may not have the specific required privileges.

Events covered

7 catalog events are tagged with this technique by at least one rule.

Authoring guide

These 44 rules share fields, values, and exclusions.

Fields filtered most (47 distinct)

These fields appear most often in rule filters.

FieldRulesHowSample values
EventType32eq 29, in 5exec, uid_change, executed, exec_event, ProcessRollup2
event.type29eq 28, in 1start, change, creation
process_name26eq 18, in 10, starts_with 3, contains 1, is_not_null 1, regex_match 1chmod, bash, setcap, ., aa-exec
host.os.type22eq 22
process.args18in 10, eq 9, starts_with 3, wildcard 2, contains 1, regex_match 1+x, --command, -2000, -4000, -6000
user.id13eq 9, ne 9, is_not_null 10
ParentImage10wildcard 9, is_not_null 1/dev/shm/*, /home/*/*, ./*, .*, /var/lib/dpkg/info/*.postinst
CommandLine9contains 5, in 4, match 1, regex_match 1, starts_with 1 chmod g+s, chmod u+s, (?i)(^chmod\s+([-fhvrlp]+\s+)?((([01234567]{1,1})?([1357]..., * -u 0, * -u 0 *
Image9wildcard 4, starts_with 3, is_not_null 2, contains 1/dev/shm/*, /home/*/*, .*, process.command_line, /dev/shm/
process.group.id9eq 90
process.real_group.id9ne 90
process.real_user.id9ne 90
process.user.id9eq 90
parent_process_name8in 8, wildcard 5bash, .*, bun, csh, dash
process.parent.args_count7le 5, eq 24, 1

Top indicator values (620 distinct)

These values appear most often in rule predicates.

FieldKindValueRules (here)Corpus reach
event.typeeq
start
271087
event.typeeq
change
895
EventTypeeq
exec
25579
EventTypeeq
uid_change
619
process.group.ideq
0
910
process.real_group.idne
0
99
process.real_user.idne
0
99
process.user.ideq
0
910
user.ideq
0
928
user.idne
0
928
ParentImagewildcard
/dev/shm/*
817
ParentImagewildcard
/home/*/*
818
ParentImagewildcard
/run/user/*
816
ParentImagewildcard
/tmp/*
819
ParentImagewildcard
/var/run/user/*
816
ParentImagewildcard
/var/tmp/*
819
ParentImagewildcard
./*
57
parent_process_namein
bash
866
parent_process_namein
csh
840
parent_process_namein
dash
843
parent_process_namein
fish
841
parent_process_namein
ksh
841
parent_process_namein
sh
866
parent_process_namein
tcsh
841
parent_process_namein
zsh
864
parent_process_namein
mksh
510
process.parent.group.idne
0
711
process.parent.user.idne
0
713
parent_process_namewildcard
.*
511
parent_process_namewildcard
bun
55

Exclusions (347 distinct)

These values appear most often in top-level exclusions.

FieldKindValueRules excluding
Imagein
/usr/bin/sudo
4
Imagein
/bin/sudo
3
process_namein
sudo
3
Imageeq
/usr/bin/sudo
2
Imagestarts_with
/bin/
2
Imagestarts_with
/run/k3s/containerd/
2
Imagestarts_with
/sbin/
2
Imagestarts_with
/usr/bin/
2
Imagestarts_with
/usr/sbin/
2
ParentImagein
/usr/bin/update-notifier
2
ParentImagewildcard
/tmp/newroot/*
2
parent_process_namein
jem
2
parent_process_namein
sudo
2
parent_process_namein
vzctl
2
process.argseq
-xdev
2

Rules under this technique

These vendors publish rules tagged with this technique.

Platform (all)
Domain (all)

Sigma 3 rules

Elastic 32 rules

Splunk 9 rules