Detection rules › Sigma

Vim GTFOBin Abuse - Linux

Status
test
Severity
high
Log source
product linux, category process_creation
Author
Nasreddine Bencherchali (Nextron Systems), Luc Génaux
Source
github.com/SigmaHQ/sigma

Detects the use of "vim" and it's siblings commands to execute a shell or proxy commands. Such behavior may be associated with privilege escalation, unauthorized command execution, or to break out from restricted environments.

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: Vim GTFOBin Abuse - Linux
id: 7ab8f73a-fcff-428b-84aa-6a5ff7877dea
status: test
description: |
    Detects the use of "vim" and it's siblings commands to execute a shell or proxy commands.
    Such behavior may be associated with privilege escalation, unauthorized command execution, or to break out from restricted environments.
references:
    - https://gtfobins.github.io/gtfobins/vi/
    - https://gtfobins.github.io/gtfobins/vim/
    - https://gtfobins.github.io/gtfobins/rvim/
    - https://gtfobins.github.io/gtfobins/vimdiff/
author: Nasreddine Bencherchali (Nextron Systems), Luc Génaux
date: 2022-12-28
modified: 2026-06-05
tags:
    - attack.execution
    - attack.discovery
    - attack.t1059
    - attack.t1083
logsource:
    category: process_creation
    product: linux
detection:
    selection_img:
        Image|endswith:
            - '/rvim'
            - '/vi'
            - '/vim'
            - '/vimdiff'
        CommandLine|contains:
            - ' --cmd '
            - ' -c'
    selection_cli:
        CommandLine|contains:
            - ':!/'
            - ':!$'
            - ':!..'
            - ':lua '
            - ':py '
            - ':shell'
            - '/bin/bash'
            - '/bin/dash'
            - '/bin/fish'
            - '/bin/sh'
            - '/bin/csh'
            - '/bin/ksh'
            - '/bin/zsh'
            - '/bin/tmux'
    condition: all of selection_*
falsepositives:
    - Unknown
level: high

Stages and Predicates

Stage 0: condition

all of selection_*

Stage 1: selection_img

selection_img:
    Image|endswith:
        - '/rvim'
        - '/vi'
        - '/vim'
        - '/vimdiff'
    CommandLine|contains:
        - ' --cmd '
        - ' -c'

Stage 2: selection_cli

selection_cli:
    CommandLine|contains:
        - ':!/'
        - ':!$'
        - ':!..'
        - ':lua '
        - ':py '
        - ':shell'
        - '/bin/bash'
        - '/bin/dash'
        - '/bin/fish'
        - '/bin/sh'
        - '/bin/csh'
        - '/bin/ksh'
        - '/bin/zsh'
        - '/bin/tmux'

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
CommandLinematch
  • --cmd
  • -c
  • /bin/bash
  • /bin/csh
  • /bin/dash
  • /bin/fish
  • /bin/ksh
  • /bin/sh
  • /bin/tmux
  • /bin/zsh
  • :!$
  • :!..
  • :!/
  • :lua
  • :py
  • :shell
Imageends_with
  • /rvim
  • /vi
  • /vim
  • /vimdiff