Linux: Base64-Encoded Shebang Patterns in Command Line
Flags Linux command lines containing Base64-encoded shebang prefixes for common shells, indicating potential encoded script execution.
- Product
- linux
- Category
- process_creation
- Author
- Nasreddine Bencherchali (Nextron Systems) (SigmaHQ), DRL 1.1
- Published
- 2022-09-15
- Updated
- 2026-07-31
ATT&CK techniques
Defense EvasionRecon
Resource Dev
Initial Access
Execution
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule flags Linux process creations where the command line contains Base64-encoded shebang fragments corresponding to common shells (bash, dash, zsh, fish, sh). Attackers often embed an encoded script header to evade simple inspection before decoding and execution. The detection relies on process_creation telemetry and substring matching within the CommandLine field for the specific encoded sequences.
Reporting behind it
Changelog
v3- v3Candidate ingested via manual entry.2026-07-31
- v2Candidate ingested via manual entry.2026-07-31
- v1No changelog recorded for this version.2026-07-30
Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.
title: "Linux: Base64-Encoded Shebang Patterns in Command Line"
id: 0b333d62-cf9e-4d5b-bcb4-1c5763db040b
status: test
description: This rule flags Linux process creations where the command line contains Base64-encoded shebang fragments corresponding to common shells (bash, dash, zsh, fish, sh). Attackers often embed an encoded script header to evade simple inspection before decoding and execution. The detection relies on process_creation telemetry and substring matching within the CommandLine field for the specific encoded sequences.
references:
- https://www.trendmicro.com/pl_pl/research/20/i/the-evolution-of-malicious-shell-scripts.html
- https://github.com/carlospolop/PEASS-ng/tree/master/linPEAS
- https://github.com/SigmaHQ/sigma/blob/master/rules/linux/process_creation/proc_creation_lnx_base64_shebang_cli.yml
author: Nasreddine Bencherchali (Nextron Systems), Huntrule Team
date: 2022-09-15
tags:
- attack.stealth
- attack.t1140
logsource:
product: linux
category: process_creation
detection:
selection:
CommandLine|contains:
- IyEvYmluL2Jhc2
- IyEvYmluL2Rhc2
- IyEvYmluL3pza
- IyEvYmluL2Zpc2
- IyEvYmluL3No
condition: selection
falsepositives:
- Legitimate administration activities
level: medium
license: DRL-1.1
related:
- id: fe2f9663-41cb-47e2-b954-8a228f3b9dff
type: derived