Detection rules › Elastic
Potential Sudo Privilege Escalation via CVE-2019-14287
This rule monitors for the execution of a suspicious sudo command that is leveraged in CVE-2019-14287 to escalate privileges to root. Sudo does not verify the presence of the designated user ID and proceeds to execute using a user ID that can be chosen arbitrarily. By using the sudo privileges, the command "sudo -u#-1" translates to an ID of 0, representing the root user. This exploit may work for sudo versions prior to v1.28.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation |
Rule body
[rule]
description = """
This rule monitors for the execution of a suspicious sudo command that is leveraged in CVE-2019-14287 to escalate
privileges to root. Sudo does not verify the presence of the designated user ID and proceeds to execute using a user ID
that can be chosen arbitrarily. By using the sudo privileges, the command "sudo -u#-1" translates to an ID of 0,
representing the root user. This exploit may work for sudo versions prior to v1.28.
"""
id = "b382c343-892d-46e1-8fad-22576a086598"
license = "Elastic License v2"
name = "Potential Sudo Privilege Escalation via CVE-2019-14287"
os_list = ["linux"]
reference = ["https://www.exploit-db.com/exploits/47502"]
version = "1.0.5"
query = '''
process where event.action == "exec" and event.type == "start" and process.name == "sudo" and process.args == "-u#-1"
'''
min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"
[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Stage 1: process
process where event.action == "exec" and event.type == "start" and process.name == "sudo" and process.args == "-u#-1"
Indicators
These rows show field, operator, and value matches.