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 = "2023/08/24"
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.*"]
24language = "kuery"
25license = "Elastic License v2"
26name = "Enumeration of Kernel Modules"
27risk_score = 47
28rule_id = "2d8043ed-5bda-4caf-801c-c1feb7410504"
29severity = "medium"
30tags = ["Domain: Endpoint", "OS: Linux", "Use Case: Threat Detection", "Tactic: Discovery", "Data Source: Elastic Defend"]
31timestamp_override = "event.ingested"
32type = "new_terms"
33query = '''
34event.category:process and host.os.type:linux and event.type:start and (
35 (process.name:(lsmod or modinfo)) or
36 (process.name:kmod and process.args:list) or
37 (process.name:depmod and process.args:(--all or -a))
38) and process.parent.name:(sudo or bash or dash or ash or sh or tcsh or csh or zsh or ksh or fish) and
39not process.parent.user.id:0
40'''
41
42[[rule.threat]]
43framework = "MITRE ATT&CK"
44[[rule.threat.technique]]
45
46id = "T1082"
47name = "System Information Discovery"
48reference = "https://attack.mitre.org/techniques/T1082/"
49
50[rule.threat.tactic]
51id = "TA0007"
52name = "Discovery"
53reference = "https://attack.mitre.org/tactics/TA0007/"
54
55[rule.new_terms]
56field = "new_terms_fields"
57value = ["process.parent.name", "host.id"]
58
59[[rule.new_terms.history_window_start]]
60field = "history_window_start"
61value = "now-14d"
Related rules
- ESXI Discovery via Find
- ESXI Discovery via Grep
- Hping Process Activity
- Nping Process Activity
- SUID/SGUID Enumeration Detected