|
| 1 | +[metadata] |
| 2 | +creation_date = "2023/07/31" |
| 3 | +integration = ["endpoint"] |
| 4 | +maturity = "production" |
| 5 | +min_stack_comments = "New fields added: required_fields, related_integrations, setup" |
| 6 | +min_stack_version = "8.3.0" |
| 7 | +updated_date = "2023/07/31" |
| 8 | + |
| 9 | +[rule] |
| 10 | +author = ["Elastic"] |
| 11 | +description = """ |
| 12 | +This rule detects potential sudo token manipulation attacks through process injection by monitoring the use of a |
| 13 | +debugger (gdb) process followed by a successful uid change event during the execution of the sudo process. A sudo token |
| 14 | +manipulation attack is performed by injecting into a process that has a valid sudo token, which can then be used by |
| 15 | +attackers to activate their own sudo token. This attack requires ptrace to be enabled in conjunction with the existence |
| 16 | +of a living process that has a valid sudo token with the same uid as the current user. |
| 17 | +""" |
| 18 | +from = "now-9m" |
| 19 | +index = ["logs-endpoint.events.*"] |
| 20 | +language = "eql" |
| 21 | +license = "Elastic License v2" |
| 22 | +name = "Potential Sudo Token Manipulation via Process Injection" |
| 23 | +references = ["https://github.com/nongiach/sudo_inject"] |
| 24 | +risk_score = 47 |
| 25 | +rule_id = "ff9bc8b9-f03b-4283-be58-ee0a16f5a11b" |
| 26 | +severity = "medium" |
| 27 | +tags = ["Domain: Endpoint", "OS: Linux", "Use Case: Threat Detection", "Tactic: Privilege Escalation"] |
| 28 | +type = "eql" |
| 29 | +query = ''' |
| 30 | +sequence by host.id, process.session_leader.entity_id with maxspan=15s |
| 31 | +[ process where host.os.type == "linux" and event.action == "exec" and event.type == "start" and |
| 32 | + process.name == "gdb" and process.user.id != "0" and process.group.id != "0" ] |
| 33 | +[ process where host.os.type == "linux" and event.action == "uid_change" and event.type == "change" and |
| 34 | + process.name == "sudo" and process.user.id == "0" and process.group.id == "0" ] |
| 35 | +''' |
| 36 | + |
| 37 | +[[rule.threat]] |
| 38 | +framework = "MITRE ATT&CK" |
| 39 | + |
| 40 | +[[rule.threat.technique]] |
| 41 | +id = "T1055" |
| 42 | +name = "Process Injection" |
| 43 | +reference = "https://attack.mitre.org/techniques/T1055/" |
| 44 | + |
| 45 | +[[rule.threat.technique.subtechnique]] |
| 46 | +id = "T1055.008" |
| 47 | +name = "Ptrace System Calls" |
| 48 | +reference = "https://attack.mitre.org/techniques/T1055/008/" |
| 49 | + |
| 50 | +[[rule.threat.technique]] |
| 51 | +id = "T1548" |
| 52 | +name = "Abuse Elevation Control Mechanism" |
| 53 | +reference = "https://attack.mitre.org/techniques/T1548/" |
| 54 | + |
| 55 | +[[rule.threat.technique.subtechnique]] |
| 56 | +id = "T1548.003" |
| 57 | +name = "Sudo and Sudo Caching" |
| 58 | +reference = "https://attack.mitre.org/techniques/T1548/003/" |
| 59 | + |
| 60 | +[rule.threat.tactic] |
| 61 | +id = "TA0004" |
| 62 | +name = "Privilege Escalation" |
| 63 | +reference = "https://attack.mitre.org/tactics/TA0004/" |
0 commit comments