> For the complete documentation index, see [llms.txt](https://vida03.gitbook.io/redteam/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vida03.gitbook.io/redteam/docker/docker-breakout/environments.md).

# environments

## Apresentação

Muitos contêiner setam variáveis de ambiente, podemos recuperar esses valores para ver se tem alguma credencial ou algum dado sensível. Veja um exemplo a seguir

<figure><img src="/files/nTO082cb4g1orwwLsbuG" alt=""><figcaption></figcaption></figure>

## Recovering environments

Podemos recuperar essas variavéis de ambiente facilmente utilizando o **docker inspect**

```
# Você irá ver diversas informações sobre o contêiner
docker inspect <NOME_DA_IMAGEM>

# Selecionar apenas as variáveis
docker inspect <NOME_DA_IMAGEM> -f "{{json .Config.Env}}"
```

<figure><img src="/files/tyrm1p0vpGRYz44QkypW" alt=""><figcaption></figcaption></figure>

## Conclusão

Se você estiver em um host, confira as imagens e veja se possui credenciais nas variáveis de ambiente se setadas, essas credenciais podemos ser usadas para outras autenticações, conseguindo assim uma escalação de privilégio por exemplo.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://vida03.gitbook.io/redteam/docker/docker-breakout/environments.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
