47 lines
980 B
YAML
47 lines
980 B
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 |