Cross-source coverage
T1548.001 / ATT&CK
Abuse Elevation Control Mechanism: Setuid and Setgid
54 rules · 50 families across 8 sources.
Showing deprecated rules · back to the default
From MITRE ATT&CK 19.2
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.
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 (i.e. Linux and Mac Permissions). The chmod command can set these bits with bitmasking, chmod 4777 [file] or via shorthand naming, chmod u+s [file]. This will enable the setuid bit. To enable the setgid bit, chmod 2775 and chmod g+s can be used.
Adversaries can use this mechanism on their own malware to make sure they're able to execute in elevated contexts in the future. This abuse is often part of a "shell escape" or other actions to bypass an execution environment with restricted permissions.
Alternatively, adversaries may choose to find and target vulnerable binaries with the setuid or setgid bits already enabled (i.e. File and Directory Discovery). The setuid and setguid bits are indicated with an "s" instead of an "x" when viewing a file's attributes via ls -l. The find command can also be used to search for such files. For example, find / -perm +4000 2>/dev/null can be used to find files with setuid set and find / -perm +2000 2>/dev/null may be used for setgid. Binaries that have these bits set may then be abused by adversaries.
- Tactics
- Privilege Escalation
- Platforms
- Linux · macOS
- Telemetry
-
auditd:SYSCALLmacos:unifiedlog
How MITRE says to detect it DET0110
Setuid/Setgid Privilege Abuse Detection (Linux/macOS)
Linux Analytic 0307
Correlation of chmod operations setting setuid/setgid bits followed by privileged process execution (EUID != UID), especially from user-writable or abnormal paths.
auditd:SYSCALLchmod, execveauditd:SYSCALLexecve
macOS Analytic 0308
Observation of chmod commands setting setuid/setgid bits, paired with launch of binaries under elevated execution context (e.g., root-owned binaries launched by unprivileged users).
macos:unifiedlogchmod command with arguments including '+s', 'u+s', or numeric values 4000–6777macos:unifiedlogexec of binary with setuid/setgid and EUID != UID
elastic/detection-rules
24 rules| Detection | Severity | Format |
|---|---|---|
| Potential Copy Fail (CVE-2026-31431) Exploitation via AF_ALG Socket | High | Elastic TOML |
| Potential Privilege Escalation via a Parent/Child Process Sequence | High | Elastic TOML |
| Potential Privilege Escalation via a Parent Process Sequence | High | Elastic TOML |
| Potential Privilege Escalation via a Suspicious UID Change | High | Elastic TOML |
| Potential Privilege Escalation via CVE-2023-4911 | High | Elastic TOML |
| Potential Privilege Escalation via Enlightenment | High | Elastic TOML |
| Potential Privilege Escalation via Python cap_setuid | High | Elastic TOML |
| Potential Privilege Escalation via Recently Compiled Executable | High | Elastic TOML |
| Potential Privilege Escalation via SUID/SGID | High | Elastic TOML |
| Potential Root Effective Shell from Non-Standard Path via Auditd | High | Elastic TOML |
+ 14 more from elastic/detection-rules → showing the 10 highest-severity
elastic/protections-artifacts
9 rules| Detection | Severity | Format |
|---|---|---|
| Potential PackageKit TOCTOU Privilege Escalation via CVE-2026-41651 | Undefined | Elastic TOML |
| Potential Privilege Escalation via a Known SUID/SGID Binary | Undefined | Elastic TOML |
| Potential Privilege Escalation via a SUID/SGID Binary | Undefined | Elastic TOML |
| Potential Privilege Escalation via SUID Binary | Undefined | Elastic TOML |
| Potential Privilege Escalation via SUID/SGID Proxy Execution | Undefined | Elastic TOML |
| Potential SUID/SGID Files Enumeration | Undefined | Elastic TOML |
| Setcap setuid/setgid Capability Set | Undefined | Elastic TOML |
| Shell Privileged Mode from Non-Standard Path with Root Effective User | Undefined | Elastic TOML |
| Suspicious SUID/SGID Utility Execution | Undefined | Elastic TOML |
splunk/security_content
7 rules| Detection | Severity | Format |
|---|---|---|
| Linux Auditd Setuid Using Chmod Utility | Undefined | SPL |
| Linux Auditd Setuid Using Setcap Utility | Undefined | SPL |
| Linux Common Process For Elevation Control | Undefined | SPL |
| Linux Dirty Frag Kernel Privilege Escalation | Undefined | SPL |
| Linux Setuid Using Chmod Utility | Undefined | SPL |
| Linux Setuid Using Setcap Utility | Undefined | SPL |
| Linux Usermod Root UID Set | Undefined | SPL |
chainguard-dev/osquery-defense-kit
5 rules · 3 families| Detection | Severity | Format |
|---|---|---|
| Find processes that run with a lower effective UID than their parent (event-based) 2 variants | Undefined | osquery SQL |
| Find processes that run with a lower effective UID than their parent (event-based) 2 variants | Undefined | osquery SQL |
| Find processes that run with a lower effective UID than their parent (state-based) 2 variants | Undefined | osquery SQL |
| Find processes that run with a lower effective UID than their parent (state-based) 2 variants | Undefined | osquery SQL |
| Processes running that originate from setuid/setgid programs | Undefined | osquery SQL |
socfortress/Wazuh-Rules
4 rules| Detection | Severity | Format |
|---|---|---|
| Ownership of file in /tmp changed to root (T1548.001) | High | Wazuh XML |
| Setuid capability added to binary using setcap (T1548.001) | High | Wazuh XML |
| Setuid or Setgid permission set via chmod (T1548.001) | High | Wazuh XML |
| Reconnaissance for SUID/SGID binaries via find (T1548.001) | Medium | Wazuh XML |
SigmaHQ/sigma
2 rules| Detection | Severity | Format |
|---|---|---|
| PwnKit Local Privilege Escalation | High | Sigma |
| Setuid and Setgid | Low | Sigma |
falcosecurity/rules
2 rules| Detection | Severity | Format |
|---|---|---|
| Non sudo setuid | Low | Falco YAML |
| Set Setuid or Setgid bit | Low | Falco YAML |
Wazuh Core Ruleset
1 rule| Detection | Severity | Format |
|---|---|---|
| osquery: : File has setuid enabled · osquery.name = suid_bin | Low | Wazuh XML |