43 lines
918 B
YAML
43 lines
918 B
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 |