Potential Privilege Escalation via PKEXEC

Identifies an attempt to exploit a local privilege escalation in polkit pkexec (CVE-2021-4034) via unsecure environment variable injection. Successful exploitation allows an unprivileged user to escalate to the root user.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2022/01/26"
 3integration = ["endpoint"]
 4maturity = "production"
 5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
 6min_stack_version = "8.3.0"
 7updated_date = "2023/06/22"
 8
 9[rule]
10author = ["Elastic"]
11description = """
12Identifies an attempt to exploit a local privilege escalation in polkit pkexec (CVE-2021-4034) via unsecure environment
13variable injection. Successful exploitation allows an unprivileged user to escalate to the root user.
14"""
15from = "now-9m"
16index = ["logs-endpoint.events.*", "endgame-*"]
17language = "eql"
18license = "Elastic License v2"
19name = "Potential Privilege Escalation via PKEXEC"
20references = ["https://seclists.org/oss-sec/2022/q1/80", "https://haxx.in/files/blasty-vs-pkexec.c"]
21risk_score = 73
22rule_id = "8da41fc9-7735-4b24-9cc6-c78dfc9fc9c9"
23severity = "high"
24tags = ["Domain: Endpoint", "OS: Linux", "Use Case: Threat Detection", "Tactic: Privilege Escalation", "Data Source: Elastic Endgame", "Use Case: Vulnerability", "Data Source: Elastic Defend"]
25timestamp_override = "event.ingested"
26type = "eql"
27
28query = '''
29file where host.os.type == "linux" and file.path : "/*GCONV_PATH*"
30'''
31
32
33[[rule.threat]]
34framework = "MITRE ATT&CK"
35[[rule.threat.technique]]
36id = "T1068"
37name = "Exploitation for Privilege Escalation"
38reference = "https://attack.mitre.org/techniques/T1068/"
39
40
41[rule.threat.tactic]
42id = "TA0004"
43name = "Privilege Escalation"
44reference = "https://attack.mitre.org/tactics/TA0004/"
45[[rule.threat]]
46framework = "MITRE ATT&CK"
47[[rule.threat.technique]]
48id = "T1574"
49name = "Hijack Execution Flow"
50reference = "https://attack.mitre.org/techniques/T1574/"
51[[rule.threat.technique.subtechnique]]
52id = "T1574.007"
53name = "Path Interception by PATH Environment Variable"
54reference = "https://attack.mitre.org/techniques/T1574/007/"
55
56
57
58[rule.threat.tactic]
59id = "TA0005"
60name = "Defense Evasion"
61reference = "https://attack.mitre.org/tactics/TA0005/"

References

Related rules

to-top