> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/ru/privesc/docker-escape/docker-password-reuse-linux-privilege-escalation.md).

# Повторное использование пароля Docker — повышение привилегий в Linux

## Что это такое

Пути выхода из Docker используют неправильную конфигурацию контейнера, смонтированные ресурсы хоста, учетные данные по умолчанию, повторно используемые пароли или чрезмерные привилегии контейнера. Цель — перейти из контекста контейнера к доступу на уровне хоста. Эта конкретная страница посвящена **Побег из Docker (повторное использование пароля)** и делает процесс эксплуатации практичным: определить условие, безопасно его проверить, а затем запустить минимальный полезный код, необходимый для подтверждения воздействия.

## Перечисление

Сначала подтвердите локальный контекст и точную ошибку настройки перед запуском пути эксплуатации.

```bash
id
cat /proc/1/cgroup
mount
ls -la /var/run/docker.sock 2>/dev/null
```

## Примеры

Побег из Docker:

Мы видим, что IP-адрес не совпадает с адресом машины (IP машины: 10.10.11.130; IP контейнера Docker: 172.19.0.2).

<div data-full-width="true"><figure><img src="/files/a7e988e3025b4797bd4eb69487dc25993b630ef2" alt=""><figcaption></figcaption></figure></div>

Мы будем сканировать порты вручную, поскольку `nmap` не установлен на шлюзе (172.19.0.1) :

```bash
for PORT in {0..1000}; do timeout 1 bash -c "</dev/tcp/172.19.0.1/$PORT
&>/dev/null" 2>/dev/null && echo "port $PORT is open"; done
```

Мы видим, что порт 22 открыт (внутренний), поэтому мы можем подключиться по SSH.

```bash
for PORT in {0..1000}; do timeout 1 bash -c "</dev/tcp/172.19.0.1/$PORT&>/dev/null" 2>/dev/null && echo "port $PORT is open"; done
```

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

Если мы попробуем войти в систему под учетной записью root, используя `суперадминистратор` пароль, мы не сможем войти, но с `augustus`, нам удается получить оболочку.

<figure><img src="/files/488932d18967dd3e7e263b5253a4316e2ad55d5d" alt=""><figcaption></figcaption></figure>


---

# 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://hacking-notes.jord4n.pro/ru/privesc/docker-escape/docker-password-reuse-linux-privilege-escalation.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.
