Skip to content

Commit 5f447a6

Browse files
[New Rule] Executable Launched from Shared Memory Directory (elastic#1961)
* new rule to check for executables launched from shared memory directory * added references and false positive instances * Update rules/linux/execution_shared_memory_executable.toml * Update rules/linux/execution_shared_memory_executable.toml * Update rules/linux/execution_shared_memory_executable.toml * adjusted process to account for var run and lock directories * TOML lint and query formatting * TOML lint and query formatting * Update rules/linux/execution_process_started_in_shared_memory_directory.toml * Update rules/linux/execution_process_started_in_shared_memory_directory.toml * Update rules/linux/execution_process_started_in_shared_memory_directory.toml * Update rules/linux/execution_process_started_in_shared_memory_directory.toml * added BPFDoor tag to be threat specific * TOML linting and adjusted risk because of root requirement Co-authored-by: Colson Wilhoit <[email protected]>
1 parent c031bb5 commit 5f447a6

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
[metadata]
2+
creation_date = "2022/05/10"
3+
maturity = "production"
4+
updated_date = "2022/05/11"
5+
6+
[rule]
7+
author = ["Elastic"]
8+
description = """
9+
Identifies the execution of a binary by root in Linux shared memory directories: (/dev/shm/, /run/shm/, /var/run/,
10+
/var/lock/). This activity is to be considered highly abnormal and should be investigated. Threat actors have placed
11+
executables used for persistence on high-uptime servers in these directories as system backdoors.
12+
"""
13+
false_positives = [
14+
"""
15+
Directories /dev/shm and /run/shm are temporary file storage directories in Linux. They are intended to appear as a
16+
mounted file system, but uses virtual memory instead of a persistent storage device and thus are used for mounting
17+
file systems in legitimate purposes.
18+
""",
19+
]
20+
from = "now-9m"
21+
index = ["logs-endpoint.events.*"]
22+
language = "eql"
23+
license = "Elastic License v2"
24+
name = "Binary Executed from Shared Memory Directory"
25+
references = [
26+
"https://linuxsecurity.com/features/fileless-malware-on-linux",
27+
"https://twitter.com/GossiTheDog/status/1522964028284411907",
28+
]
29+
risk_score = 73
30+
rule_id = "3f3f9fe2-d095-11ec-95dc-f661ea17fbce"
31+
severity = "high"
32+
tags = ["Elastic", "Host", "Linux", "Threat Detection", "Execution", "BPFDoor"]
33+
timestamp_override = "event.ingested"
34+
type = "eql"
35+
36+
query = '''
37+
process where event.type == "start" and
38+
event.action == "exec" and user.name == "root" and
39+
process.executable : (
40+
"/dev/shm/*",
41+
"/run/shm/*",
42+
"/var/run/*",
43+
"/var/lock/*"
44+
)
45+
'''
46+
47+
48+
[[rule.threat]]
49+
framework = "MITRE ATT&CK"
50+
[[rule.threat.technique]]
51+
id = "T1059"
52+
name = "Command and Scripting Interpreter"
53+
reference = "https://attack.mitre.org/techniques/T1059/"
54+
55+
56+
[rule.threat.tactic]
57+
id = "TA0002"
58+
name = "Execution"
59+
reference = "https://attack.mitre.org/tactics/TA0002/"
60+

0 commit comments

Comments
 (0)