← Back to SOC feed Coverage →

Shell Invocation via Env Command - Linux

sigma HIGH SigmaHQ
T1059
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

Adversaries may use the env command to invoke a shell as a method to bypass execution restrictions or execute arbitrary code in a Linux environment. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify potential privilege escalation or command injection attempts that evade traditional detection mechanisms.

Detection Rule

Sigma (Original)

title: Shell Invocation via Env Command - Linux
id: bed978f8-7f3a-432b-82c5-9286a9b3031a
status: test
description: |
    Detects the use of the env command to invoke a shell. This may indicate an attempt to bypass restricted environments, escalate privileges, or execute arbitrary commands.
references:
    - https://gtfobins.github.io/gtfobins/env/#shell
    - https://www.elastic.co/guide/en/security/current/linux-restricted-shell-breakout-via-linux-binary-s.html
author: Li Ling, Andy Parkidomo, Robert Rakowski, Blake Hartstein (Bloomberg L.P.)
date: 2024-09-02
tags:
    - attack.execution
    - attack.t1059
logsource:
    category: process_creation
    product: linux
detection:
    selection:
        Image|endswith: '/env'
        CommandLine|endswith:
            - '/bin/bash'
            - '/bin/dash'
            - '/bin/fish'
            - '/bin/sh'
            - '/bin/zsh'
    condition: selection
falsepositives:
    - Github operations such as ghe-backup
level: high

KQL (Azure Sentinel)

imProcessCreate
| where TargetProcessName endswith "/env" and (TargetProcessCommandLine endswith "/bin/bash" or TargetProcessCommandLine endswith "/bin/dash" or TargetProcessCommandLine endswith "/bin/fish" or TargetProcessCommandLine endswith "/bin/sh" or TargetProcessCommandLine endswith "/bin/zsh")

False Positive Guidance

MITRE ATT&CK Context

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