Payload Downloaded by Interpreter and Piped to Interpreter
This rule detects when a payload is downloaded by an interpreter, and piped to an interpreter. Attackers may use this technique to download and execute payloads for various malicious purposes, such as establishing persistence or exfiltrating data.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2026/07/02"
3integration = ["endpoint"]
4maturity = "production"
5updated_date = "2026/07/02"
6
7[rule]
8author = ["Elastic"]
9description = """
10This rule detects when a payload is downloaded by an interpreter, and piped to an interpreter. Attackers may use this
11technique to download and execute payloads for various malicious purposes, such as establishing persistence or
12exfiltrating data.
13"""
14from = "now-9m"
15index = ["logs-endpoint.events.network*", "logs-endpoint.events.process*"]
16language = "eql"
17license = "Elastic License v2"
18name = "Payload Downloaded by Interpreter and Piped to Interpreter"
19risk_score = 47
20rule_id = "5dc3519c-1f56-42fc-9a70-7e6b705c2781"
21setup = """## Setup
22
23This rule requires data coming in from Elastic Defend.
24
25### Elastic Defend Integration Setup
26Elastic 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.
27
28#### Prerequisite Requirements:
29- Fleet is required for Elastic Defend.
30- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
31
32#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
33- Go to the Kibana home page and click "Add integrations".
34- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
35- Click "Add Elastic Defend".
36- Configure the integration name and optionally add a description.
37- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
38- 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).
39- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
40- 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.
41For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
42- Click "Save and Continue".
43- 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.
44For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
45"""
46severity = "medium"
47tags = [
48 "Domain: Endpoint",
49 "OS: Linux",
50 "Use Case: Threat Detection",
51 "Tactic: Execution",
52 "Tactic: Command and Control",
53 "Tactic: Defense Evasion",
54 "Data Source: Elastic Defend",
55]
56type = "eql"
57query = '''
58sequence by host.id, process.parent.entity_id, process.working_directory with maxspan=1s
59 [network where host.os.type == "linux" and event.type == "start" and event.action == "connection_attempted" and (
60 process.name like (
61 "bash", "dash", "sh", "tcsh", "tclsh", "wish", "csh", "zsh", "ksh", "fish",
62 "mksh", "busybox", "rscript", "r", "julia", "mono", "dotnet", "groovy", "kotlin",
63 "scala", "erlang", "escript", "ocaml", "ocamlopt", "ld.so", "ld-linux-x86-64.so.2",
64 "ld-musl-x86_64.so.1", "awk", "gawk", "mawk", "nawk", "node", "nodejs", "deno",
65 "env", "timeout", "nice", "stdbuf", "setsid", "setarch", "unshare", "nsenter", "flock",
66 "runuser", "sudo", "snap"
67 ) or
68 process.name like ("python*", "perl*", "ruby*", "lua*", "php*", "qemu-*-static")
69 ) and
70 not (destination.ip == null or destination.ip == "0.0.0.0" or cidrmatch(
71 destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.0.0/29",
72 "192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32", "192.0.2.0/24",
73 "192.31.196.0/24", "192.52.193.0/24", "192.168.0.0/16", "192.88.99.0/24", "224.0.0.0/4", "100.64.0.0/10",
74 "192.175.48.0/24","198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1", "FE80::/10",
75 "FF00::/8"
76 )
77 )]
78 [process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and (
79 process.name like (
80 "bash", "dash", "sh", "tcsh", "tclsh", "wish", "csh", "zsh", "ksh", "fish",
81 "mksh", "busybox", "rscript", "r", "julia", "mono", "dotnet", "groovy", "kotlin",
82 "scala", "erlang", "escript", "ocaml", "ocamlopt", "ld.so", "ld-linux-x86-64.so.2",
83 "ld-musl-x86_64.so.1", "awk", "gawk", "mawk", "nawk", "node", "nodejs", "deno"
84 ) or
85 process.name like ("python*", "perl*", "ruby*", "lua*", "php*")
86 ) and (
87 stringcontains(process.executable, process.command_line) or
88 stringcontains(process.name, process.command_line)
89 ) and
90 process.args_count == 1]
91'''
92
93[[rule.threat]]
94framework = "MITRE ATT&CK"
95
96[rule.threat.tactic]
97name = "Execution"
98id = "TA0002"
99reference = "https://attack.mitre.org/tactics/TA0002/"
100
101[[rule.threat.technique]]
102id = "T1059"
103name = "Command and Scripting Interpreter"
104reference = "https://attack.mitre.org/techniques/T1059/"
105
106[[rule.threat.technique.subtechnique]]
107id = "T1059.004"
108name = "Unix Shell"
109reference = "https://attack.mitre.org/techniques/T1059/004/"
110
111[[rule.threat]]
112framework = "MITRE ATT&CK"
113
114[rule.threat.tactic]
115name = "Command and Control"
116id = "TA0011"
117reference = "https://attack.mitre.org/tactics/TA0011/"
118
119[[rule.threat.technique]]
120name = "Application Layer Protocol"
121id = "T1071"
122reference = "https://attack.mitre.org/techniques/T1071/"
123
124[[rule.threat]]
125framework = "MITRE ATT&CK"
126
127[rule.threat.tactic]
128name = "Defense Evasion"
129id = "TA0005"
130reference = "https://attack.mitre.org/tactics/TA0005/"
Related rules
- Shell Execution via Elastic Endpoint
- Suspicious Command Execution via Busybox Proxy
- Curl or Wget Egress Network Connection via LoLBin
- Network Connection Followed by File Creation
- Potential Proxy Execution via Systemd-run