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

Related rules

to-top