Skip to content
Threat Feed
medium advisory

Detection of Base64-Encoded Payload Execution on Linux

Detection of attackers using base64 decoding utilities coupled with pipe redirection to Linux shells to execute obfuscated malicious payloads.

Attackers frequently leverage base64 encoding to obfuscate malicious scripts, commands, or payloads, allowing them to bypass static signature-based detection and security controls on Linux systems. The technique involves encoding a malicious command string in base64, then utilizing standard system utilities like 'base64 -d' or 'base64 --decode' to reverse the encoding and pipe the output directly into a shell interpreter such as bash, sh, or zsh.

This activity is a classic example of Living-off-the-Land (LotL) techniques, where native binaries are repurposed for malicious intent. Detection of this behavior is critical, as it often precedes unauthorized access, data exfiltration, or the deployment of additional malicious tools. Security teams should monitor process execution telemetry for instances where 'base64' is executed with decoding flags in conjunction with pipe operators directed toward shell interpreters.

Impact

Successful execution of obfuscated payloads allows attackers to maintain persistence, escalate privileges, and execute arbitrary code within the target environment. This technique is often observed during the early stages of an attack or during lateral movement, potentially leading to unauthorized data access or widespread system compromise across Linux-based infrastructure.

Recommendation

  • Deploy the provided Sigma rule to your SIEM to monitor for base64 decoding activity piped to shells.
  • Enable process-creation logging (e.g., Sysmon for Linux, Auditd, or EDR telemetry) to ensure command-line visibility is available for analysis.
  • Tune the detection to exclude known legitimate administrative or deployment scripts that utilize base64 decoding.
  • Review alerts for the specific user and destination involved to determine if the activity aligns with known deployment windows or routine maintenance.

Immediate actions

Deploy the Sigma rule to monitor for base64 piping to shells.

Detection Engineering 48h

Threat Hunt

Search for base64 decoding utilities in command history.

T1027 medium high confidence hunt now

Data: Process execution logs

Detection coverage 1

Detect Linux Base64 Decoding Piped to Shell

medium

Detects the use of base64 decoding utilities piped directly to a shell interpreter, a common technique for executing obfuscated commands.

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

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