env - Privilege Escalation
ID: privesc-env
Severity: high
Author: daffainfo
Tags: code,linux,env,privesc,local
Description
Section titled “Description”In Linux, the env command is used to display or modify the environment variables for a command. It can be used to set environment variables for a specific command or to print the current environment variables.
YAML Source
Section titled “YAML Source”id: privesc-env
info: name: env - Privilege Escalation author: daffainfo severity: high description: | In Linux, the env command is used to display or modify the environment variables for a command. It can be used to set environment variables for a specific command or to print the current environment variables. reference: - https://gtfobins.github.io/gtfobins/env/ metadata: verified: true max-request: 3 tags: code,linux,env,privesc,local
self-contained: truecode: - engine: - sh - bash source: | whoami
- engine: - sh - bash source: | expect -c 'spawn whoami;interact'
- engine: - sh - bash source: | sudo expect -c 'spawn whoami;interact'
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: 4a0a0047304502206d1cdcc0363b8a0ae09b4c8700fe32428347e021f647cc2265d38ccfd18a8c5b022100ce43bffa746fcee42e11f4eb7f751e43184859dd3fd1e102e7779bef9a6fae4c: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-env.yaml"