Setuid and Setgid - T1166
Definition
When the setuid or setgid bits are set on Linux or macOS for an application, this means that 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. There are instances where programs need to be executed in an elevated context to function properly, but the user running them doesn’t need the elevated privileges. Instead of creating an entry in the sudoers file, which must be done by root, any user can specify the setuid or setgid flag to be set for their own applications. These bits are indicated with an "s" instead of an "x" when viewing a file's attributes via ls -l
. The chmod
program can set these bits with via bitmasking, chmod 4777 [file]
or via shorthand naming, chmod u+s [file]
.
D3FEND Inferred Relationships
There are no digital artifacts defined on this offensive technique (yet). Please consider contributing an addition to D3FEND.