Shell Execution via Flock - Linux

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

Sigma rule (View on GitHub)

 1title: Shell Execution via Flock - Linux
 2id: 4b09c71e-4269-4111-9cdd-107d8867f0cc
 3status: test
 4description: |
 5        Detects the use of the "flock" command to execute a shell. Such behavior may be associated with privilege escalation, unauthorized command execution, or to break out from restricted environments.
 6references:
 7    - https://gtfobins.github.io/gtfobins/flock/#shell
 8    - https://github.com/elastic/detection-rules/blob/0aacc5e19292f764a002ea2093b2a076db35b589/rules/_deprecated/execution_shell_evasion_linux_binary.toml
 9author: Li Ling, Andy Parkidomo, Robert Rakowski, Blake Hartstein (Bloomberg L.P.)
10date: 2024-09-02
11tags:
12    - attack.discovery
13    - attack.t1083
14logsource:
15    category: process_creation
16    product: linux
17detection:
18    selection_img:
19        Image|endswith: '/flock'
20        CommandLine|contains: ' -u '
21    selection_cli:
22        CommandLine|contains:
23            - '/bin/bash'
24            - '/bin/dash'
25            - '/bin/fish'
26            - '/bin/sh'
27            - '/bin/zsh'
28    condition: all of selection_*
29falsepositives:
30    - Unknown
31level: high

References

Related rules

to-top