Linux env Execution Spawning Common Shells

Flags Linux executions of /env that invoke common shells like /bin/bash, /bin/sh, /bin/zsh, /bin/dash, or /bin/fish.

FreeReviewedSigma · High · v3
Product
linux
Category
process_creation
Author
Li Ling, Andy Parkidomo, Robert Rakowski, Blake Hartstein (Bloomberg L.P.) (SigmaHQ), DRL 1.1
Published
2024-09-02
Updated
2026-07-31
title: Linux env Execution Spawning Common Shells
id: 10b27514-c9df-4e1f-b8e6-2eebc7970dcf
status: test
description: This rule flags process creations where the executed binary ends with '/env' and the command line contains one of several common shell paths (/bin/bash, /bin/dash, /bin/fish, /bin/sh, /bin/zsh). Spawning a shell via env can help an attacker launch interactive or scripted execution while operating within a restricted or wrapped command context. The detection relies on Linux process creation telemetry with accurate Image and CommandLine fields.
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
  - https://github.com/SigmaHQ/sigma/blob/master/rules/linux/process_creation/proc_creation_lnx_env_shell_invocation.yml
author: Li Ling, Andy Parkidomo, Robert Rakowski, Blake Hartstein (Bloomberg L.P.), Huntrule Team
date: 2024-09-02
modified: 2026-01-08
tags:
  - attack.execution
  - attack.t1059.004
logsource:
  category: process_creation
  product: linux
detection:
  selection:
    Image|endswith: /env
    CommandLine|contains:
      - /bin/bash
      - /bin/dash
      - /bin/fish
      - /bin/sh
      - /bin/zsh
  condition: selection
falsepositives:
  - Github operations such as ghe-backup
level: high
license: DRL-1.1
related:
  - id: bed978f8-7f3a-432b-82c5-9286a9b3031a
    type: derived