> 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/post-exploitation/alternate-data-streams-ads.md).

# Fluxos de dados alternativos (ADS)

> Fluxos de Dados Alternativos (ADS) é um recurso do **NTFS** sistemas de arquivos no Windows que permitem que múltiplos fluxos de dados sejam associados a um único arquivo. Esses fluxos adicionais podem conter informações ocultas que não são visíveis durante a inspeção tradicional do arquivo. Vamos explorar essa funcionalidade para descobrir a **flag de root**.

Atacantes e pentesters podem usar ADS para:

\***Ocultar arquivos maliciosos** (ex.: um executável oculto em um arquivo de texto). \***Evitar detecção por antivírus** e por certas ferramentas de segurança. \***Manter persistência** em uma máquina comprometida.

**Exemplo com o Bloco de Notas**:

```sh
notepad test.txt:secret.txt
```

Aqui, `secret.txt` é um arquivo oculto anexado a `test.txt`.

Arquivos ocultos não são visíveis com `dir`, mas você pode listá-los com:

```sh
dir /r
```

<figure><img src="/files/9d0e6d2748f18f4dd1ae8d71ddabe94939f1256f" alt=""><figcaption></figcaption></figure>

**Outro exemplo: injeção de um executável em um ADS**:

```bash
type payload.exe > windowslog.txt:winpeas.txt
```

Isso insere `payload.exe` no fluxo alternativo `winpeas.txt` anexado a `windowslog.txt`.

**Executando o arquivo oculto**:

```sh
start windowslog.txt:winpeas.exe
```

Isso executa `winpeas.exe`, embora esteja oculto em um ADS.

**Criando um link simbólico para execução oculta**

Um link simbólico pode ser usado para enganar um usuário e fazê-lo executar um binário oculto.

**Exemplo**:

```sh
mklink wupadate.exe C:/Temp/windowslog.txt:winpeas.exe
```

Este link simbólico `wupdate.exe` aponta para o arquivo ADS oculto.

```bash
wupdate 
```

Se um usuário digitar `wupdate`, o `winpeas.exe` programa será executado.

<figure><img src="/files/6e5ff72edbffea8e7057048333fd2c98600f21fd" alt=""><figcaption></figcaption></figure>

### **Visualizando o conteúdo do ADS**

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

#### **1. Verificando Fluxos de Dados Alternativos (ADS)**

Verifique se o **hm.txt** arquivo na **Administrator** área de trabalho contém fluxos de dados alternativos. Use o seguinte comando:

```bash
dir /r C:/Users/Administrator/Desktop/hm.txt
```

Este comando lista todos os fluxos de dados alternativos associados ao **hm.txt** arquivo. Se um fluxo de dados alternativo estiver presente, ele será exibido.

<figure><img src="/files/71b4494e6a37a5e1bbc715f804d512ce15327398" alt=""><figcaption></figcaption></figure>

#### **2. Visualizando o conteúdo de um fluxo de dados alternativo**

Se encontrarmos um fluxo de recursos alternativos associado ao arquivo, nossas opções estão no seguinte comando:

```powershell
more < C:/Users/Administrator/Desktop/hm.txt:root.txt
```

Isso nos permite ler o conteúdo do **root.txt** fluxo e recuperar a **flag de root :)**

<figure><img src="/files/8e97321ffba993afaa6f4e76dca8028e4b9d2900" 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/pt-br/post-exploitation/alternate-data-streams-ads.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.
