Suspicious Kworker UID Elevation

Monitors for the elevation of regular user permissions to root permissions through the kworker process. kworker, or kernel worker, processes are part of the kernel's workqueue mechanism. They are responsible for executing work that has been scheduled to be done in kernel space, which might include tasks like handling interrupts, background activities, and other kernel-related tasks. Attackers may attempt to evade detection by masquerading as a kernel worker process, and hijack the execution flow by hooking certain functions/syscalls through a rootkit in order to provide easy access to root via a special modified command.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2023/10/26"
 3integration = ["endpoint"]
 4maturity = "production"
 5updated_date = "2024/05/21"
 6
 7[rule]
 8author = ["Elastic"]
 9description = """
10Monitors for the elevation of regular user permissions to root permissions through the kworker process. kworker, or
11kernel worker, processes are part of the kernel's workqueue mechanism. They are responsible for executing work that has
12been scheduled to be done in kernel space, which might include tasks like handling interrupts, background activities,
13and other kernel-related tasks. Attackers may attempt to evade detection by masquerading as a kernel worker process, and
14hijack the execution flow by hooking certain functions/syscalls through a rootkit in order to provide easy access to
15root via a special modified command.
16"""
17from = "now-9m"
18index = ["logs-endpoint.events.*", "endgame-*"]
19language = "eql"
20license = "Elastic License v2"
21name = "Suspicious Kworker UID Elevation"
22risk_score = 47
23rule_id = "7dfaaa17-425c-4fe7-bd36-83705fde7c2b"
24setup = """## Setup
25
26This rule requires data coming in from Elastic Defend.
27
28### Elastic Defend Integration Setup
29Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows
30the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
31
32#### Prerequisite Requirements:
33- Fleet is required for Elastic Defend.
34- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
35
36#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
37- Go to the Kibana home page and click Add integrations.
38- In the query bar, search for Elastic Defend and select the integration to see more details about it.
39- Click Add Elastic Defend.
40- Configure the integration name and optionally add a description.
41- Select the type of environment you want to protect, either Traditional Endpoints or Cloud Workloads.
42- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
43- We suggest to select "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
44- Enter a name for the agent policy in New agent policy name. If other agent policies already exist, you can click the Existing hosts tab and select an existing policy instead.
45For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
46- Click Save and Continue.
47- To complete the integration, select Add Elastic Agent to your hosts and continue to the next section to install the Elastic Agent on your hosts.
48For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
49"""
50severity = "medium"
51tags = [
52    "Domain: Endpoint",
53    "OS: Linux",
54    "Use Case: Threat Detection",
55    "Tactic: Privilege Escalation",
56    "Tactic: Defense Evasion",
57    "Data Source: Elastic Defend",
58    "Data Source: Elastic Endgame",
59]
60timestamp_override = "event.ingested"
61type = "eql"
62
63query = '''
64process where host.os.type == "linux" and event.action == "session_id_change" and process.name : "kworker*" and
65user.id == "0"
66'''
67
68
69[[rule.threat]]
70framework = "MITRE ATT&CK"
71[[rule.threat.technique]]
72id = "T1574"
73name = "Hijack Execution Flow"
74reference = "https://attack.mitre.org/techniques/T1574/"
75[[rule.threat.technique.subtechnique]]
76id = "T1574.013"
77name = "KernelCallbackTable"
78reference = "https://attack.mitre.org/techniques/T1574/013/"
79
80
81
82[rule.threat.tactic]
83id = "TA0004"
84name = "Privilege Escalation"
85reference = "https://attack.mitre.org/tactics/TA0004/"
86[[rule.threat]]
87framework = "MITRE ATT&CK"
88[[rule.threat.technique]]
89id = "T1014"
90name = "Rootkit"
91reference = "https://attack.mitre.org/techniques/T1014/"
92
93
94[rule.threat.tactic]
95id = "TA0005"
96name = "Defense Evasion"
97reference = "https://attack.mitre.org/tactics/TA0005/"

Related rules

to-top