Linux capsh Shell Execution via Shell-Spawn Command Line Ending With " --"

Alerts on Linux executions of /capsh with a command line ending in " --", consistent with shell invocation attempts.

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 capsh Shell Execution via Shell-Spawn Command Line Ending With " --"
id: 14037ebb-7aaf-453d-a070-6146d6b5a17a
status: test
description: This rule flags Linux process executions where the binary path ends with "/capsh" and the command line ends with " --", indicating an attempt to use capsh to spawn a shell. Attackers may leverage capsh to break out of restricted environments or gain interactive command execution. The detection relies on process creation telemetry, specifically the process image path and the full command line.
references:
  - https://gtfobins.github.io/gtfobins/capsh/#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_capsh_shell_invocation.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:
    Image|endswith: /capsh
    CommandLine|endswith: " --"
  condition: selection
falsepositives:
  - Unknown
level: high
license: DRL-1.1
related:
  - id: db1ac3be-f606-4e3a-89e0-9607cbe6b98a
    type: derived