56 lines
1.5 KiB
YAML
56 lines
1.5 KiB
YAML
id: privesc-python
|
|
|
|
info:
|
|
name: PHP - Privilege Escalation
|
|
author: daffainfo
|
|
severity: high
|
|
description: |
|
|
Python is a high-level, general-purpose programming language known for its readability and simplicity. It is widely used for web development, scientific computing, artificial intelligence, and system automation. Python's versatility, extensive standard library, and large community make it a popular choice for a wide range of applications.
|
|
reference:
|
|
- https://gtfobins.github.io/gtfobins/python/
|
|
metadata:
|
|
verified: true
|
|
max-request: 4
|
|
tags: code,linux,php,privesc,local
|
|
|
|
self-contained: true
|
|
code:
|
|
- engine:
|
|
- sh
|
|
- bash
|
|
source: |
|
|
whoami
|
|
|
|
- engine:
|
|
- sh
|
|
- bash
|
|
source: |
|
|
python -c 'import os; os.system("whoami")'
|
|
|
|
- engine:
|
|
- sh
|
|
- bash
|
|
source: |
|
|
sudo python -c 'import os; os.system("whoami")'
|
|
|
|
- engine:
|
|
- sh
|
|
- bash
|
|
source: |
|
|
python -c 'import os; os.setuid(0); os.system("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")'
|
|
- 'contains(code_4_response, "root")'
|
|
condition: or
|
|
# digest: 4a0a00473045022042e3fab21f07a128fb933363cb4ba5a35ecab9338b906ac0404c149fa6d14384022100e8bfb2f3450a973d8926379260d5b9ea8254fb079eb27f64528850628716bd40:922c64590222798bb761d5b6d8e72950 |