← Back to SOC feed Coverage →

Linux Shell Pipe to Shell

sigma MEDIUM SigmaHQ
T1140
imProcessCreate
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at SigmaHQ →
Retrieved: 2026-03-25T02:50:08Z · Confidence: medium

Hunt Hypothesis

The Linux Shell Pipe to Shell detection rule identifies adversaries using chained shell commands to execute arbitrary code through a pipeline, potentially bypassing standard command-line parsing and detection mechanisms. SOC teams should proactively hunt for this behavior in Azure Sentinel to uncover stealthy execution techniques commonly used in advanced persistent threats.

Detection Rule

Sigma (Original)

title: Linux Shell Pipe to Shell
id: 880973f3-9708-491c-a77b-2a35a1921158
status: test
description: Detects suspicious process command line that starts with a shell that executes something and finally gets piped into another shell
references:
    - Internal Research
author: Florian Roth (Nextron Systems)
date: 2022-03-14
modified: 2022-07-26
tags:
    - attack.defense-evasion
    - attack.t1140
logsource:
    product: linux
    category: process_creation
detection:
    selection:
        CommandLine|startswith:
            - 'sh -c '
            - 'bash -c '
    selection_exec:
        - CommandLine|contains:
              - '| bash '
              - '| sh '
              - '|bash '
              - '|sh '
        - CommandLine|endswith:
              - '| bash'
              - '| sh'
              - '|bash'
              - ' |sh'
    condition: all of selection*
falsepositives:
    - Legitimate software that uses these patterns
level: medium

KQL (Azure Sentinel)

imProcessCreate
| where (TargetProcessCommandLine startswith "sh -c " or TargetProcessCommandLine startswith "bash -c ") and ((TargetProcessCommandLine contains "| bash " or TargetProcessCommandLine contains "| sh " or TargetProcessCommandLine contains "|bash " or TargetProcessCommandLine contains "|sh ") or (TargetProcessCommandLine endswith "| bash" or TargetProcessCommandLine endswith "| sh" or TargetProcessCommandLine endswith "|bash" or TargetProcessCommandLine endswith " |sh"))

False Positive Guidance

MITRE ATT&CK Context

Original source: https://github.com/SigmaHQ/sigma/blob/master/rules/linux/process_creation/proc_creation_lnx_susp_pipe_shell.yml