Detection rules › Sigma

Shell Execution GCC - Linux

Status
test
Severity
high
Log source
product linux, category process_creation
Author
Li Ling, Andy Parkidomo, Robert Rakowski, Blake Hartstein (Bloomberg L.P.)
Source
github.com/SigmaHQ/sigma

Detects the use of the "gcc" utility to execute a shell. Such behavior may be associated with privilege escalation, unauthorized command execution, or to break out from restricted environments.

MITRE ATT&CK coverage

TacticTechniques
DiscoveryT1083 File and Directory Discovery

Event coverage

Rule body yaml

title: Shell Execution GCC  - Linux
id: 9b5de532-a757-4d70-946c-1f3e44f48b4d
status: test
description: |
    Detects the use of the "gcc" utility to execute a shell. Such behavior may be associated with privilege escalation, unauthorized command execution, or to break out from restricted environments.
references:
    - https://gtfobins.github.io/gtfobins/gcc/#shell
    - https://gtfobins.github.io/gtfobins/c89/#shell
    - https://gtfobins.github.io/gtfobins/c99/#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.discovery
    - attack.t1083
logsource:
    category: process_creation
    product: linux
detection:
    selection_img:
        Image|endswith:
            - '/c89'
            - '/c99'
            - '/gcc'
        CommandLine|contains: '-wrapper'
    selection_cli:
        CommandLine|contains:
            - '/bin/bash,-s'
            - '/bin/dash,-s'
            - '/bin/fish,-s'
            - '/bin/sh,-s'
            - '/bin/zsh,-s'
    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:
        - '/c89'
        - '/c99'
        - '/gcc'
    CommandLine|contains: '-wrapper'

Stage 2: selection_cli

selection_cli:
    CommandLine|contains:
        - '/bin/bash,-s'
        - '/bin/dash,-s'
        - '/bin/fish,-s'
        - '/bin/sh,-s'
        - '/bin/zsh,-s'

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
  • -wrapper
  • /bin/bash,-s
  • /bin/dash,-s
  • /bin/fish,-s
  • /bin/sh,-s
  • /bin/zsh,-s
Imageends_with
  • /c89
  • /c99
  • /gcc