nuclei-templates/code/privilege-escalation/linux/binary/privesc-ssh-agent.yaml

48 lines
1.2 KiB
YAML

id: privesc-ssh-agent
info:
name: ssh-agent - Privilege Escalation
author: daffainfo
severity: high
description: |
ssh-agent is a program that helps manage and store private keys used for SSH authentication. It is often used to hold the decrypted private keys in memory, allowing for seamless authentication to remote servers without the need to re-enter passphrases for the keys.
reference:
- https://gtfobins.github.io/gtfobins/ssh-agent/
metadata:
verified: true
tags: code,linux,ssh-agent,privesc
self-contained: true
code:
- engine:
- sh
- bash
source: |
whoami
- engine:
- sh
- bash
source: |
ssh-agent whoami
- engine:
- sh
- bash
source: |
sudo ssh-agent 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: 4a0a00473045022100b753c3b219a51512f664bffcb2260ee8818cb2dedc7ad56dd2abfbc9c3098c9d02203c904efa51d90d9e74cf3fc931c0746d801e5359cd7c2c302de15089e6000896:922c64590222798bb761d5b6d8e72950