Skip to content
Threat Feed
medium advisory

Linux Payload Download and Execution via Interpreter Pipes

Attackers utilize network utilities curl or wget to download remote payloads and pipe them directly into system interpreters to execute malicious code in memory or from non-standard locations.

This threat involves attackers using common network utilities, specifically curl and wget, to download remote payloads and pipe them directly into system interpreters such as bash, python, or node. This technique is a standard method for threat actors to achieve code execution, establish persistence, or exfiltrate data while attempting to evade traditional file-based security controls. By keeping the payload in memory or executing it directly from a pipe, the attacker reduces their on-disk footprint, making detection more reliant on process lineage and behavioral analysis. Defenders should monitor for process executions where curl or wget are spawned from shells or suspicious working directories, followed by the immediate invocation of an interpreter. This activity is prevalent in Linux environments and is often associated with initial access or post-exploitation stages where the attacker is retrieving secondary tools or scripts from command-and-control infrastructure.

Impact

Successful execution of this technique allows an attacker to achieve arbitrary code execution on a compromised Linux host. This can lead to full system compromise, data exfiltration, or the installation of persistent backdoors. The technique is frequently seen across all sectors that manage Linux infrastructure, particularly in environments with internet-facing workloads. The primary risk is the bypass of traditional antivirus or file-integrity monitoring, as the malicious code is never written to disk in a standard, recognizable file format before execution.

Recommendation

Prioritize the deployment of behavioral detection rules that monitor for the combination of network downloads and subsequent interpreter invocation in a single process chain.

  • Deploy detection logic to monitor for processes spawned by curl or wget that execute within one second of the download event.
  • Enable process-creation logging (such as Elastic Defend or Sysmon for Linux) to capture the full command-line arguments and process parent-child relationships.
  • Ensure that shells and interpreters are monitored for unusual parent processes, specifically those originating from /tmp or /var/tmp directories.
  • Tune detections to filter out legitimate administrative tasks or known-good deployment scripts that utilize curl or wget to fetch software packages from trusted, allowlisted URLs.

Immediate actions

Deploy the payload download detection rule to SIEM environment.

Detection Engineering 72h

Threat Hunt

Search for command lines containing both a download utility and a pipe to an interpreter.

T1059.004 medium medium confidence convert to detection

Data: process_creation

Mitigations

Restrict outbound internet access from sensitive servers to only allowlisted domains.

medium_term IT Operations

C2 execution via curl/wget

Detection coverage 1

Detect Payload Downloaded by Curl/Wget and Piped to Interpreter

medium

Detects the use of curl or wget to download a remote resource, followed by the immediate execution of that resource by a system interpreter, which is indicative of malicious code execution.

sigma tactics: execution techniques: T1059.004, T1071 sources: process_creation, linux

Detection queries are available on the platform. Get full rules →