Skip to content
Threat Feed
medium advisory

Container Environment: Suspicious Fileless Payload Execution via Shell Piping

Detection of fileless execution patterns within Linux containers where remote payloads are fetched via curl or wget and immediately passed to a shell or scripting interpreter to bypass filesystem-based controls.

Triage facts

Revision 1
Applicability
Linux
Evidence
Unknown
Severity
Medium
Action
Elevated
Sources
2 public sources
Freshness
Revision 1Nov 3, 21:48 UTC
Source quality
A2Likely

This alert identifies potentially malicious fileless execution in Linux containers. Attackers often leverage the pattern of piping network-downloaded content directly into a shell (e.g., curl <url> | sh) to achieve code execution without writing artifacts to the container filesystem. This technique is primarily used during initial foothold or lateral movement to evade forensic analysis and disk-based security controls.

Attack Chain

  1. Initial access or lateral movement phase within a container.
  2. Execution of a downloader utility (curl or wget).
  3. Fetching of an external payload from a remote malicious server.
  4. Piping of the remote payload output directly into a local shell or script interpreter (e.g., bash, sh, python, or perl).
  5. Execution of the code in memory, bypassing persistent file scanning.
  6. Potential follow-on activities, such as reverse shell spawning, crypto-miner installation, or container runtime socket access.

Recommendation

  • Implement runtime monitoring to detect the chaining of downloader processes (curl/wget) and scripting interpreters.
  • Restrict interactive container access (exec sessions) via RBAC and just-in-time privilege requests.
  • Apply egress network policies to limit container communication to known-good internal or external endpoints.
  • Harden container images to remove unnecessary utilities like curl and wget where possible.
  • Review and deploy the provided Elastic Defend for Containers rule logic to monitor for ephemeral pipe execution patterns.

Immediate actions

Deploy the detection logic for curl/wget piped to shell within Linux container environments.

Detection Engineering 72h

Threat Hunt

Identify container exec sessions where curl or wget is followed immediately by a shell interpreter invocation.

T1059.004 high high confidence hunt now

Data: Process creation events (Sysmon/Auditd/Cloud Defend), Command line arguments, Parent-child process relationship

Mitigations

Enforce network policies to restrict outbound traffic from containers to untrusted external infrastructure.

medium_term Cloud Security

T1105