50 lines
1.9 KiB
TOML
50 lines
1.9 KiB
TOML
[metadata]
|
|
creation_date = "2023/08/28"
|
|
integration = ["endpoint"]
|
|
maturity = "production"
|
|
min_stack_comments = "New fields added: required_fields, related_integrations, setup"
|
|
min_stack_version = "8.3.0"
|
|
updated_date = "2023/08/28"
|
|
|
|
[rule]
|
|
author = ["Elastic"]
|
|
description = """
|
|
This rule monitors a sequence involving a program compilation event followed by its execution and a subsequent
|
|
alteration of UID permissions to root privileges. This behavior can potentially indicate the execution of a kernel or
|
|
software privilege escalation exploit.
|
|
"""
|
|
from = "now-9m"
|
|
index = ["logs-endpoint.events.*"]
|
|
language = "eql"
|
|
license = "Elastic License v2"
|
|
name = "Potential Privilege Escalation via Recently Compiled Executable"
|
|
risk_score = 47
|
|
rule_id = "193549e8-bb9e-466a-a7f9-7e783f5cb5a6"
|
|
severity = "medium"
|
|
tags = ["Domain: Endpoint", "OS: Linux", "Use Case: Threat Detection", "Tactic: Privilege Escalation", "Use Case: Vulnerability", "Data Source: Elastic Defend"]
|
|
type = "eql"
|
|
query = '''
|
|
sequence by host.id with maxspan=1m
|
|
[process where host.os.type == "linux" and event.action == "exec" and event.type == "start" and
|
|
process.name in ("gcc", "g++", "cc") and user.id != "0"] by process.args
|
|
[file where host.os.type == "linux" and event.action == "creation" and event.type == "creation" and
|
|
process.name == "ld" and user.id != "0"] by file.name
|
|
[process where host.os.type == "linux" and event.action == "exec" and event.type == "start" and
|
|
user.id != "0"] by process.name
|
|
[process where host.os.type == "linux" and event.action in ("uid_change", "guid_change") and event.type == "change" and
|
|
user.id == "0"] by process.name
|
|
'''
|
|
|
|
[[rule.threat]]
|
|
framework = "MITRE ATT&CK"
|
|
|
|
[[rule.threat.technique]]
|
|
id = "T1068"
|
|
name = "Exploitation for Privilege Escalation"
|
|
reference = "https://attack.mitre.org/techniques/T1068/"
|
|
|
|
[rule.threat.tactic]
|
|
id = "TA0004"
|
|
name = "Privilege Escalation"
|
|
reference = "https://attack.mitre.org/tactics/TA0004/"
|