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

# Flux de données alternatifs (ADS)

> Les flux de données alternatifs (ADS) sont une fonctionnalité de **NTFS** systèmes de fichiers sous Windows qui permettent d’associer plusieurs flux de données à un seul fichier. Ces flux supplémentaires peuvent contenir des informations cachées qui ne sont pas visibles lors d’une inspection traditionnelle du fichier. Nous allons exploiter cette fonctionnalité pour découvrir le **flag root**.

Les attaquants et les pentesters peuvent utiliser les ADS pour :

\***Cacher des fichiers malveillants** (par exemple : un exécutable caché dans un fichier texte). \***Éviter la détection par les antivirus** et certains outils de sécurité. \***Maintenir la persistance** sur une machine compromise.

**Exemple avec le Bloc-notes**:

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

Ici, `secret.txt` est un fichier caché attaché à `test.txt`.

Les fichiers cachés ne sont pas visibles avec `dir`, mais vous pouvez les lister avec :

```sh
dir /r
```

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

**Autre exemple : injection d’un exécutable dans un ADS**:

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

Cela insère `payload.exe` dans le flux alternatif `winpeas.txt` attaché à `windowslog.txt`.

**Exécution du fichier caché**:

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

Cela exécute `winpeas.exe`, bien qu’il soit caché dans un ADS.

**Création d’un lien symbolique pour une exécution cachée**

Un lien symbolique peut être utilisé pour inciter un utilisateur à exécuter un binaire caché.

**Exemple**:

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

Ce lien symbolique `wupdate.exe` pointe vers le fichier ADS caché.

```bash
wupdate 
```

Si un utilisateur saisit `wupdate`, le `winpeas.exe` programme s’exécutera.

<figure><img src="/files/641bfe6b6528435a46d0eef96b1925c5faf2e74e" alt=""><figcaption></figcaption></figure>

### **Affichage du contenu des ADS**

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

#### **1. Vérification des flux de données alternatifs (ADS)**

Vérifiez si le **hm.txt** fichier sur le **Administrator** bureau contient des flux de données alternatifs. Utilisez la commande suivante :

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

Cette commande répertorie tous les flux de données alternatifs associés au **hm.txt** fichier. Si un flux de données alternatif est présent, il sera affiché.

<figure><img src="/files/621d43e2e54b1d3a3fb1e748f5117e99cd250445" alt=""><figcaption></figcaption></figure>

#### **2. Affichage du contenu d’un flux de données alternatif**

Si nous trouvons un flux de ressources alternatif associé au fichier, nos options se trouvent dans la commande suivante :

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

Cela nous permet de lire le contenu du **root.txt** flux et de récupérer le **flag root :)**

<figure><img src="/files/9d44c01b173498fc6e8a1458453d55c7e981cf47" 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/fr/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.
