Set Setuid or Setgid bit
Description
This rule is focused on detecting the use of setuid or setgid bits set via chmod. These bits, when set for an application, result in the application running with the privileges of the owning user or group. By enabling the setuid or setgid bits, an attacker could run code in a different user's context, possibly with elevated privileges. However, there's a trade-off with noise, given that numerous applications legitimately run chmod. This rule is related to the "Non sudo setuid" rule.
Query · falco
chmod and (evt.arg.mode contains "S_ISUID" or evt.arg.mode contains "S_ISGID") and not proc.name in (user_known_chmod_applications) and not exe_running_docker_save and not user_known_set_setuid_or_setgid_bit_conditions
Rule dependencies
Depends on
-
composes · Falco macro
chmodA shared condition, not a detection — not indexed on this site. -
composes · Falco macro
exe_running_docker_saveA shared condition, not a detection — not indexed on this site. -
composes · Falco macro
user_known_set_setuid_or_setgid_bit_conditionsA shared condition, not a detection — not indexed on this site.
Analyst notes
Setuid or setgid bit is set via chmod | fd=%evt.arg.fd filename=%evt.arg.filename mode=%evt.arg.mode evt_type=%evt.type user=%user.name user_uid=%user.uid user_loginuid=%user.loginuid process=%proc.name proc_exepath=%proc.exepath parent=%proc.pname command=%proc.cmdline terminal=%proc.tty