MITRE ATT&CK T1548.001: Setuid and Setgid
When to use this skill
Use this skill when the task involves T1548.001, Setuid and Setgid, enterprise ATT&CK, TTP mapping, detection engineering, hunting, incident-response enrichment, control validation, or authorized adversary-emulation planning. Treat it as a defensive analysis aid: keep outputs focused on understanding, detecting, mitigating, and safely validating this ATT&CK sub-technique.
Technique context
- ATT&CK domain: enterprise
- ATT&CK ID: T1548.001
- Technique name: Setuid and Setgid
- Type: sub-technique
- ATT&CK URL: https://attack.mitre.org/techniques/T1548/001
- Tactics: privilege-escalation
- Platforms: Linux, macOS
- Required permissions: Not specified
- Effective permissions: Not specified
- Defenses bypassed: Not specified
ATT&CK description
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.(Citation: setuid man page) 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.(Citation: OSX Keydnap malware) 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.(Citation: GTFOBins Suid)
Agent workflow
- Clarify scope: identify the system, asset class, log sources, cloud or endpoint platform, and whether the user wants triage, detection, coverage assessment, or safe emulation planning.
- Load bundled resources as needed: use
references/technique-profile.json for structured metadata, references/detection-and-mitigation.md for triage and telemetry guidance, references/known-threat-context.md for ATT&CK relationship context, and templates/ for repeatable outputs.
- Map observations to ATT&CK: compare the user's evidence to the ATT&CK description, tactics, platforms, and known procedure patterns before asserting a match.
- Produce defensive outputs: prioritize hypotheses, telemetry requirements, detection logic ideas, validation steps, containment guidance, and mitigations.
- Preserve uncertainty: distinguish confirmed evidence, plausible indicators, assumptions, and gaps. Recommend what to collect next.
- Stay safe: do not provide malware, credential theft, persistence, evasion, destructive automation, or unauthorized exploitation instructions. For adversary emulation, keep steps bounded to approved lab or control-validation contexts and omit operational abuse details.
Bundled resources
references/technique-profile.json: machine-readable ATT&CK metadata for this technique.
references/detection-and-mitigation.md: detection notes, telemetry checklist, triage questions, mitigation candidates, and false-positive considerations.
references/known-threat-context.md: ATT&CK relationship context with attribution cautions.
templates/detection-brief.md: detection engineering brief template.
templates/hunt-plan.md: threat hunt plan template.
templates/incident-response-note.md: incident response note template.
templates/coverage-assessment.md: ATT&CK coverage assessment template.
scripts/render_brief.py: local helper that renders a Markdown defensive brief from technique-profile.json.
assets/output-schema.json: JSON schema for structured technique analysis outputs.
To generate a quick brief, run python scripts/render_brief.py --output brief.md from inside this skill directory, or adapt the templates directly.
Detection guidance
No ATT&CK detection guidance was present in the source STIX object.
Useful telemetry and data sources
- Not specified in the STIX object.
Mitigations to consider
- Operating System Configuration
Known threat context
Use these examples only as contextual leads, not as proof that an observed event is this technique:
- Exaramel for Linux (malware)
- Keydnap (malware)
Recommended output pattern
When responding with this skill, structure the answer as:
- Assessment: whether the evidence supports this ATT&CK mapping and why.
- Evidence: specific indicators, logs, behaviors, and assumptions.
- Detection: telemetry sources, analytic logic, and tuning considerations.
- Response: containment, eradication, recovery, and validation actions.
- Coverage gaps: missing logs, sensors, controls, or environmental details.
- References: include the ATT&CK URL and any user-provided evidence references.
1---2name: attack-ent-t1548-001-setuid-and-setgid3description: Analyze MITRE ATT&CK T1548.001 Setuid and Setgid in the enterprise matrix. Use for TTP triage, detection engineering, hunting, defensive emulation planning, mitigations, incident response mapping, ATT&CK coverage, or questions mentioning T1548.001, Setuid and Setgid, or enterprise ATT&CK. 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.4license: MITRE ATT&CK Terms of Use apply to ATT&CK-derived content. See h5---67# MITRE ATT&CK T1548.001: Setuid and Setgid89## When to use this skill1011Use this skill when the task involves T1548.001, Setuid and Setgid, enterprise ATT&CK, TTP mapping, detection engineering, hunting, incident-response enrichment, control validation, or authorized adversary-emulation planning. Treat it as a defensive analysis aid: keep outputs focused on understanding, detecting, mitigating, and safely validating this ATT&CK sub-technique.1213## Technique context1415- ATT&CK domain: enterprise16- ATT&CK ID: T1548.00117- Technique name: Setuid and Setgid18- Type: sub-technique19- ATT&CK URL: https://attack.mitre.org/techniques/T1548/00120- Tactics: privilege-escalation21- Platforms: Linux, macOS22- Required permissions: Not specified23- Effective permissions: Not specified24- Defenses bypassed: Not specified2526## ATT&CK description2728An 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.(Citation: setuid man page) 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.2930Instead 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](https://attack.mitre.org/techniques/T1222/002)). The <code>chmod</code> command can set these bits with bitmasking, <code>chmod 4777 [file]</code> or via shorthand naming, <code>chmod u+s [file]</code>. This will enable the setuid bit. To enable the setgid bit, <code>chmod 2775</code> and <code>chmod g+s</code> can be used.3132Adversaries can use this mechanism on their own malware to make sure they're able to execute in elevated contexts in the future.(Citation: OSX Keydnap malware) This abuse is often part of a "shell escape" or other actions to bypass an execution environment with restricted permissions.3334Alternatively, adversaries may choose to find and target vulnerable binaries with the setuid or setgid bits already enabled (i.e. [File and Directory Discovery](https://attack.mitre.org/techniques/T1083)). The setuid and setguid bits are indicated with an "s" instead of an "x" when viewing a file's attributes via <code>ls -l</code>. The <code>find</code> command can also be used to search for such files. For example, <code>find / -perm +4000 2>/dev/null</code> can be used to find files with setuid set and <code>find / -perm +2000 2>/dev/null</code> may be used for setgid. Binaries that have these bits set may then be abused by adversaries.(Citation: GTFOBins Suid)3536## Agent workflow37381. Clarify scope: identify the system, asset class, log sources, cloud or endpoint platform, and whether the user wants triage, detection, coverage assessment, or safe emulation planning.392. Load bundled resources as needed: use `references/technique-profile.json` for structured metadata, `references/detection-and-mitigation.md` for triage and telemetry guidance, `references/known-threat-context.md` for ATT&CK relationship context, and `templates/` for repeatable outputs.403. Map observations to ATT&CK: compare the user's evidence to the ATT&CK description, tactics, platforms, and known procedure patterns before asserting a match.414. Produce defensive outputs: prioritize hypotheses, telemetry requirements, detection logic ideas, validation steps, containment guidance, and mitigations.425. Preserve uncertainty: distinguish confirmed evidence, plausible indicators, assumptions, and gaps. Recommend what to collect next.436. Stay safe: do not provide malware, credential theft, persistence, evasion, destructive automation, or unauthorized exploitation instructions. For adversary emulation, keep steps bounded to approved lab or control-validation contexts and omit operational abuse details.4445## Bundled resources4647- `references/technique-profile.json`: machine-readable ATT&CK metadata for this technique.48- `references/detection-and-mitigation.md`: detection notes, telemetry checklist, triage questions, mitigation candidates, and false-positive considerations.49- `references/known-threat-context.md`: ATT&CK relationship context with attribution cautions.50- `templates/detection-brief.md`: detection engineering brief template.51- `templates/hunt-plan.md`: threat hunt plan template.52- `templates/incident-response-note.md`: incident response note template.53- `templates/coverage-assessment.md`: ATT&CK coverage assessment template.54- `scripts/render_brief.py`: local helper that renders a Markdown defensive brief from `technique-profile.json`.55- `assets/output-schema.json`: JSON schema for structured technique analysis outputs.5657To generate a quick brief, run `python scripts/render_brief.py --output brief.md` from inside this skill directory, or adapt the templates directly.5859## Detection guidance6061No ATT&CK detection guidance was present in the source STIX object.6263## Useful telemetry and data sources6465- Not specified in the STIX object.6667## Mitigations to consider6869- Operating System Configuration7071## Known threat context7273Use these examples only as contextual leads, not as proof that an observed event is this technique:7475- Exaramel for Linux (malware)76- Keydnap (malware)7778## Recommended output pattern7980When responding with this skill, structure the answer as:8182- Assessment: whether the evidence supports this ATT&CK mapping and why.83- Evidence: specific indicators, logs, behaviors, and assumptions.84- Detection: telemetry sources, analytic logic, and tuning considerations.85- Response: containment, eradication, recovery, and validation actions.86- Coverage gaps: missing logs, sensors, controls, or environmental details.87- References: include the ATT&CK URL and any user-provided evidence references.