2024-01-22 13:29:57 +00:00
id : privesc-flock
info :
name : Flock - Privilege Escalation
author : daffainfo
severity : high
description : |
flock is a command-line utility in Unix-like operating systems that is used to manage file locks. It can be used to synchronize access to a file among multiple processes, preventing conflicts and ensuring data integrity. Additionally, flock can be used in shell scripts to control access to critical sections of code.
reference :
- https://gtfobins.github.io/gtfobins/flock/
metadata :
verified : true
2024-01-29 11:58:34 +00:00
max-request : 3
2024-01-31 17:41:31 +00:00
tags : code,linux,flock,privesc,local
2024-01-22 13:29:57 +00:00
self-contained : true
code :
- engine :
- sh
- bash
source : |
whoami
- engine :
- sh
- bash
source : |
flock -u / whoami
- engine :
- sh
- bash
source : |
sudo flock -u / whoami
matchers-condition : and
matchers :
- type : word
part : code_1_response
words :
- "root"
negative : true
- type : dsl
dsl :
- 'contains(code_2_response, "root")'
- 'contains(code_3_response, "root")'
2024-01-22 16:20:01 +00:00
condition : or
2024-01-31 17:43:39 +00:00
# digest: 4a0a00473045022100de7de6316a36966e591a532e458496e3deafdcf99db9d1b6e06ba8804b5156bf022035df063cb6d81a55b81577f7e7cc8f167990d113dbc9b870d5c388a0c7feb8fc:922c64590222798bb761d5b6d8e72950