Potential Memory File Descriptor Process Execution
Description
This rule detects when a process is executed from a memory file descriptor (memfd). Attackers may use memfd to create and execute code directly in memory, bypassing traditional file-based detection mechanisms. The use of memfd for process execution is uncommon and may indicate an attempt to evade security controls.
Query · eql
process where event.type == "start" and event.action == "exec" and (
process.executable like ("?memfd:*", "memfd:*") or
process.parent.executable like ("?memfd:*", "memfd:*")
) and
not (
process.executable in (
"/usr/bin/fusermount", "/usr/bin/fusermount3", "memfd:runc_cloned:/proc/self/exe",
"memfd:buildah-chroot-runtime", "memfd:buildah-chroot-exec", "memfd:lxc-attach", "/usr/sbin/logrotate"
) or
process.executable like "memfd:runc_cloned:/run/nvidia-ctk-hook/*" or
process.parent.executable like (
"/usr/libexec/nordlayer/nordlayer-resolvconf", "/nix/store/*/bin/buildah",
"/opt/teleport/system/bin/teleport", "memfd:teleport-sessionhelper",
"memfd:buildah-chroot-exec", "/usr/lib/openssh/sshd-session", "memfd:lxc-attach",
"/usr/bin/nvidia-cdi-hook", "/opt/sophos-spl/plugins/runtimedetections/bin/runtimedetections.*",
"/opt/appimagelauncher.AppDir/usr/lib/x86_64-linux-gnu/appimagelauncher/binfmt-bypass",
"/usr/bin/nordlayer"
) or
(
process.working_directory == "/run/nordlayer" and
process.parent.command_line in (
"/proc/self/fd/4 -config /etc/nordlayer/config.hcl",
"/dev/fd/4 -config /etc/nordlayer/config.hcl"
)
) or
(process.parent.executable == "/usr/local/bin/php" and process.executable == "memfd:spawn_worker_trampoline") or
(process.parent.executable like "/opt/teleport/default/versions/*/bin/teleport" and process.executable == "memfd:teleport-sessionhelper") or
(process.parent.command_line == "runc init" and process.parent.executable == "memfd:runc_cloned:/proc/self/exe") or
(process.parent.executable == "/usr/bin/nvidia-container-cli" and process.executable == "memfd:/sbin/ldconfig.real") or
(process.parent.executable == "/usr/sbin/nordlayerd" and process.parent.command_line == "/usr/sbin/nordlayerd -config /etc/nordlayer/config.hcl") or
(process.parent.executable == "/usr/bin/nordlayer-tray" and process.executable == "memfd:fdexe") or
(process.parent.executable == "/opt/fireeye/bin/rte-sensor" and process.executable like "memfd:/capsule8-sensor-*")
)