nuclei-templates/code/privilege-escalation/linux/binary/privesc-unshare.yaml

49 lines
1.2 KiB
YAML
Raw Normal View History

2024-01-22 13:29:57 +00:00
id: privesc-unshare
2023-12-13 15:07:24 +00:00
info:
name: Unshare - Privilege Escalation
author: daffainfo
severity: high
2024-01-22 13:29:57 +00:00
description: |
The unshare command is used to run a command in a new namespace, which can isolate various aspects of the system, such as the mount namespace, network namespace, user namespace, and more.
reference:
- https://gtfobins.github.io/gtfobins/unshare/
2023-12-13 15:07:24 +00:00
metadata:
verified: true
max-request: 3
tags: code,linux,unshare,privesc,local
2023-12-13 15:07:24 +00:00
self-contained: true
code:
- engine:
- sh
- bash
source: |
2024-01-22 13:29:57 +00:00
whoami
2023-12-13 15:07:24 +00:00
- engine:
- sh
- bash
source: |
2024-01-22 13:29:57 +00:00
unshare whoami
2023-12-13 15:07:24 +00:00
- engine:
- sh
- bash
source: |
2024-01-22 13:29:57 +00:00
sudo unshare whoami
2023-12-13 15:07:24 +00:00
matchers-condition: and
matchers:
2024-01-22 13:29:57 +00:00
- type: word
part: code_1_response
words:
- "root"
negative: true
2023-12-13 15:07:24 +00:00
- type: dsl
dsl:
- 'contains(code_2_response, "root")'
- 'contains(code_3_response, "root")'
condition: or
# digest: 4a0a00473045022053da7d0fa8366305b8da92b121e976f64c7cabab3c11d515e262f9e2466a6309022100d4e400f95a1d50fe9305d03f571586fdccd5da84a5c07543bfe90c35d0b44ec8:922c64590222798bb761d5b6d8e72950