> 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/zh/privesc/user-groups/docker-group-linux-privilege-escalation.md).

# docker 组滥用 - Linux 权限提升

## 这是什么

危险的本地组成员关系即使不需要内核漏洞利用，也可能暴露特权资源。docker、lxd、adm 或 proxy 等组可能赋予主机控制权、敏感日志访问权限，或提供对横向移动和提权有用的配置路径。本页具体聚焦于 **用户组（Docker）** 并保持利用流程切合实际：识别条件，安全验证，然后运行证明影响所需的最小载荷。

## 枚举

在运行利用路径之前，先确认本地上下文和具体的错误配置。

```bash
id
groups
```

## 示例

> 在 Docker 中，对系统资源的访问管理方式与 Linux 等传统操作系统不同。Docker 使用镜像、容器和卷等概念将应用程序封装并在隔离环境中执行。

使用低权限用户 **jordan**，我们可以 **运行 Docker 命令**:

<figure><img src="/files/1e09f2a6f14bbac64b25b4fc2a3a7df887b9b500" alt=""><figcaption></figcaption></figure>

使用以下命令，我们启动一个 Docker 容器，它会 \*\* 挂载 root\*\* 用户的根目录：

```bash
docker run --rm -dit -v /:/mnt/root --name privesc ubuntu
```

我们还可以授予 **SUID 权限** 给 Bash：

<figure><img src="/files/607faaa541ad908735a80e879dd481810cacfc06" alt=""><figcaption></figcaption></figure>

当我们进入 **/mnt/etc/shadow** 文件时，我们会发现被散列的密码：

<figure><img src="/files/4493e9c53a94194cb0eb2de3451e3c1bcbd3c210" 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/zh/privesc/user-groups/docker-group-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.
