Process Execution Followed by Self-Deletion

Last updated 2 days ago on 2026-08-19
Created 2 days ago on 2026-08-19

About

Detects a process execution followed by immediate self-deletion, a common technique used by adversaries to remove traces of their activity on the system. This pattern is often observed in malware and APT campaigns.
Tags
Domain: EndpointOS: LinuxUse Case: Threat DetectionTactic: Defense EvasionData Source: Elastic DefendLanguage: eql
Severity
medium
Risk Score
47
MITRE ATT&CK™

Defense Evasion (TA0005)(external, opens in a new tab or window)

License
Elastic License v2(external, opens in a new tab or window)

Definition

Rule Type
Event Correlation Rule
Integration Pack
Prebuilt Security Detection Rules
Index Patterns
logs-endpoint.events.process*logs-endpoint.events.file*
Related Integrations

endpoint(external, opens in a new tab or window)

Query
text code block:
sequence by process.entity_id, host.id with maxspan=30s [process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and process.executable like ( "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/run/*", "/var/run/*", "/var/www/*", "/proc/*/fd/*", "?memfd:*", "memfd:*" )] by process.executable [file where host.os.type == "linux" and event.action == "deletion"] by file.path

Install detection rules in Elastic Security

Detect Process Execution Followed by Self-Deletion in the Elastic Security detection engine by installing this rule into your Elastic Stack.

To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(external, opens in a new tab or window).