# Docker Container

## Container Escapes

{% embed url="<https://book.hacktricks.xyz/linux-hardening/privilege-escalation/docker-breakout/docker-breakout-privilege-escalation>" %}

## Lateral Movement

Docker containers **can talk to the host machine** **and other docker containers**. A docker container usually has an IP address in the format 172.17.0.X.&#x20;

For example, if you are in a docker container with IP address 172.17.0.3, then 172.17.0.1 is probably the host machine, which you should **scan for open ports** with nma&#x70;**.** 172.17.0.2 is in that case probably another container, which you are also allowed to communicate with by default.

Keep in mind that docker containers can often talk to the internet, as well as private networks outside docker. For example, if your pwned docker container is on 172.17.0.3, but the host is in the 192.168.0.0 network, then your docker container will also be able to reach hosts on that 192.168.0.0 network.

Use statically compiled tools. Use **nmap** to scan and **chisel** to create tunnels from your machine through the pwned docker host.


---

# Agent Instructions: 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:

```
GET https://heinosass.gitbook.io/leet-sheet/post-exploitation/docker-container.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
