Enumeration of Kernel Modules

Loadable Kernel Modules (or LKMs) are pieces of code that can be loaded and unloaded into the kernel upon demand. They extend the functionality of the kernel without the need to reboot the system. This identifies attempts to enumerate information about a kernel module.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2020/04/23"
 3integration = ["endpoint"]
 4maturity = "production"
 5min_stack_comments = "Multiple field support in the New Terms rule type was added in Elastic 8.6"
 6min_stack_version = "8.6.0"
 7updated_date = "2024/03/08"
 8
 9[rule]
10author = ["Elastic"]
11description = """
12Loadable Kernel Modules (or LKMs) are pieces of code that can be loaded and unloaded into the kernel upon demand. They
13extend the functionality of the kernel without the need to reboot the system. This identifies attempts to enumerate
14information about a kernel module.
15"""
16false_positives = [
17    """
18    Security tools and device drivers may run these programs in order to enumerate kernel modules. Use of these programs
19    by ordinary users is uncommon. These can be exempted by process name or username.
20    """,
21]
22from = "now-9m"
23index = ["logs-endpoint.events.*", "endgame-*"]
24language = "kuery"
25license = "Elastic License v2"
26name = "Enumeration of Kernel Modules"
27risk_score = 47
28rule_id = "2d8043ed-5bda-4caf-801c-c1feb7410504"
29setup = """## Setup
30
31This rule requires data coming in from Elastic Defend.
32
33### Elastic Defend Integration Setup
34Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
35
36#### Prerequisite Requirements:
37- Fleet is required for Elastic Defend.
38- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
39
40#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
41- Go to the Kibana home page and click "Add integrations".
42- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
43- Click "Add Elastic Defend".
44- Configure the integration name and optionally add a description.
45- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
46- 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).
47- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
48- 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.
49For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
50- Click "Save and Continue".
51- 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.
52For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
53"""
54severity = "medium"
55tags = [
56        "Domain: Endpoint",
57        "OS: Linux",
58        "Use Case: Threat Detection",
59        "Tactic: Discovery",
60        "Data Source: Elastic Defend",
61        "Data Source: Elastic Endgame"
62        ]
63timestamp_override = "event.ingested"
64type = "new_terms"
65query = '''
66event.category:process and host.os.type:linux and event.type:start and event.action:(exec or exec_event) and (
67 (process.name:(lsmod or modinfo)) or 
68 (process.name:kmod and process.args:list) or 
69 (process.name:depmod and process.args:(--all or -a))
70) and not process.parent.name:(mkinitramfs or cryptroot or framebuffer or dracut or jem or thin-provisioning-tools
71or readykernel or lvm2 or vz-start or iscsi or mdadm or ovalprobes or bcache or plymouth or dkms or overlayroot or 
72weak-modules or zfs)
73'''
74
75[[rule.threat]]
76framework = "MITRE ATT&CK"
77
78[[rule.threat.technique]]
79id = "T1082"
80name = "System Information Discovery"
81reference = "https://attack.mitre.org/techniques/T1082/"
82
83[rule.threat.tactic]
84id = "TA0007"
85name = "Discovery"
86reference = "https://attack.mitre.org/tactics/TA0007/"
87
88[rule.new_terms]
89field = "new_terms_fields"
90value = ["process.parent.command_line", "process.command_line", "host.id"]
91
92[[rule.new_terms.history_window_start]]
93field = "history_window_start"
94value = "now-14d"

Related rules

to-top