nuclei-templates/code/privilege-escalation/linux/rw-shadow.yaml

44 lines
1.1 KiB
YAML

id: rw-shadow
info:
name: /etc/shadow writable or readabel - Privilege Escalation
author: daffainfo
severity: high
reference:
- https://book.hacktricks.xyz/linux-hardening/privilege-escalation#writable-etc-shadow
metadata:
verified: true
tags: code,linux,privesc
self-contained: true
code:
- engine:
- sh
- bash
source: |
whoami
- engine:
- sh
- bash
source: |
[ -r "/etc/shadow" ] || [ -w "/etc/shadow" ] && echo "Either readable or writable" || echo "Not readable and not writable"
matchers:
- type: word
part: code_1_response
words:
- "root"
negative: true
- type: word
part: code_2_response
words:
- "Either readable or writable"
- type: word
part: code_2_response
words:
- "Not readable and not writable"
negative: true
# digest: 4b0a00483046022100c78963808dac941393a893b98ff00ee7009bd9228193e55ecbb9640e944f7789022100fca86fbd6ee146369c1bdfe59c87b532d1117bca280dba5ef319e71f0102fde1:922c64590222798bb761d5b6d8e72950