2024-01-22 13:29:57 +00:00
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
tags : code,linux,env,privesc
self-contained : true
code :
- 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")'
2024-01-22 16:20:01 +00:00
condition : or
# digest: 4a0a00473045022060c647f36eb03856e0eaf016f8c04e4bf4100be1884abc528dbadb7d377272500221008e50317abae9efa259ad2a682bc304062fccb32782430543cb1aa2a6c34b32b4:922c64590222798bb761d5b6d8e72950