Linux: Git Process Used to Launch a Shell via Bash/Dash/Sh Input Redirection

Flags Linux command lines where git usage (with -p and help) triggers bash/dash/sh execution via stdin redirection.

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: Git Process Used to Launch a Shell via Bash/Dash/Sh Input Redirection"
id: 95692309-c22a-49ef-bd0f-258b297654af
status: test
description: "This rule flags process creation where a parent process ending in /git runs with arguments containing both ' -p ' and 'help', and the child command line includes shell launch patterns using input redirection: 'bash 0<&1', 'dash 0<&1', or 'sh 0<&1'. Attackers may use this to spawn or manipulate shells, potentially enabling unauthorized command execution or bypassing restrictions. Detection relies on Linux process creation telemetry with access to both parent process image/command line and the spawned command line content."
references:
  - https://gtfobins.github.io/gtfobins/git/#shell
  - https://github.com/SigmaHQ/sigma/blob/master/rules/linux/process_creation/proc_creation_lnx_git_shell_execution.yml
author: Li Ling, Andy Parkidomo, Robert Rakowski, Blake Hartstein (Bloomberg L.P.), Huntrule Team
date: 2024-09-02
tags:
  - attack.execution
  - attack.t1059
logsource:
  category: process_creation
  product: linux
detection:
  selection:
    ParentImage|endswith: /git
    ParentCommandLine|contains|all:
      - " -p "
      - help
    CommandLine|contains:
      - bash 0<&1
      - dash 0<&1
      - sh 0<&1
  condition: selection
falsepositives:
  - Unknown
level: high
license: DRL-1.1
related:
  - id: 47b3bbd4-1bf7-48cc-84ab-995362aaa75a
    type: derived