Files
nuclei-templates/code/privilege-escalation/linux/binary/privilege-escalation-ruby.yaml
2023-12-13 22:07:24 +07:00

54 lines
982 B
YAML

id: privilege-escalation-ruby
info:
name: Ruby - Privilege Escalation
author: daffainfo
severity: high
reference: https://gtfobins.github.io/gtfobins/ruby/
metadata:
verified: true
tags: code,linux,ruby,privesc
self-contained: true
code:
- engine:
- sh
- bash
source: |
whoami
#SUID
- engine:
- sh
- bash
source: |
ruby -e 'exec "whoami"'
#SUDO
- engine:
- sh
- bash
source: |
sudo ruby -e 'exec "whoami"'
#Capabilities
- engine:
- sh
- bash
source: |
ruby -e 'Process::Sys.setuid(0); 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")'
- 'contains(code_4_response, "root")'
condition: or