/etc/sudoers writable or readable - Privilege Escalation
ID: rw-sudoers
Severity: high
Author: daffainfo
Tags: code,linux,privesc,local
Description
Section titled “Description”YAML Source
Section titled “YAML Source”id: rw-sudoers
info: name: /etc/sudoers writable or readable - Privilege Escalation author: daffainfo severity: high reference: - https://book.hacktricks.xyz/linux-hardening/privilege-escalation#etc-sudoers-etc-sudoers.d metadata: verified: true max-request: 2 tags: code,linux,privesc,local
self-contained: truecode: - engine: - sh - bash source: | whoami
- engine: - sh - bash source: | [ -r "/etc/sudoers" ] || [ -w "/etc/sudoers" ] && 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: 490a004630440220058488f0abb109eeda0bb09699d34242875b4af49c51688db2197fd166f508e0022048ed2cfffb8b7b256a3eb1710ebf6a77dc391cc0d20314008b321708803f4881:922c64590222798bb761d5b6d8e72950Guide to check the vulnerabilities
Section titled “Guide to check the vulnerabilities”This template is used to detect vulnerabilities in web applications. It can be used with the Nuclei tool to scan for specific patterns or behaviors.
$ nuclei -u "URL" -t "code/privilege-escalation/linux/rw-sudoers.yaml"