Setgid Bit Set via chmod
editSetgid Bit Set via chmod
editAn adversary may add the setgid bit to a file or directory in order to run a file with the privileges of the owning group. An adversary can take advantage of this to either do a shell escape or exploit a vulnerability in an application with the setgid bit to get code running in a different user’s context. Additionally, adversaries can use this mechanism on their own malware to make sure they’re able to execute in elevated contexts in the future.
Rule type: query
Rule indices:
- auditbeat-*
- logs-endpoint.events.*
Severity: low
Risk score: 21
Runs every: 5 minutes
Searches indices from: now-9m (Date Math format, see also Additional look-back time
)
Maximum alerts per execution: 33
Tags:
- Elastic
- Host
- Linux
- Threat Detection
- Privilege Escalation
Version: 4 (version history)
Added (Elastic Stack release): 7.8.0
Last modified (Elastic Stack release): 7.10.0
Rule authors: Elastic
Rule license: Elastic License
Rule query
editevent.category:process AND event.type:(start or process_started) AND process.name:chmod AND process.args:(g+s OR /2[0-9]{3}/) AND NOT user.name:root
Threat mapping
editFramework: MITRE ATT&CKTM
-
Tactic:
- Name: Privilege Escalation
- ID: TA0004
- Reference URL: https://attack.mitre.org/tactics/TA0004/
-
Technique:
- Name: Setuid and Setgid
- ID: T1166
- Reference URL: https://attack.mitre.org/techniques/T1166/
-
Tactic:
- Name: Persistence
- ID: TA0003
- Reference URL: https://attack.mitre.org/tactics/TA0003/
-
Technique:
- Name: Setuid and Setgid
- ID: T1166
- Reference URL: https://attack.mitre.org/techniques/T1166/
Rule version history
edit- Version 4 (7.10.0 release)
-
- Formatting only
- Version 3 (7.9.1 release)
-
- Formatting only
- Version 2 (7.9.0 release)
-
-
Updated query, changed from:
event.action:(executed OR process_started) AND process.name:chmod AND process.args:(g+s OR /2[0-9]{3}/) AND NOT user.name:root
-