Potential Fileless Execution via Unusual memfd Create Call
This rule detects a memfd_create syscall event on Linux where the combination of host and process lineage (parent executable and executable path) has not been seen before. This can indicate fileless execution using memfd-backed executables.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2026/09/08"
3integration = ["endpoint"]
4maturity = "production"
5min_stack_version = "9.3.0"
6min_stack_comments = "Memfd_create syscall collection for Linux was introduced in 9.3.0"
7updated_date = "2026/09/08"
8
9[rule]
10author = ["Elastic"]
11description = """
12This rule detects a memfd_create syscall event on Linux where the combination of host and process lineage (parent executable and executable path) has not been seen before.
13This can indicate fileless execution using memfd-backed executables.
14"""
15from = "now-9m"
16index = ["logs-endpoint.events.process*"]
17language = "kuery"
18license = "Elastic License v2"
19name = "Potential Fileless Execution via Unusual memfd Create Call"
20note = """## Triage and analysis
21
22> **Disclaimer**:
23> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
24
25### Investigating Potential Fileless Execution via Unusual memfd Create Call
26
27This rule detects a Linux process using memfd_create from a suspicious memory-backed or temporary path with a previously unseen host and process lineage, which may reveal code executing without a conventional on-disk file. An attacker can decrypt an ELF payload into an anonymous memory file and execute it through `/proc/self/fd`, reducing disk artifacts and evading file-based controls.
28
29### Possible investigation steps
30
31- Reconstruct the full process ancestry and execution timeline, examining command-line arguments, effective user, working directory, session context, and nearby process starts for evidence of initial access or privilege escalation.
32- Determine whether the executable is still running and, if so, preserve its memory, open file descriptors, `/proc/<pid>/exe` target, and loaded mappings before containment to support payload recovery and analysis.
33- Correlate the event with outbound network connections, DNS activity, authentication events, and file modifications from the same process tree to identify command-and-control or follow-on behavior.
34- Compare the lineage and binary metadata against approved software inventories and known behavior from browsers, language runtimes, container tooling, security agents, and self-updating applications to rule out legitimate memfd use.
35- If malicious activity is confirmed, isolate the host, terminate the associated process tree, revoke affected credentials, quarantine recovered payloads, and hunt across Linux endpoints for matching hashes, command lines, destinations, or ancestry patterns.
36
37### False positive analysis
38
39- A legitimate application or language runtime may use memfd-backed files for just-in-time compilation or helper execution; verify the process lineage, package ownership, user context, and behavior against an approved baseline.
40- An authorized security agent, container workload, or self-updating application may execute transient code from memory or temporary paths; confirm the timing matches a documented deployment or update and that no anomalous network or child-process activity followed.
41
42### Response and remediation
43
44- Isolate affected Linux systems from the network while preserving access for incident responders, then terminate the malicious memfd-backed process tree and block associated domains, IP addresses, hashes, and command lines.
45- Remove persistence associated with the process lineage, including unauthorized systemd units, cron jobs, shell-profile changes, SSH keys, modified startup scripts, containers, and executables under `/tmp`, `/var/tmp`, `/dev/shm`, or `/run/user`.
46- Revoke and rotate credentials, API tokens, SSH keys, and service secrets accessible to the compromised account or process, and review neighboring systems for reuse of those credentials.
47- Escalate immediately to incident response if the payload ran with root privileges, accessed credentials, established external communications, modified multiple hosts, or cannot be fully scoped from available evidence.
48- Reimage materially compromised hosts from trusted media or restore them from a verified known-good backup, then validate package integrity, security controls, accounts, services, and network behavior before reconnecting them.
49- Prevent recurrence by patching the exploited entry point, restricting execution from writable and memory-backed locations where operationally feasible, applying least privilege and systemd sandboxing, and hunting fleet-wide for matching process ancestry, `/proc/*/fd/*` execution, and memfd-backed artifacts.
50"""
51risk_score = 47
52rule_id = "42663c0e-572e-4459-bf61-476a81d6aab1"
53setup = """## Setup
54
55This rule requires data coming in from Elastic Defend.
56
57### Elastic Defend Integration Setup
58Elastic 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.
59
60#### Prerequisite Requirements:
61- Fleet is required for Elastic Defend.
62- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
63
64#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
65- Go to the Kibana home page and click "Add integrations".
66- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
67- Click "Add Elastic Defend".
68- Configure the integration name and optionally add a description.
69- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
70- 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).
71- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
72- 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.
73For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
74- Click "Save and Continue".
75- 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.
76For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
77"""
78severity = "medium"
79tags = [
80 "Domain: Endpoint",
81 "OS: Linux",
82 "Platform: Linux",
83 "Use Case: Threat Detection",
84 "Tactic: Defense Evasion",
85 "Tactic: Execution",
86 "Data Source: Elastic Defend",
87 "Rule Type: New Terms",
88 "Resources: Investigation Guide",
89]
90timestamp_override = "event.ingested"
91type = "new_terms"
92query = '''
93host.os.type:"linux" and event.category:process and event.type:start and event.action:memfd_create and
94process.executable:(
95 *memfd\:* or /tmp/* or /var/tmp/* or /dev/shm/* or ./* or /run/user/* or /var/run/user/* or
96 /boot/* or /sys/* or /lost+found/* or /proc/* or /var/mail/* or /root/* or *\(deleted\)* or
97 /proc/*/fd/*
98) and process.parent.executable:*
99'''
100
101[[rule.threat]]
102framework = "MITRE ATT&CK"
103
104 [rule.threat.tactic]
105 name = "Defense Evasion"
106 id = "TA0005"
107 reference = "https://attack.mitre.org/tactics/TA0005/"
108
109 [[rule.threat.technique]]
110 name = "Reflective Code Loading"
111 id = "T1620"
112 reference = "https://attack.mitre.org/techniques/T1620/"
113
114 [[rule.threat.technique]]
115 name = "Process Injection"
116 id = "T1055"
117 reference = "https://attack.mitre.org/techniques/T1055/"
118
119 [[rule.threat.technique.subtechnique]]
120 name = "Proc Memory"
121 id = "T1055.009"
122 reference = "https://attack.mitre.org/techniques/T1055/009/"
123
124[[rule.threat]]
125framework = "MITRE ATT&CK"
126
127 [rule.threat.tactic]
128 name = "Execution"
129 id = "TA0002"
130 reference = "https://attack.mitre.org/tactics/TA0002/"
131
132 [[rule.threat.technique]]
133 name = "Native API"
134 id = "T1106"
135 reference = "https://attack.mitre.org/techniques/T1106/"
136
137[rule.new_terms]
138field = "new_terms_fields"
139value = ["host.id", "process.parent.executable", "process.executable"]
140
141[[rule.new_terms.history_window_start]]
142field = "history_window_start"
143value = "now-10d"
Triage and analysis
Disclaimer: This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
Investigating Potential Fileless Execution via Unusual memfd Create Call
This rule detects a Linux process using memfd_create from a suspicious memory-backed or temporary path with a previously unseen host and process lineage, which may reveal code executing without a conventional on-disk file. An attacker can decrypt an ELF payload into an anonymous memory file and execute it through /proc/self/fd, reducing disk artifacts and evading file-based controls.
Possible investigation steps
- Reconstruct the full process ancestry and execution timeline, examining command-line arguments, effective user, working directory, session context, and nearby process starts for evidence of initial access or privilege escalation.
- Determine whether the executable is still running and, if so, preserve its memory, open file descriptors,
/proc/<pid>/exetarget, and loaded mappings before containment to support payload recovery and analysis. - Correlate the event with outbound network connections, DNS activity, authentication events, and file modifications from the same process tree to identify command-and-control or follow-on behavior.
- Compare the lineage and binary metadata against approved software inventories and known behavior from browsers, language runtimes, container tooling, security agents, and self-updating applications to rule out legitimate memfd use.
- If malicious activity is confirmed, isolate the host, terminate the associated process tree, revoke affected credentials, quarantine recovered payloads, and hunt across Linux endpoints for matching hashes, command lines, destinations, or ancestry patterns.
False positive analysis
- A legitimate application or language runtime may use memfd-backed files for just-in-time compilation or helper execution; verify the process lineage, package ownership, user context, and behavior against an approved baseline.
- An authorized security agent, container workload, or self-updating application may execute transient code from memory or temporary paths; confirm the timing matches a documented deployment or update and that no anomalous network or child-process activity followed.
Response and remediation
- Isolate affected Linux systems from the network while preserving access for incident responders, then terminate the malicious memfd-backed process tree and block associated domains, IP addresses, hashes, and command lines.
- Remove persistence associated with the process lineage, including unauthorized systemd units, cron jobs, shell-profile changes, SSH keys, modified startup scripts, containers, and executables under
/tmp,/var/tmp,/dev/shm, or/run/user. - Revoke and rotate credentials, API tokens, SSH keys, and service secrets accessible to the compromised account or process, and review neighboring systems for reuse of those credentials.
- Escalate immediately to incident response if the payload ran with root privileges, accessed credentials, established external communications, modified multiple hosts, or cannot be fully scoped from available evidence.
- Reimage materially compromised hosts from trusted media or restore them from a verified known-good backup, then validate package integrity, security controls, accounts, services, and network behavior before reconnecting them.
- Prevent recurrence by patching the exploited entry point, restricting execution from writable and memory-backed locations where operationally feasible, applying least privilege and systemd sandboxing, and hunting fleet-wide for matching process ancestry,
/proc/*/fd/*execution, and memfd-backed artifacts.
Related rules
- Potential Fileless Execution via O_TMPFILE
- Deprecated - EggShell Backdoor Execution
- Deprecated - Linux Restricted Shell Breakout via Linux Binary(s)
- Deprecated - Uncommon Destination Port Connection by Web Server
- Deprecated - Unusual Command Execution from Web Server Parent