48 lines
1.1 KiB
YAML
48 lines
1.1 KiB
YAML
id: privesc-unshare
|
|
|
|
info:
|
|
name: Unshare - Privilege Escalation
|
|
author: daffainfo
|
|
severity: high
|
|
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/
|
|
metadata:
|
|
verified: true
|
|
tags: code,linux,unshare,privesc
|
|
|
|
self-contained: true
|
|
code:
|
|
- engine:
|
|
- sh
|
|
- bash
|
|
source: |
|
|
whoami
|
|
|
|
- engine:
|
|
- sh
|
|
- bash
|
|
source: |
|
|
unshare whoami
|
|
|
|
- engine:
|
|
- sh
|
|
- bash
|
|
source: |
|
|
sudo unshare 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")'
|
|
condition: or
|
|
# digest: 4a0a00473045022051813a52f05fe4e85c256e0fb2b37db4c2ca3ad0761c191bcfc84b832a3376fe022100b548ea734cc498a18fb003c25273e18a27c6e3b264f0092a0559822203bc056f:922c64590222798bb761d5b6d8e72950 |